-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic client, Browser + Node.js connections (#165)
Co-authored-by: slvrtrn <[email protected]> Co-authored-by: Mikhail Shustov <[email protected]>
- Loading branch information
1 parent
897dbf4
commit 9da7655
Showing
195 changed files
with
4,896 additions
and
4,607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
node_modules | ||
webpack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,6 @@ name: 'tests' | |
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
push-coverage-report: | ||
type: choice | ||
required: true | ||
description: Push coverage | ||
options: | ||
- yes | ||
- no | ||
default: no | ||
push: | ||
branches: | ||
- main | ||
|
@@ -20,10 +11,8 @@ on: | |
- 'benchmarks/**' | ||
- 'examples/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'README.md' | ||
- '**/*.md' | ||
- 'LICENSE' | ||
- 'benchmarks/**' | ||
- 'examples/**' | ||
|
@@ -32,12 +21,12 @@ on: | |
- cron: '0 9 * * *' | ||
|
||
jobs: | ||
build: | ||
node-unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node: [ 16, 18, 20 ] | ||
node: [16, 18, 20] | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
|
@@ -60,16 +49,47 @@ jobs: | |
- name: Run unit tests | ||
run: | | ||
npm run test:unit | ||
npm run test:node:unit | ||
integration-tests-local-single-node: | ||
needs: build | ||
browser-all-tests-local-single-node: | ||
runs-on: ubuntu-latest | ||
needs: node-unit-tests | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node: [ 16, 18, 20 ] | ||
clickhouse: [ head, latest ] | ||
clickhouse: [head, latest] | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker | ||
uses: isbang/[email protected] | ||
env: | ||
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }} | ||
with: | ||
compose-file: 'docker-compose.yml' | ||
down-flags: '--volumes' | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install | ||
- name: Run all browser tests | ||
run: | | ||
npm run test:browser | ||
node-integration-tests-local-single-node: | ||
needs: node-unit-tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node: [16, 18, 20] | ||
clickhouse: [head, latest] | ||
|
||
steps: | ||
- uses: actions/checkout@main | ||
|
@@ -95,35 +115,27 @@ jobs: | |
run: | | ||
sudo echo "127.0.0.1 server.clickhouseconnect.test" | sudo tee -a /etc/hosts | ||
# Includes TLS integration tests run | ||
# Will also run unit tests, but that's almost free. | ||
# Otherwise, we need to set up a separate job, | ||
# which will also run the integration tests for the second time, | ||
# and that's more time-consuming. | ||
- name: Run all tests | ||
- name: Run integration tests | ||
run: | | ||
npm t -- --coverage | ||
npm run test:node:integration | ||
- name: Upload coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage | ||
path: coverage | ||
retention-days: 1 | ||
- name: Run TLS tests | ||
run: | | ||
npm run test:node:tls | ||
integration-tests-local-cluster: | ||
needs: build | ||
node-integration-tests-local-cluster: | ||
needs: node-unit-tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node: [ 16, 18, 20 ] | ||
clickhouse: [ head, latest ] | ||
node: [16, 18, 20] | ||
clickhouse: [head, latest] | ||
|
||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker | ||
- name: Start ClickHouse cluster (version - ${{ matrix.clickhouse }}) in Docker | ||
uses: isbang/[email protected] | ||
env: | ||
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }} | ||
|
@@ -142,15 +154,46 @@ jobs: | |
- name: Run integration tests | ||
run: | | ||
npm run test:integration:local_cluster | ||
npm run test:node:integration:local_cluster | ||
integration-tests-cloud: | ||
needs: build | ||
browser-integration-tests-local-cluster: | ||
runs-on: ubuntu-latest | ||
needs: node-unit-tests | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node: [ 16, 18, 20 ] | ||
clickhouse: [head, latest] | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- name: Start ClickHouse cluster (version - ${{ matrix.clickhouse }}) in Docker | ||
uses: isbang/[email protected] | ||
env: | ||
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }} | ||
with: | ||
compose-file: 'docker-compose.cluster.yml' | ||
down-flags: '--volumes' | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install | ||
- name: Run all browser tests | ||
run: | | ||
npm run test:browser:integration:local_cluster | ||
node-integration-tests-cloud: | ||
needs: node-unit-tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node: [16, 18, 20] | ||
|
||
steps: | ||
- uses: actions/checkout@main | ||
|
@@ -169,37 +212,27 @@ jobs: | |
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST }} | ||
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD }} | ||
run: | | ||
npm run test:integration:cloud | ||
npm run test:node:integration:cloud | ||
upload-coverage-and-badge: | ||
if: github.ref == 'refs/heads/main' && github.event.inputs.push-coverage-report != 'no' | ||
needs: | ||
- integration-tests-local-single-node | ||
- integration-tests-local-cluster | ||
- integration-tests-cloud | ||
browser-integration-tests-cloud: | ||
needs: node-unit-tests | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- uses: actions/checkout@main | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Download coverage report | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage | ||
path: coverage | ||
- name: Install packages | ||
run: npm i -G make-coverage-badge | ||
- name: Generate badge | ||
run: npx make-coverage-badge | ||
- name: Make "Coverage" lowercase for style points | ||
run: sed -i 's/Coverage/coverage/g' coverage/badge.svg | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
file_pattern: 'coverage' | ||
commit_message: '[skip ci] Update coverage report' | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install | ||
- name: Run integration tests | ||
env: | ||
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST }} | ||
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD }} | ||
run: | | ||
npm run test:browser:integration:cloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ node_modules | |
benchmarks/leaks/input | ||
*.tgz | ||
.npmrc | ||
webpack |
Oops, something went wrong.