Skip to content

Commit 2e6aed8

Browse files
committed
test: move test-services envvars out to test/test-services.env
This uses the lightweight 'dotenv' tool's preload support to add the test-services envvars for 'node' processes, which suffices for 'npm test' Refs: #96 (comment)
1 parent e3b458f commit 2e6aed8

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opentelemetry-node/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"lint:types": "tsc --skipLibCheck",
3030
"lint:fix": "eslint --ext=js,mjs,cjs --fix . # requires node >=16.0.0",
3131
"lint:deps": "dependency-check start.js 'lib/**/*.js' 'test/**/*.js' -i @types/tape",
32-
"test": "REDIS_HOST=localhost tape test/**/*.test.js",
32+
"test": "NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=./test/test-services.env tape test/**/*.test.js",
3333
"test:without-test-services": "tape test/**/*.test.js",
3434
"test-services:start": "docker compose -f ./test/docker-compose.yaml up -d",
3535
"test-services:stop": "docker compose -f ./test/docker-compose.yaml down"
@@ -55,6 +55,7 @@
5555
"@opentelemetry/api": "^1.3.0",
5656
"@types/tape": "^5.6.4",
5757
"bunyan": "^1.8.15",
58+
"dotenv": "^16.4.5",
5859
"express": "^4.19.2",
5960
"fastify": "^4.26.2",
6061
"ioredis": "^5.3.2",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REDIS_HOST=localhost

0 commit comments

Comments
 (0)