From 32a17ca5a17024260505e4e29b5e367755b543bf Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 10 Sep 2024 03:10:54 +0300 Subject: [PATCH 1/5] fix tests CI --- .github/workflows/node-clickhouse.js.yml | 16 ++-------------- package.json | 2 +- pyroscope/pyroscope.js | 8 ++++---- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/node-clickhouse.js.yml b/.github/workflows/node-clickhouse.js.yml index 302a6710..602b1b35 100644 --- a/.github/workflows/node-clickhouse.js.yml +++ b/.github/workflows/node-clickhouse.js.yml @@ -36,29 +36,17 @@ jobs: - 9000:9000 steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.0 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - name: build qryn-view uses: ./.github/actions/get-view env: TAG: v3.3.2 - name: check if qryn-view pulled run: pushd view && ls | grep assets && popd - - run: npm install - - run: npm run postinstall - run: git submodule init - run: git submodule update - name: Workflow Telemetry uses: runforesight/workflow-telemetry-action@v1.8.7 if: github.event_name != 'pull_request' - env: - CLICKHOUSE_DB: qryn - CLICKHOUSE_TSDB: qryn - INTEGRATION_E2E: 1 - CLOKI_EXT_URL: 127.0.0.1:3100 - QRYN_LOGIN: a - QRYN_PASSWORD: b - run: node qryn.mjs >/dev/stdout & npm run test --forceExit + NODE_VERSION: ${{ matrix.node-version }} + run: "sh ./test/e2e/compose/clickhouse_sso_e2e/run_test.sh" diff --git a/package.json b/package.json index f80a9070..fcf6262b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "qryn": "./qryn_node.js" }, "scripts": { - "test": "jest", + "test": "jest --maxWorkers 1 --forceExit", "start": "node qryn.mjs", "pretty": "node qryn.mjs | pino-pretty", "postinstall": "patch-package", diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index b47e5dde..b62beeea 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -246,11 +246,11 @@ const selectMergeProfile = async (req, res) => { const series = async (req, res) => { const _req = req.body - const fromTimeSec = Math.floor(req.getStart && req.getStart() - ? parseInt(req.getStart()) / 1000 + const fromTimeSec = Math.floor(_req.getStart && _req.getStart() + ? parseInt(_req.getStart()) / 1000 : (Date.now() - HISTORY_TIMESPAN) / 1000) - const toTimeSec = Math.floor(req.getEnd && req.getEnd() - ? parseInt(req.getEnd()) / 1000 + const toTimeSec = Math.floor(_req.getEnd && _req.getEnd() + ? parseInt(_req.getEnd()) / 1000 : Date.now() / 1000) const dist = clusterName ? '_dist' : '' const promises = [] From 88b7039740566811f1bd1c65b7202ef1409fe6d1 Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 10 Sep 2024 03:11:13 +0300 Subject: [PATCH 2/5] update e2e deps --- test/e2e | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e b/test/e2e index b09c5c87..7d74fa22 160000 --- a/test/e2e +++ b/test/e2e @@ -1 +1 @@ -Subproject commit b09c5c877d6416505c390d634eb9d19a80b7e163 +Subproject commit 7d74fa22682e1e0635c2dc1fff093aa471d29ddb From 8b77c306d43a2a40edcb2ba4b8035b2683b12118 Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 10 Sep 2024 03:13:14 +0300 Subject: [PATCH 3/5] upd e2e --- test/e2e | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e b/test/e2e index 7d74fa22..0ecc2256 160000 --- a/test/e2e +++ b/test/e2e @@ -1 +1 @@ -Subproject commit 7d74fa22682e1e0635c2dc1fff093aa471d29ddb +Subproject commit 0ecc22567a16247eb6a0fcabf845433aca94302d From 0a2f0c6587ff27a101f2270ea7bdb9045776c3a3 Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 10 Sep 2024 03:14:43 +0300 Subject: [PATCH 4/5] fix test ci --- .github/workflows/node-clickhouse.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-clickhouse.js.yml b/.github/workflows/node-clickhouse.js.yml index 602b1b35..4a7d6f45 100644 --- a/.github/workflows/node-clickhouse.js.yml +++ b/.github/workflows/node-clickhouse.js.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18, 16.x, 20] + node-version: [18, 16, 20] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ services: clickhouse: From f191c6829f5d8f84fea49a3a56d66528bc075a60 Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 10 Sep 2024 12:26:51 +0300 Subject: [PATCH 5/5] e2e upd; bun support --- .github/workflows/bun-clickhouse.js.yml | 14 +------------- .github/workflows/node-clickhouse-cluster.js.yml | 16 +++------------- test/e2e | 2 +- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/.github/workflows/bun-clickhouse.js.yml b/.github/workflows/bun-clickhouse.js.yml index 1f3da331..5bcca0c0 100644 --- a/.github/workflows/bun-clickhouse.js.yml +++ b/.github/workflows/bun-clickhouse.js.yml @@ -35,22 +35,10 @@ jobs: - 9000:9000 steps: - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 - with: - bun-version: ${{ matrix.bun-version }} - run: rm -rf package-lock.json - run: git submodule init - run: git submodule update - - run: bun install - - run: cd test/e2e && bun install - name: Workflow Telemetry uses: runforesight/workflow-telemetry-action@v1.8.7 if: github.event_name != 'pull_request' - - env: - CLICKHOUSE_DB: qryn - CLICKHOUSE_TSDB: qryn - INTEGRATION_E2E: 1 - CLOKI_EXT_URL: 127.0.0.1:3100 - QRYN_LOGIN: a - QRYN_PASSWORD: b - run: bun --bun qryn.mjs >/dev/stdout & bun run test --forceExit + - run: 'sh test/e2e/compose/clickhouse_sso_e2e_bun/run_test.sh' diff --git a/.github/workflows/node-clickhouse-cluster.js.yml b/.github/workflows/node-clickhouse-cluster.js.yml index 50a65a72..00200bd8 100644 --- a/.github/workflows/node-clickhouse-cluster.js.yml +++ b/.github/workflows/node-clickhouse-cluster.js.yml @@ -26,15 +26,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18, 16.x, 20] + node-version: [18, 16, 20] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.0 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - run: npm install - run: npm run postinstall - run: git submodule init @@ -44,14 +39,9 @@ jobs: with: version: v2.1.0 # defaults to 'latest' legacy: true # will also install in PATH as `docker-compose` - - run: docker-compose -f docker/e2e/docker-compose-cluster.yaml up -d - - run: sleep 5 - name: Workflow Telemetry uses: runforesight/workflow-telemetry-action@v1.8.7 if: github.event_name != 'pull_request' - env: - CLICKHOUSE_DB: qryn - CLICKHOUSE_TSDB: qryn - INTEGRATION_E2E: 1 - CLOKI_EXT_URL: 127.0.0.1:3100 - run: CLUSTER_NAME=test_cluster_two_shards node qryn.mjs >/dev/stdout & sleep 10 && npm run test --forceExit + NODE_VERSION: ${{ matrix.node-version }} + run: "sh ./test/e2e/compose/clickhouse_cluster_e2e/run_test.sh" diff --git a/test/e2e b/test/e2e index 0ecc2256..376a7dbb 160000 --- a/test/e2e +++ b/test/e2e @@ -1 +1 @@ -Subproject commit 0ecc22567a16247eb6a0fcabf845433aca94302d +Subproject commit 376a7dbbc46109a1bb568b23ad8d27477b6ca91f