Skip to content

Commit

Permalink
Merge pull request #572 from metrico/chore/prometheus_tests
Browse files Browse the repository at this point in the history
chore/pyroscope tests
  • Loading branch information
akvlad authored Sep 10, 2024
2 parents 1140496 + f191c68 commit 8c73c48
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 47 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/bun-clickhouse.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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'
16 changes: 3 additions & 13 deletions .github/workflows/node-clickhouse-cluster.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run postinstall
- run: git submodule init
Expand All @@ -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/[email protected]
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"
18 changes: 3 additions & 15 deletions .github/workflows/node-clickhouse.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -36,29 +36,17 @@ jobs:
- 9000:9000
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
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/[email protected]
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"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions pyroscope/pyroscope.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion test/e2e
Submodule e2e updated from b09c5c to 376a7d

0 comments on commit 8c73c48

Please sign in to comment.