Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/instructions/review.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ In other cases when you've found a meaningful change to make, make it and push c
## Review focus

When reviewing PRs to the `release` branch focus on flagging breaking changes and security issues in the broader context, as PRs to the `release` branch are normally bigger and include a cumulative change from a number of PRs.

## Breaking changes

Always flag major breaking changes to the public API (removed/renamed exports, changed function signatures, changed default behavior, removed configuration options, etc.) when they are not accompanied by a clear explanation in the PR description or PR discussion/code comments justifying why the break is necessary. This is important because LLMs generating code against newer client versions rely heavily on training data from older versions; undocumented breaking changes degrade their effectiveness and produce broken code for users. When such a change lacks justification, request that the author either add a clear rationale (and, where possible, a migration note) or restore backwards compatibility (e.g., via a deprecation path).
56 changes: 56 additions & 0 deletions .github/workflows/tests-bun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'bun'

permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'LICENSE'
- 'benchmarks/**'
pull_request:
paths-ignore:
- '**/*.md'
- 'LICENSE'
- 'benchmarks/**'

concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

jobs:
common-unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

- name: Install dependencies
run: |
bun install

- name: Run common unit tests
run: |
npm run test:common:unit:bun

node-unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

- name: Install dependencies
run: |
bun install

- name: Run node unit tests
run: |
npm run test:node:unit:bun
227 changes: 17 additions & 210 deletions .github/workflows/tests.yml → .github/workflows/tests-node.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'tests'
name: 'node'

permissions: {}
on:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
run: |
npm run lint

common-unit-tests-node:
common-unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -88,39 +88,7 @@ jobs:
run: |
node .scripts/export-coverage-metrics.mjs

common-unit-tests-web:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox] # We're not testing in WebKit atm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24

- name: Install dependencies
run: |
npm install
npx playwright install ${{ matrix.browser }}

- name: Run unit tests (${{ matrix.browser }})
env:
BROWSER: ${{ matrix.browser }}
run: |
npm run test:common:unit:web

- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.browser }})
run: |
node .scripts/export-coverage-metrics.mjs

node-unit-tests:
unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -154,48 +122,7 @@ jobs:
run: |
node .scripts/export-coverage-metrics.mjs

web-all-tests-local-single-node:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox] # We're not testing in WebKit atm
clickhouse: [head, latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker
uses: isbang/compose-action@3846bcd61da338e9eaaf83e7ed0234a12b099b72 # v2.4.2
env:
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
with:
compose-file: 'docker-compose.yml'
down-flags: '--volumes'

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24

- name: Install dependencies
run: |
npm install
npx playwright install ${{ matrix.browser }}

- name: Run all web tests
env:
BROWSER: ${{ matrix.browser }}
run: |
npm run test:web:all

- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.browser }}, ${{ matrix.clickhouse }})
run: |
node .scripts/export-coverage-metrics.mjs

node-integration-tests-local-single-node:
integration-tests-local-single-node:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -256,7 +183,7 @@ jobs:
run: |
node .scripts/export-coverage-metrics.mjs

node-integration-tests-local-cluster:
integration-tests-local-cluster:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -295,48 +222,7 @@ jobs:
run: |
node .scripts/export-coverage-metrics.mjs

web-integration-tests-local-cluster:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox] # We're not testing in WebKit atm
clickhouse: [head, latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Start ClickHouse cluster (version - ${{ matrix.clickhouse }}) in Docker
uses: isbang/compose-action@3846bcd61da338e9eaaf83e7ed0234a12b099b72 # v2.4.2
env:
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
with:
compose-file: 'docker-compose.yml'
down-flags: '--volumes'

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24

- name: Install dependencies
run: |
npm install
npx playwright install ${{ matrix.browser }}

- name: Run all web tests
env:
BROWSER: ${{ matrix.browser }}
run: |
npm run test:web:integration:local_cluster

- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.browser }}, ${{ matrix.clickhouse }})
run: |
node .scripts/export-coverage-metrics.mjs

node-integration-tests-cloud:
integration-tests-cloud:
# Cloud secrets are not available for PRs from forks; skip the job in that case.
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
timeout-minutes: 5
Expand Down Expand Up @@ -372,54 +258,23 @@ jobs:
run: |
node .scripts/export-coverage-metrics.mjs

web-integration-tests-cloud:
# Cloud secrets are not available for PRs from forks; skip the job in that case.
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
# It should only use the current LTS version of Node.js.
codecov-upload:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox] # We're not testing in WebKit atm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24

- name: Install dependencies
run: |
npm install
npx playwright install ${{ matrix.browser }}

- name: Run integration tests and JWT auth
env:
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT_PROD }}
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT_PROD }}
CLICKHOUSE_CLOUD_JWT_ACCESS_TOKEN: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_DESERT_VM_43_PROD }}
BROWSER: ${{ matrix.browser }}
run: |
npm run test:web:integration:cloud:jwt

- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.browser }})
run: |
node .scripts/export-coverage-metrics.mjs

# It should only use the current LTS version of Node.js.
node-codecov-upload:
timeout-minutes: 5
runs-on: ubuntu-latest
clickhouse: [head, latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker
uses: isbang/compose-action@3846bcd61da338e9eaaf83e7ed0234a12b099b72 # v2.4.2
env:
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
with:
compose-file: 'docker-compose.yml'
down-flags: '--volumes'
Expand Down Expand Up @@ -451,64 +306,16 @@ jobs:
files: ./coverage/lcov.info
fail_ci_if_error: true

# It should only use the current version of Chrome
web-codecov-upload:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker
uses: isbang/compose-action@3846bcd61da338e9eaaf83e7ed0234a12b099b72 # v2.4.2
with:
compose-file: 'docker-compose.yml'
down-flags: '--volumes'

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24

- name: Install dependencies
run: |
npm install
npx playwright install chromium

- name: Add ClickHouse TLS instance to /etc/hosts
run: |
sudo echo "127.0.0.1 server.clickhouseconnect.test" | sudo tee -a /etc/hosts

- name: Run unit + integration + TLS tests with coverage
env:
LOG_LEVEL: TRACE
run: |
npm run test:web:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
name: web
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true

success:
needs:
[
'code-quality',
'common-unit-tests-node',
'common-unit-tests-web',
'node-unit-tests',
'node-integration-tests-local-single-node',
'node-integration-tests-local-cluster',
'node-integration-tests-cloud',
'node-codecov-upload',
'web-all-tests-local-single-node',
'web-integration-tests-local-cluster',
'web-integration-tests-cloud',
'web-codecov-upload',
'common-unit-tests',
'unit-tests',
'integration-tests-local-single-node',
'integration-tests-local-cluster',
'integration-tests-cloud',
'codecov-upload',
]
# Run even if some needed jobs were skipped (e.g. cloud jobs on PRs from forks),
# but still fail if any of them failed or were cancelled.
Expand Down
Loading
Loading