Skip to content

Commit 25d1028

Browse files
xiao-lixdyladan
authored andcommitted
chore: fix pg-pool test env (open-telemetry#706)
1 parent 82828b7 commit 25d1028

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@types/pg-pool": "^2.0.1",
5555
"@types/shimmer": "^1.0.1",
5656
"codecov": "^3.6.1",
57+
"cross-env": "^6.0.0",
5758
"gts": "^1.1.0",
5859
"mocha": "^6.2.0",
5960
"nyc": "^14.1.1",

packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/test/pg-pool.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ describe('pg-pool@2.x', () => {
9494
let pool: pgPool<pg.Client>;
9595
const registry = new NodeTracerRegistry();
9696
const logger = new NoopLogger();
97-
const testPostgres = process.env.TEST_POSTGRES; // For CI: assumes local postgres db is already available
98-
const testPostgresLocally = process.env.TEST_POSTGRES_LOCAL; // For local: spins up local postgres db via docker
97+
const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available
98+
const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker
9999
const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default)
100100

101101
before(function(done) {
@@ -192,10 +192,10 @@ describe('pg-pool@2.x', () => {
192192
if (!client) {
193193
throw new Error('No client received');
194194
}
195-
release();
196195
assert.ok(client);
197196
runCallbackTest(parentSpan, pgPoolattributes, events, okStatus, 1, 0);
198197
client.query('SELECT NOW()', (err, ret) => {
198+
release();
199199
if (err) {
200200
return done(err);
201201
}

0 commit comments

Comments
 (0)