Skip to content

Commit dafcf86

Browse files
committed
chore: update sceript to a batch of instrumentations
1 parent 240359f commit dafcf86

File tree

16 files changed

+67
-63
lines changed

16 files changed

+67
-63
lines changed

packages/instrumentation-knex/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010
"directory": "packages/instrumentation-knex"
1111
},
1212
"scripts": {
13-
"test": "nyc mocha 'test/**/*.ts'",
14-
"tdd": "yarn test -- --watch-extensions ts --watch",
1513
"clean": "rimraf build/*",
14+
"compile": "tsc -p .",
15+
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-knex",
1616
"lint": "eslint . --ext .ts",
1717
"lint:fix": "eslint . --ext .ts --fix",
18-
"version:update": "node ../../scripts/version-update.js",
1918
"lint:readme": "node ../../scripts/lint-readme",
20-
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-knex",
21-
"compile": "tsc -p .",
2219
"prepublishOnly": "npm run compile",
20+
"tdd": "npm run test -- --watch-extensions ts --watch",
21+
"test": "nyc mocha 'test/**/*.ts'",
22+
"//todo": "echo \"add test-all-versions\"",
23+
"version:update": "node ../../scripts/version-update.js",
2324
"watch": "tsc -w"
2425
},
2526
"keywords": [

packages/instrumentation-koa/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
"directory": "packages/instrumentation-koa"
1111
},
1212
"scripts": {
13-
"test": "nyc mocha 'test/**/*.ts'",
14-
"test-all-versions": "tav",
15-
"tdd": "yarn test -- --watch-extensions ts --watch",
1613
"clean": "rimraf build/*",
14+
"compile": "tsc -p .",
15+
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-koa",
1716
"lint": "eslint . --ext .ts",
1817
"lint:fix": "eslint . --ext .ts --fix",
1918
"lint:readme": "node ../../scripts/lint-readme.js",
20-
"version:update": "node ../../scripts/version-update.js",
21-
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-koa",
22-
"compile": "tsc -p .",
2319
"prepublishOnly": "npm run compile",
20+
"tdd": "npm run test -- --watch-extensions ts --watch",
21+
"test": "nyc mocha 'test/**/*.ts'",
22+
"test-all-versions": "tav",
23+
"version:update": "node ../../scripts/version-update.js",
2424
"watch": "tsc -w"
2525
},
2626
"keywords": [

packages/instrumentation-long-task/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"directory": "packages/instrumentation-long-task"
1313
},
1414
"scripts": {
15+
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
16+
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
17+
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task",
1518
"lint": "eslint . --ext .ts",
1619
"lint:fix": "eslint . --ext .ts --fix",
1720
"lint:readme": "node ../../scripts/lint-readme.js",
18-
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
19-
"version:update": "node ../../scripts/version-update.js",
20-
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task",
21-
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
2221
"prepublishOnly": "npm run compile",
2322
"tdd": "karma start",
2423
"test:browser": "nyc karma start --single-run",
24+
"version:update": "node ../../scripts/version-update.js",
2525
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json"
2626
},
2727
"keywords": [

packages/instrumentation-lru-memoizer/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
"directory": "packages/instrumentation-lru-memoizer"
1111
},
1212
"scripts": {
13-
"test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
14-
"test-all-versions": "tav",
15-
"tdd": "npm run test -- --watch-extensions ts --watch",
1613
"clean": "rimraf build/*",
14+
"compile": "tsc -p .",
15+
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer",
1716
"lint": "eslint . --ext .ts",
1817
"lint:fix": "eslint . --ext .ts --fix",
1918
"lint:readme": "node ../../scripts/lint-readme.js",
2019
"prepublishOnly": "npm run compile",
21-
"version:update": "node ../../scripts/version-update.js",
22-
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer",
23-
"compile": "tsc -p ."
20+
"tdd": "npm run test -- --watch-extensions ts --watch",
21+
"test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
22+
"test-all-versions": "tav",
23+
"version:update": "node ../../scripts/version-update.js"
2424
},
2525
"keywords": [
2626
"lru-memoizer",

packages/instrumentation-memcached/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@
1111
},
1212
"scripts": {
1313
"clean": "rimraf build/*",
14-
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached",
1514
"compile": "tsc -p .",
15+
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached",
1616
"lint": "eslint . --ext .ts",
1717
"lint:fix": "eslint . --ext .ts --fix",
1818
"prepublishOnly": "npm run compile",
1919
"tdd": "npm run test -- --watch-extensions ts --watch",
2020
"test": "nyc mocha 'test/**/*.test.ts'",
21-
"test:debug": "cross-env RUN_MEMCACHED_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'",
22-
"test:local": "cross-env RUN_MEMCACHED_TESTS_LOCAL=true npm run test",
21+
"test:debug": "cross-env RUN_MEMCACHED_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'",
22+
"test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test",
23+
"//todo": "echo \"add test-all-versions\"",
24+
"test-services:start": "cd ../.. && npm run test-services:start memcached",
25+
"test-services:stop": "cd ../.. && npm run test-services:stop memcached",
2326
"version:update": "node ../../scripts/version-update.js"
2427
},
2528
"keywords": [

packages/instrumentation-memcached/test/index.test.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ const getClient = (...args: any[]): ExtendedMemcached => {
7171
};
7272
const KEY = 'foo';
7373
const VALUE = '_test_value_';
74-
const shouldTestLocal = process.env.RUN_MEMCACHED_TESTS_LOCAL;
75-
const shouldTest = process.env.RUN_MEMCACHED_TESTS || shouldTestLocal;
74+
const shouldTest = process.env.RUN_MEMCACHED_TESTS;
7675

7776
describe('[email protected]', () => {
7877
const provider = new NodeTracerProvider({
@@ -103,16 +102,6 @@ describe('[email protected]', () => {
103102
this.test!.parent!.pending = true;
104103
this.skip();
105104
}
106-
107-
if (shouldTestLocal) {
108-
testUtils.startDocker('memcached');
109-
}
110-
});
111-
112-
after(() => {
113-
if (shouldTestLocal) {
114-
testUtils.cleanUpDocker('memcached');
115-
}
116105
});
117106

118107
describe('default config', () => {

packages/instrumentation-mongodb/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
"directory": "packages/instrumentation-mongodb"
1111
},
1212
"scripts": {
13-
"docker:start": "docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=127.0.0.1 -p 27017:27017 --rm mongo",
14-
"test": "npm run test-v4 && npm run test-v5-v6",
15-
"test-v3": "tav mongodb 3.7.4 npm run test-v3-run",
16-
"test-v4": "tav mongodb 4.17.0 npm run test-v4-run",
17-
"test-v5-v6": "npm run test-v5-v6-run",
18-
"test-v3-run": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'",
19-
"test-v4-run": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v4.test.ts'",
20-
"test-v5-v6-run": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v5-v6.test.ts'",
21-
"test-all-versions": "tav",
22-
"tdd": "npm run test-v5-v6-run -- --watch-extensions ts --watch",
2313
"clean": "rimraf build/*",
2414
"lint": "eslint . --ext .ts",
2515
"lint:fix": "eslint . --ext .ts --fix",
@@ -28,6 +18,16 @@
2818
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongodb",
2919
"compile": "tsc -p .",
3020
"prepublishOnly": "npm run compile",
21+
"tdd": "npm run test-v5-v6-run -- --watch-extensions ts --watch",
22+
"test": "npm run test-v5-v6",
23+
"test-v3": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'",
24+
"test-v4": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v4.test.ts'",
25+
"test-v5-v6": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v5-v6.test.ts'",
26+
"test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test",
27+
"test-all-versions": "tav",
28+
"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",
29+
"test-services:start": "cd ../.. && npm run test-services:start mongodb",
30+
"test-services:stop": "cd ../.. && npm run test-services:stop mongodb",
3131
"watch": "tsc -w"
3232
},
3333
"keywords": [

packages/instrumentation-mongoose/package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@
1010
"directory": "packages/instrumentation-mongoose"
1111
},
1212
"scripts": {
13-
"docker:start": "docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=127.0.0.1 -p 27017:27017 --rm mongo",
14-
"test": "npm run test-v5-v6",
15-
"test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'",
16-
"test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'",
17-
"test-all-versions": "tav",
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-mongoose",
2016
"lint": "eslint . --ext .ts",
2117
"lint:fix": "eslint . --ext .ts --fix",
2218
"lint:readme": "node ../../scripts/lint-readme.js",
2319
"prepublishOnly": "npm run compile",
24-
"version:update": "node ../../scripts/version-update.js",
25-
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongoose",
26-
"compile": "tsc -p ."
20+
"tdd": "npm run test -- --watch-extensions ts --watch",
21+
"test": "npm run test-v5-v6",
22+
"test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'",
23+
"test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'",
24+
"test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test",
25+
"test-all-versions": "tav",
26+
"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",
27+
"test-services:start": "cd ../.. && npm run test-services:start mongodb",
28+
"test-services:stop": "cd ../.. && npm run test-services:stop mongodb",
29+
"version:update": "node ../../scripts/version-update.js"
2730
},
2831
"keywords": [
2932
"mongodb",

packages/instrumentation-mongoose/test/mongoose-common.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import User, { IUser, loadUsers } from './user';
3838
import { assertSpan, getStatement } from './asserts';
3939
import { DB_NAME, MONGO_URI } from './config';
4040

41-
// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo
41+
// Please run `npm run test-services:start` before
4242
describe('mongoose instrumentation [common]', () => {
4343
before(async () => {
4444
try {

packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { DB_NAME, MONGO_URI } from './config';
3535
// We can't use @ts-expect-error because it will fail depending on the used mongoose version on tests
3636
/* eslint-disable @typescript-eslint/ban-ts-comment */
3737

38-
// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo
38+
// Please run `npm run test-services:start` before
3939
describe('mongoose instrumentation [v5/v6]', () => {
4040
before(async () => {
4141
try {

0 commit comments

Comments
 (0)