Skip to content

Commit

Permalink
feat(global-test): enable influxdb configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
mkermani144 committed Oct 30, 2024
1 parent b7b3d7c commit a8a4214
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion tests/global/src/node/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ MAX_MESSAGE_SIZE=
MIN_SCNEARIO_DURATION=
MAX_SCNEARIO_DURATION=
SERVICE_PORT=
INFLUXDB_PORT=
LOGS_DIRECTORY=
INFLUXDB_HOST=
INFLUXDB_PORT=
INFLUXDB_USERNAME=
INFLUXDB_PASSWORD=
INFLUXDB_ADMIN_TOKEN=
6 changes: 3 additions & 3 deletions tests/global/src/node/.env.influxdb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DOCKER_INFLUXDB_INIT_MODE=setup
DOCKER_INFLUXDB_INIT_USERNAME=admin
DOCKER_INFLUXDB_INIT_PASSWORD=admin1234
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=admintoken
DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_USERNAME:-admin}
DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD:-admin1234}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN:-admintoken}
DOCKER_INFLUXDB_INIT_ORG=Rosen
DOCKER_INFLUXDB_INIT_BUCKET=RoseNet
1 change: 1 addition & 0 deletions tests/global/src/node/.env.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ MAX_MESSAGE_SIZE=${MAX_MESSAGE_SIZE:-}
MIN_SCNEARIO_DURATION=${MIN_SCNEARIO_DURATION:-}
MAX_SCNEARIO_DURATION=${MAX_SCNEARIO_DURATION:-}
RELAY_MULTIADDRS=${RELAY_MULTIADDRS:?}
INFLUXDB_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN:-admintoken}
1 change: 1 addition & 0 deletions tests/global/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export default {
minScenarioDuration: optional(process.env.MIN_SCNEARIO_DURATION, 60_000),
maxScenarioDuration: optional(process.env.MAX_SCNEARIO_DURATION, 300_000),
relayMultiaddrs: process.env.RELAY_MULTIADDRS!.split(','),
influxdbToken: process.env.INFLUXDB_ADMIN_TOKEN!,
};
2 changes: 1 addition & 1 deletion tests/global/src/node/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
env_file:
- .env.influxdb
ports:
- ${INFLUXDB_PORT:-8086}:8086
- ${INFLUXDB_HOST:-127.0.0.1}:${INFLUXDB_PORT:-8086}:8086
networks:
- internal
volumes:
Expand Down
4 changes: 3 additions & 1 deletion tests/global/src/node/metric-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { InfluxDB, Point } from '@influxdata/influxdb-client';

import { serviceLogger } from './logger';

import config from './config';

const influxDB = new InfluxDB({
url: 'http://influxdb:8086',
token: 'admintoken',
token: config.influxdbToken,
});
const writeApi = influxDB.getWriteApi('Rosen', 'RoseNet');

Expand Down

0 comments on commit a8a4214

Please sign in to comment.