Skip to content

Commit 240359f

Browse files
committed
chore: add scripts to iosredis instrumentation
1 parent b71a1af commit 240359f

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

packages/instrumentation-ioredis/package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@
1010
"directory": "packages/instrumentation-ioredis"
1111
},
1212
"scripts": {
13-
"test": "nyc mocha 'test/**/*.test.ts'",
14-
"test:debug": "cross-env RUN_REDIS_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'",
15-
"test:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test",
16-
"test-all-versions": "tav",
17-
"test-all-versions:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test-all-versions",
18-
"tdd": "npm run test -- --watch-extensions ts --watch",
1913
"clean": "rimraf build/*",
14+
"compile": "tsc -p .",
15+
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis",
2016
"lint": "eslint . --ext .ts",
2117
"lint:fix": "eslint . --ext .ts --fix",
2218
"lint:readme": "node ../../scripts/lint-readme.js",
23-
"version:update": "node ../../scripts/version-update.js",
24-
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis",
25-
"compile": "tsc -p .",
26-
"prepublishOnly": "npm run compile"
19+
"prepublishOnly": "npm run compile",
20+
"tdd": "npm run test -- --watch-extensions ts --watch",
21+
"test": "nyc mocha 'test/**/*.test.ts'",
22+
"test:debug": "cross-env RUN_REDIS_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'",
23+
"test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test",
24+
"test-all-versions": "tav",
25+
"test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions",
26+
"test-services:start": "cd ../.. && npm run test-services:start redis",
27+
"test-services:stop": "cd ../.. && npm run test-services:stop redis",
28+
"version:update": "node ../../scripts/version-update.js"
2729
},
2830
"keywords": [
2931
"instrumentation",

packages/instrumentation-ioredis/test/ioredis.test.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ describe('ioredis', () => {
9191
});
9292
let ioredis: typeof ioredisTypes.default;
9393
let instrumentation: IORedisInstrumentation;
94-
const shouldTestLocal = process.env.RUN_REDIS_TESTS_LOCAL;
95-
const shouldTest = process.env.RUN_REDIS_TESTS || shouldTestLocal;
94+
const shouldTest = process.env.RUN_REDIS_TESTS;
9695

9796
let contextManager: AsyncLocalStorageContextManager;
9897
beforeEach(() => {
@@ -113,21 +112,11 @@ describe('ioredis', () => {
113112
this.skip();
114113
}
115114

116-
if (shouldTestLocal) {
117-
testUtils.startDocker('redis');
118-
}
119-
120115
instrumentation = new IORedisInstrumentation();
121116
instrumentation.setTracerProvider(provider);
122117
ioredis = require('ioredis');
123118
});
124119

125-
after(() => {
126-
if (shouldTestLocal) {
127-
testUtils.cleanUpDocker('redis');
128-
}
129-
});
130-
131120
it('should have correct module name', () => {
132121
assert.strictEqual(
133122
instrumentation.instrumentationName,

0 commit comments

Comments
 (0)