Skip to content

Commit d760d2d

Browse files
authored
chore: Run integration tests on different ports (#1801)
# Summary This PR updates the CI (integration tests) docker compose and env file so that the integration tests run on a separate set of ports, so that they can be run locally without interfering with an instance of the app running locally. ## Testing To test locally Start the app ``` yarn dev ``` Run the integration tests ``` make ci-int ``` Note that both can run at the same time without docker port conflicts. `make ci-int` can also be run without running the app - it uses its own independent mongo + clickhouse + api.
1 parent 247896e commit d760d2d

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

‎.changeset/hot-buckets-dress.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@hyperdx/api": patch
3+
"@hyperdx/common-utils": patch
4+
---
5+
6+
chore: Run integration tests on different ports

‎docker-compose.ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ services:
3232
- ./docker/clickhouse/local/users.xml:/etc/clickhouse-server/users.xml
3333
restart: on-failure
3434
ports:
35-
- 8123:8123 # http api
35+
- 18123:8123 # http api
3636
# - 9000:9000 # native
3737
networks:
3838
- internal
3939
db:
4040
image: mongo:5.0.32-focal
4141
command: --port 29999
4242
ports:
43-
- 29999:29999
43+
- 39999:29999
4444
networks:
4545
- internal
4646
networks:

‎packages/api/.env.test‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
CLICKHOUSE_HOST=http://localhost:8123
1+
# Environment configuration for Integration tests, corresponding to ports defined in docker-compose.ci.yml
2+
CLICKHOUSE_HOST=http://localhost:18123
23
CLICKHOUSE_PASSWORD=api
34
CLICKHOUSE_USER=api
45
RUN_SCHEDULED_TASKS_EXTERNALLY=true
56
EXPRESS_SESSION_SECRET="hyperdx is cool 👋"
67
FRONTEND_URL=http://app:8080
7-
MONGO_URI=mongodb://localhost:29999/hyperdx-test
8+
MONGO_URI=mongodb://localhost:39999/hyperdx-test
89
NODE_ENV=test
9-
PORT=9000
10-
OPAMP_PORT=4320
10+
PORT=19000 # (API port)
11+
OPAMP_PORT=14320
1112
# Default to only logging warnings/errors. Adjust if you need more verbosity
1213
HYPERDX_LOG_LEVEL=warn

‎packages/common-utils/.env.test‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
CLICKHOUSE_HOST=http://localhost:8123
1+
# Environment configuration for Integration tests, corresponding to ports defined in docker-compose.ci.yml
2+
CLICKHOUSE_HOST=http://localhost:18123
23
CLICKHOUSE_PASSWORD=
34
CLICKHOUSE_USER=default
45
NODE_ENV=test

0 commit comments

Comments
 (0)