From 9f52a4e7a3c52279bc5d9e8acb273a76835c0b88 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 10:09:26 +0200 Subject: [PATCH 01/15] chore: rename setup script --- CONTRIBUTING.md | 22 +++++++++---------- .../package.json | 2 +- .../package.json | 2 +- .../auto-instrumentations-node/package.json | 2 +- .../auto-instrumentations-web/package.json | 2 +- .../baggage-log-record-processor/package.json | 2 +- packages/baggage-span-processor/package.json | 2 +- packages/contrib-test-utils/package.json | 2 +- packages/host-metrics/package.json | 2 +- packages/id-generator-aws-xray/package.json | 2 +- packages/instrumentation-amqplib/package.json | 2 +- .../instrumentation-aws-lambda/package.json | 2 +- packages/instrumentation-aws-sdk/package.json | 2 +- packages/instrumentation-bunyan/package.json | 2 +- .../package.json | 2 +- packages/instrumentation-connect/package.json | 2 +- .../instrumentation-cucumber/package.json | 2 +- .../instrumentation-dataloader/package.json | 2 +- packages/instrumentation-dns/package.json | 2 +- .../package.json | 2 +- packages/instrumentation-express/package.json | 2 +- packages/instrumentation-fastify/package.json | 2 +- packages/instrumentation-fs/package.json | 2 +- .../instrumentation-generic-pool/package.json | 2 +- packages/instrumentation-graphql/package.json | 2 +- packages/instrumentation-hapi/package.json | 2 +- packages/instrumentation-ioredis/package.json | 2 +- packages/instrumentation-kafkajs/package.json | 2 +- packages/instrumentation-knex/package.json | 2 +- packages/instrumentation-koa/package.json | 2 +- .../instrumentation-long-task/package.json | 2 +- .../instrumentation-lru-memoizer/package.json | 2 +- .../instrumentation-memcached/package.json | 2 +- packages/instrumentation-mongodb/package.json | 2 +- .../instrumentation-mongoose/package.json | 2 +- packages/instrumentation-mysql/package.json | 2 +- packages/instrumentation-mysql2/package.json | 2 +- .../instrumentation-nestjs-core/package.json | 2 +- packages/instrumentation-net/package.json | 2 +- .../instrumentation-oracledb/package.json | 2 +- packages/instrumentation-pg/package.json | 2 +- packages/instrumentation-pino/package.json | 2 +- packages/instrumentation-redis/package.json | 2 +- packages/instrumentation-restify/package.json | 2 +- packages/instrumentation-router/package.json | 2 +- .../instrumentation-runtime-node/package.json | 2 +- .../instrumentation-socket.io/package.json | 2 +- packages/instrumentation-tedious/package.json | 2 +- packages/instrumentation-typeorm/package.json | 2 +- packages/instrumentation-undici/package.json | 2 +- .../package.json | 2 +- packages/instrumentation-winston/package.json | 2 +- packages/plugin-react-load/package.json | 2 +- packages/propagation-utils/package.json | 2 +- .../propagator-aws-xray-lambda/package.json | 2 +- packages/propagator-aws-xray/package.json | 2 +- packages/propagator-instana/package.json | 2 +- packages/propagator-ot-trace/package.json | 2 +- packages/redis-common/package.json | 2 +- .../package.json | 2 +- packages/resource-detector-aws/package.json | 2 +- packages/resource-detector-azure/package.json | 2 +- .../resource-detector-container/package.json | 2 +- packages/resource-detector-gcp/package.json | 2 +- .../resource-detector-github/package.json | 2 +- .../resource-detector-instana/package.json | 2 +- packages/sql-common/package.json | 2 +- packages/winston-transport/package.json | 2 +- 68 files changed, 77 insertions(+), 79 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34e7a82b9f..4281855a74 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,7 +117,7 @@ The required steps to start development on a pacakge are: - `npm ci` from root folder to install dependencies ([see npm-ci docs](https://docs.npmjs.com/cli/v10/commands/npm-ci)) - `cd` into the pacakge you want to apply changes. -- `npm run setup:dev` compiles the TypeScript files for this package and its dependencies within the repository. +- `npm run compile:with-dependencies` compiles the TypeScript files for this package and its dependencies within the repository. Then you can proceed to do apply the changes and use the scripts below for development workflow @@ -146,23 +146,21 @@ npm test However, some instrumentations require test-services to be running (e.g. the `instrumentation-mongodb` package requires a MongoDB server). Use the `test-services`-related npm scripts to start all required services in Docker and then run the tests with the appropriate configuration to use those services: ```sh -npm run test-services:start # starts services in Docker -npm run test:with-services-config # runs 'npm test' with envvars from test/test-services.env -npm run test-services:stop # stops services in Docker +npm run test-services:start # starts services in Docker +npm run test:with-services-env # runs 'npm test' with envvars from test/test-services.env +npm run test-services:stop # stops services in Docker ``` -If you only want to test a single package (e.g. the `instrumentation-mongodb`) you can `cd` into it and run the tests after you started the services. +If you only want to test a single package that dfepends on a service (e.g. the `instrumentation-mongodb`) you can `cd` into it and +use the same scripts for testing. In this case the script will only start the services needed to test the package. ```sh -npm run test-services:start # starts services in Docker -cd packages/instrumentation-mongodb # get into the instrumenation folder -RUN_MONGODB_TESTS=1 npm test # run the test with the proper config (check each package) -cd ../../.. # go back to root folder -npm run test-services:stop # stops services in Docker +cd packages/instrumentation-mongodb # get into the instrumenation folder +npm run test-services:start # start the MongoDB service in Docker +npm run test:with-services-env # runs 'npm test' with envvars from test/test-services.env +npm run test-services:stop # stop MongoDB service in Docker ``` -NOTE: scripts for each package will be added to avoid extra consumption of resources and improve the development experience. - ### Benchmarks When two or more approaches must be compared, please write a benchmark in the benchmark/index.js module so that we can keep track of the most efficient algorithm. diff --git a/incubator/opentelemetry-sampler-aws-xray/package.json b/incubator/opentelemetry-sampler-aws-xray/package.json index fb1d5a0f18..da7c3aaca6 100644 --- a/incubator/opentelemetry-sampler-aws-xray/package.json +++ b/incubator/opentelemetry-sampler-aws-xray/package.json @@ -28,7 +28,7 @@ ], "repository": "open-telemetry/opentelemetry-js-contrib", "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/sampler-aws-xray", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sampler-aws-xray", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/auto-configuration-propagators/package.json b/packages/auto-configuration-propagators/package.json index 29da658e78..c4c27091e1 100644 --- a/packages/auto-configuration-propagators/package.json +++ b/packages/auto-configuration-propagators/package.json @@ -20,7 +20,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/auto-configuration-propagators", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-configuration-propagators", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/auto-instrumentations-node/package.json b/packages/auto-instrumentations-node/package.json index 838e21c1e8..c6df118ad9 100644 --- a/packages/auto-instrumentations-node/package.json +++ b/packages/auto-instrumentations-node/package.json @@ -24,7 +24,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-node", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-node", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/auto-instrumentations-web/package.json b/packages/auto-instrumentations-web/package.json index 45974b3193..8558be2b34 100644 --- a/packages/auto-instrumentations-web/package.json +++ b/packages/auto-instrumentations-web/package.json @@ -22,7 +22,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-web", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-web", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/baggage-log-record-processor/package.json b/packages/baggage-log-record-processor/package.json index 9fa37aac11..484748b04e 100644 --- a/packages/baggage-log-record-processor/package.json +++ b/packages/baggage-log-record-processor/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/baggage-log-record-processor", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-log-record-processor", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/baggage-span-processor/package.json b/packages/baggage-span-processor/package.json index eb29241698..9824b02d17 100644 --- a/packages/baggage-span-processor/package.json +++ b/packages/baggage-span-processor/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/baggage-span-processor", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-span-processor", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/contrib-test-utils/package.json b/packages/contrib-test-utils/package.json index 94098516a6..7b46fa0e4a 100644 --- a/packages/contrib-test-utils/package.json +++ b/packages/contrib-test-utils/package.json @@ -10,7 +10,7 @@ "scripts": { "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "setup:dev": "nx run-many -t compile -p @opentelemetry/contrib-test-utils", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/contrib-test-utils", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/host-metrics/package.json b/packages/host-metrics/package.json index 1d93e5723b..8d7957fb9b 100644 --- a/packages/host-metrics/package.json +++ b/packages/host-metrics/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/host-metrics", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/host-metrics", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/id-generator-aws-xray/package.json b/packages/id-generator-aws-xray/package.json index 0b8aac94ab..f99859cba7 100644 --- a/packages/id-generator-aws-xray/package.json +++ b/packages/id-generator-aws-xray/package.json @@ -19,7 +19,7 @@ "directory": "packages/id-generator-aws-xray" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/id-generator-aws-xray", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/id-generator-aws-xray", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "test": "nyc mocha test/**/*.test.ts", diff --git a/packages/instrumentation-amqplib/package.json b/packages/instrumentation-amqplib/package.json index dc49fed88d..f210d7b92f 100644 --- a/packages/instrumentation-amqplib/package.json +++ b/packages/instrumentation-amqplib/package.json @@ -31,7 +31,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-amqplib", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-amqplib", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-aws-lambda/package.json b/packages/instrumentation-aws-lambda/package.json index d1ddc0e616..9110d0fa93 100644 --- a/packages/instrumentation-aws-lambda/package.json +++ b/packages/instrumentation-aws-lambda/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-lambda", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-lambda", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-aws-sdk/package.json b/packages/instrumentation-aws-sdk/package.json index b80752393e..4b9fc209fd 100644 --- a/packages/instrumentation-aws-sdk/package.json +++ b/packages/instrumentation-aws-sdk/package.json @@ -32,7 +32,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-sdk", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-sdk", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-bunyan/package.json b/packages/instrumentation-bunyan/package.json index b3c4a65df0..97f96735b1 100644 --- a/packages/instrumentation-bunyan/package.json +++ b/packages/instrumentation-bunyan/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-bunyan", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-bunyan", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-cassandra-driver/package.json b/packages/instrumentation-cassandra-driver/package.json index fac392bba5..86146f2f37 100644 --- a/packages/instrumentation-cassandra-driver/package.json +++ b/packages/instrumentation-cassandra-driver/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-cassandra-driver", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-cassandra-driver", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-connect/package.json b/packages/instrumentation-connect/package.json index 96fea3f22d..48c5d3d1e1 100644 --- a/packages/instrumentation-connect/package.json +++ b/packages/instrumentation-connect/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-connect", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-connect", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-cucumber/package.json b/packages/instrumentation-cucumber/package.json index e89a7062c5..a899b67d7d 100644 --- a/packages/instrumentation-cucumber/package.json +++ b/packages/instrumentation-cucumber/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-cucumber", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-cucumber", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-dataloader/package.json b/packages/instrumentation-dataloader/package.json index 87b16c8734..a0063ce5b6 100644 --- a/packages/instrumentation-dataloader/package.json +++ b/packages/instrumentation-dataloader/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-dataloader", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-dataloader", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-dns/package.json b/packages/instrumentation-dns/package.json index cf88e2be3e..18f20e3649 100644 --- a/packages/instrumentation-dns/package.json +++ b/packages/instrumentation-dns/package.json @@ -18,7 +18,7 @@ "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", "lint:readme": "node ../../scripts/lint-readme", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-dns", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-dns", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-document-load/package.json b/packages/instrumentation-document-load/package.json index e7b6840303..c83f4504e2 100644 --- a/packages/instrumentation-document-load/package.json +++ b/packages/instrumentation-document-load/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-document-load", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-document-load", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "wtr --watch", diff --git a/packages/instrumentation-express/package.json b/packages/instrumentation-express/package.json index cca88babed..7f7bf687cc 100644 --- a/packages/instrumentation-express/package.json +++ b/packages/instrumentation-express/package.json @@ -18,7 +18,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-express", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-express", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-fastify/package.json b/packages/instrumentation-fastify/package.json index a7ec0de298..046aa5403d 100644 --- a/packages/instrumentation-fastify/package.json +++ b/packages/instrumentation-fastify/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-fastify", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-fastify", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-fs/package.json b/packages/instrumentation-fs/package.json index 193c850cdd..d820b4b3a1 100644 --- a/packages/instrumentation-fs/package.json +++ b/packages/instrumentation-fs/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-fs", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-fs", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-generic-pool/package.json b/packages/instrumentation-generic-pool/package.json index fea8843c52..1b7ce7b656 100644 --- a/packages/instrumentation-generic-pool/package.json +++ b/packages/instrumentation-generic-pool/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-generic-pool", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-generic-pool", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-graphql/package.json b/packages/instrumentation-graphql/package.json index efd4571255..3054201c2e 100644 --- a/packages/instrumentation-graphql/package.json +++ b/packages/instrumentation-graphql/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-graphql", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-graphql", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-hapi/package.json b/packages/instrumentation-hapi/package.json index 2fd0bfd825..b48c73ecc8 100644 --- a/packages/instrumentation-hapi/package.json +++ b/packages/instrumentation-hapi/package.json @@ -18,7 +18,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-hapi", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-hapi", "compile": "tsc -p .", "prepublishOnly": "npm run compile" }, diff --git a/packages/instrumentation-ioredis/package.json b/packages/instrumentation-ioredis/package.json index 13365aeb1d..b6ac79cb89 100644 --- a/packages/instrumentation-ioredis/package.json +++ b/packages/instrumentation-ioredis/package.json @@ -21,7 +21,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis", "compile": "tsc -p .", "prepublishOnly": "npm run compile" }, diff --git a/packages/instrumentation-kafkajs/package.json b/packages/instrumentation-kafkajs/package.json index 6045eb9d5e..267e486c35 100644 --- a/packages/instrumentation-kafkajs/package.json +++ b/packages/instrumentation-kafkajs/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-kafkajs", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-kafkajs", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-knex/package.json b/packages/instrumentation-knex/package.json index e5fd15321a..fd67b40170 100644 --- a/packages/instrumentation-knex/package.json +++ b/packages/instrumentation-knex/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "version:update": "node ../../scripts/version-update.js", "lint:readme": "node ../../scripts/lint-readme", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-knex", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-knex", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-koa/package.json b/packages/instrumentation-koa/package.json index 989d34f3fa..2ceba96abd 100644 --- a/packages/instrumentation-koa/package.json +++ b/packages/instrumentation-koa/package.json @@ -18,7 +18,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-koa", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-koa", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-long-task/package.json b/packages/instrumentation-long-task/package.json index 2cb4d2d1cf..844b4bcca1 100644 --- a/packages/instrumentation-long-task/package.json +++ b/packages/instrumentation-long-task/package.json @@ -17,7 +17,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", diff --git a/packages/instrumentation-lru-memoizer/package.json b/packages/instrumentation-lru-memoizer/package.json index 52e7daf112..501514de3f 100644 --- a/packages/instrumentation-lru-memoizer/package.json +++ b/packages/instrumentation-lru-memoizer/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-memcached/package.json b/packages/instrumentation-memcached/package.json index dc72d27d4a..08779db07c 100644 --- a/packages/instrumentation-memcached/package.json +++ b/packages/instrumentation-memcached/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-mongodb/package.json b/packages/instrumentation-mongodb/package.json index ec3ad51398..349a3c8e13 100644 --- a/packages/instrumentation-mongodb/package.json +++ b/packages/instrumentation-mongodb/package.json @@ -25,7 +25,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mongodb", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongodb", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-mongoose/package.json b/packages/instrumentation-mongoose/package.json index 609d35d9dc..fce1cd3973 100644 --- a/packages/instrumentation-mongoose/package.json +++ b/packages/instrumentation-mongoose/package.json @@ -22,7 +22,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mongoose", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongoose", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-mysql/package.json b/packages/instrumentation-mysql/package.json index bb641a239e..1a5b43173b 100644 --- a/packages/instrumentation-mysql/package.json +++ b/packages/instrumentation-mysql/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql", "compile": "tsc -p .", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-mysql2/package.json b/packages/instrumentation-mysql2/package.json index ab3ba8d541..285c883b73 100644 --- a/packages/instrumentation-mysql2/package.json +++ b/packages/instrumentation-mysql2/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql2", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql2", "compile": "tsc -p .", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-nestjs-core/package.json b/packages/instrumentation-nestjs-core/package.json index de97cea3f9..cb98f1bdfc 100644 --- a/packages/instrumentation-nestjs-core/package.json +++ b/packages/instrumentation-nestjs-core/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-nestjs-core", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-nestjs-core", "compile": "tsc -p .", "compile:watch": "tsc -w", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-net/package.json b/packages/instrumentation-net/package.json index fae95d9d93..12aaac951c 100644 --- a/packages/instrumentation-net/package.json +++ b/packages/instrumentation-net/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-net", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-net", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-oracledb/package.json b/packages/instrumentation-oracledb/package.json index b273d3b163..866da46ed7 100644 --- a/packages/instrumentation-oracledb/package.json +++ b/packages/instrumentation-oracledb/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-oracledb", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-oracledb", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-pg/package.json b/packages/instrumentation-pg/package.json index 43d319a176..1069be9421 100644 --- a/packages/instrumentation-pg/package.json +++ b/packages/instrumentation-pg/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-pg", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-pg", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-pino/package.json b/packages/instrumentation-pino/package.json index e0eba8753a..97ca0a1bde 100644 --- a/packages/instrumentation-pino/package.json +++ b/packages/instrumentation-pino/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-pino", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-pino", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-redis/package.json b/packages/instrumentation-redis/package.json index 78757f9249..adf8ecf1fa 100644 --- a/packages/instrumentation-redis/package.json +++ b/packages/instrumentation-redis/package.json @@ -24,7 +24,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-redis", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-redis", "compile": "tsc -p .", "prepublishOnly": "npm run compile" }, diff --git a/packages/instrumentation-restify/package.json b/packages/instrumentation-restify/package.json index ad0cb20f2a..f34660ff48 100644 --- a/packages/instrumentation-restify/package.json +++ b/packages/instrumentation-restify/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-restify", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-restify", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-router/package.json b/packages/instrumentation-router/package.json index 9fb73a25db..fdd0ea52e7 100644 --- a/packages/instrumentation-router/package.json +++ b/packages/instrumentation-router/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-router", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-router", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-runtime-node/package.json b/packages/instrumentation-runtime-node/package.json index d1d367f8de..eeb0e6a803 100644 --- a/packages/instrumentation-runtime-node/package.json +++ b/packages/instrumentation-runtime-node/package.json @@ -12,7 +12,7 @@ "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-runtime-node#readme", "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-runtime-node", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-runtime-node", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-socket.io/package.json b/packages/instrumentation-socket.io/package.json index 0ce7a14540..05b0b5529d 100644 --- a/packages/instrumentation-socket.io/package.json +++ b/packages/instrumentation-socket.io/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-socket.io", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-socket.io", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-tedious/package.json b/packages/instrumentation-tedious/package.json index 67dc2cfaf6..4275614e49 100644 --- a/packages/instrumentation-tedious/package.json +++ b/packages/instrumentation-tedious/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-tedious", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-tedious", "compile": "tsc -p .", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-typeorm/package.json b/packages/instrumentation-typeorm/package.json index 5935399a02..993eab6a00 100644 --- a/packages/instrumentation-typeorm/package.json +++ b/packages/instrumentation-typeorm/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-typeorm", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-typeorm", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-undici/package.json b/packages/instrumentation-undici/package.json index 9e2775b968..7cf84e2d07 100644 --- a/packages/instrumentation-undici/package.json +++ b/packages/instrumentation-undici/package.json @@ -11,7 +11,7 @@ }, "scripts": { "prepublishOnly": "npm run compile", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-undici", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-undici", "compile": "tsc -p .", "test": "nyc mocha test/**/*.test.ts", "test-all-versions": "tav", diff --git a/packages/instrumentation-user-interaction/package.json b/packages/instrumentation-user-interaction/package.json index 759e89263e..8acb410df3 100644 --- a/packages/instrumentation-user-interaction/package.json +++ b/packages/instrumentation-user-interaction/package.json @@ -17,7 +17,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-user-interaction", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-user-interaction", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", diff --git a/packages/instrumentation-winston/package.json b/packages/instrumentation-winston/package.json index 0ca7304216..b1e8f5946a 100644 --- a/packages/instrumentation-winston/package.json +++ b/packages/instrumentation-winston/package.json @@ -22,7 +22,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-winston", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-winston", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/plugin-react-load/package.json b/packages/plugin-react-load/package.json index d2fff37328..26634f5f3c 100644 --- a/packages/plugin-react-load/package.json +++ b/packages/plugin-react-load/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/plugin-react-load", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/plugin-react-load", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", diff --git a/packages/propagation-utils/package.json b/packages/propagation-utils/package.json index 43251d6e12..fbf1b88bb9 100644 --- a/packages/propagation-utils/package.json +++ b/packages/propagation-utils/package.json @@ -9,7 +9,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagation-utils", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagation-utils", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/propagator-aws-xray-lambda/package.json b/packages/propagator-aws-xray-lambda/package.json index c9a5b7cc7d..72aed9a336 100644 --- a/packages/propagator-aws-xray-lambda/package.json +++ b/packages/propagator-aws-xray-lambda/package.json @@ -11,7 +11,7 @@ "directory": "packages/propagator-aws-xray-lambda" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray-lambda", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray-lambda", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "test": "nyc mocha test/**/*.test.ts", diff --git a/packages/propagator-aws-xray/package.json b/packages/propagator-aws-xray/package.json index 6fd169cd57..16c47a3519 100644 --- a/packages/propagator-aws-xray/package.json +++ b/packages/propagator-aws-xray/package.json @@ -12,7 +12,7 @@ }, "scripts": { "prepublishOnly": "npm run compile", - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "test": "nyc mocha test/**/*.test.ts", "test:browser": "nyc karma start --single-run", diff --git a/packages/propagator-instana/package.json b/packages/propagator-instana/package.json index b8fc731d4c..54af171aaf 100644 --- a/packages/propagator-instana/package.json +++ b/packages/propagator-instana/package.json @@ -11,7 +11,7 @@ "directory": "packages/propagator-instana" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-instana", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-instana", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "test": "nyc mocha test/**/*.test.ts", diff --git a/packages/propagator-ot-trace/package.json b/packages/propagator-ot-trace/package.json index 32feece7bc..d5091c3686 100644 --- a/packages/propagator-ot-trace/package.json +++ b/packages/propagator-ot-trace/package.json @@ -11,7 +11,7 @@ "directory": "packages/propagator-ot-trace" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-ot-trace", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-ot-trace", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "test": "nyc mocha test/**/*.test.ts", diff --git a/packages/redis-common/package.json b/packages/redis-common/package.json index f4a41cbcfa..fa94d28d68 100644 --- a/packages/redis-common/package.json +++ b/packages/redis-common/package.json @@ -10,7 +10,7 @@ "scripts": { "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "setup:dev": "nx run-many -t compile -p @opentelemetry/redis-common", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/redis-common", "compile": "tsc --build tsconfig.json", "prepublishOnly": "npm run compile", "test": "nyc mocha 'test/**/*.test.ts'", diff --git a/packages/resource-detector-alibaba-cloud/package.json b/packages/resource-detector-alibaba-cloud/package.json index 1ade566fcb..bf061e0953 100644 --- a/packages/resource-detector-alibaba-cloud/package.json +++ b/packages/resource-detector-alibaba-cloud/package.json @@ -12,7 +12,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-alibaba-cloud", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-alibaba-cloud", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/resource-detector-aws/package.json b/packages/resource-detector-aws/package.json index e1258cb975..18fc27558f 100644 --- a/packages/resource-detector-aws/package.json +++ b/packages/resource-detector-aws/package.json @@ -12,7 +12,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-aws", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-aws", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/resource-detector-azure/package.json b/packages/resource-detector-azure/package.json index ce7aefd2a4..f56df8cf09 100644 --- a/packages/resource-detector-azure/package.json +++ b/packages/resource-detector-azure/package.json @@ -12,7 +12,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-azure", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-azure", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/resource-detector-container/package.json b/packages/resource-detector-container/package.json index 7679764b04..7dbd0debb4 100644 --- a/packages/resource-detector-container/package.json +++ b/packages/resource-detector-container/package.json @@ -12,7 +12,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-container", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-container", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/resource-detector-gcp/package.json b/packages/resource-detector-gcp/package.json index 2477e64da8..0c974ba620 100644 --- a/packages/resource-detector-gcp/package.json +++ b/packages/resource-detector-gcp/package.json @@ -12,7 +12,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-gcp", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-gcp", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/resource-detector-github/package.json b/packages/resource-detector-github/package.json index 761e9ec10c..7195234c7b 100644 --- a/packages/resource-detector-github/package.json +++ b/packages/resource-detector-github/package.json @@ -12,7 +12,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-github", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-github", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/resource-detector-instana/package.json b/packages/resource-detector-instana/package.json index 14b98c9ad5..f90ef1a71d 100644 --- a/packages/resource-detector-instana/package.json +++ b/packages/resource-detector-instana/package.json @@ -12,7 +12,7 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-instana", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-instana", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/sql-common/package.json b/packages/sql-common/package.json index 1ec2097b6d..fb2752cb2c 100644 --- a/packages/sql-common/package.json +++ b/packages/sql-common/package.json @@ -10,7 +10,7 @@ "scripts": { "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "setup:dev": "nx run-many -t compile -p @opentelemetry/sql-common", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sql-common", "compile": "tsc --build tsconfig.json", "prepublishOnly": "npm run compile", "test": "nyc mocha 'test/**/*.test.ts'", diff --git a/packages/winston-transport/package.json b/packages/winston-transport/package.json index c98f26576c..10c2090691 100644 --- a/packages/winston-transport/package.json +++ b/packages/winston-transport/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/winston-transport", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/winston-transport", "compile": "tsc -p ." }, "keywords": [ From b71a1af39860a3f819416e57463e6cfe18547ebe Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 10:26:00 +0200 Subject: [PATCH 02/15] chore: add scripts to cassandra driver instr --- packages/instrumentation-amqplib/package.json | 9 ++++++--- .../package.json | 16 +++++++++++----- .../test/cassandra-driver.test.ts | 17 ++--------------- test/test-services.env | 2 +- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/packages/instrumentation-amqplib/package.json b/packages/instrumentation-amqplib/package.json index f210d7b92f..b41000dc55 100644 --- a/packages/instrumentation-amqplib/package.json +++ b/packages/instrumentation-amqplib/package.json @@ -31,18 +31,21 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-amqplib", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-amqplib", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start rabbitmq", + "test-services:stop": "cd ../.. && npm run test-services:stop rabbitmq", "version:update": "node ../../scripts/version-update.js", - "watch": "tsc -w", - "test:docker:run": "docker run -d --hostname demo-amqplib-rabbit --name amqplib-unittests -p 22221:5672 --env RABBITMQ_DEFAULT_USER=username --env RABBITMQ_DEFAULT_PASS=password rabbitmq:3" + "watch": "tsc -w" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" diff --git a/packages/instrumentation-cassandra-driver/package.json b/packages/instrumentation-cassandra-driver/package.json index 86146f2f37..b031f24e48 100644 --- a/packages/instrumentation-cassandra-driver/package.json +++ b/packages/instrumentation-cassandra-driver/package.json @@ -10,16 +10,22 @@ "directory": "packages/instrumentation-cassandra-driver" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-cassandra-driver", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-cassandra-driver", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "//todo": "echo test all versions should be configured", + "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start cassandra", + "test-services:stop": "cd ../.. && npm run test-services:stop cassandra", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "cassandra-driver", diff --git a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts index 728458f493..8d918f8576 100644 --- a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts +++ b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts @@ -56,11 +56,10 @@ const provider = new NodeTracerProvider({ context.setGlobalContextManager(new AsyncLocalStorageContextManager()); const testCassandra = process.env.RUN_CASSANDRA_TESTS; -const testCassandraLocally = process.env.RUN_CASSANDRA_TESTS_LOCAL; -const shouldTest = testCassandra || testCassandraLocally; +const shouldTest = testCassandra; const cassandraTimeoutMs = 60000; const cassandraContactPoint = - process.env.CASSANDRA_HOST ?? testCassandraLocally + process.env.CASSANDRA_HOST ? '127.0.0.1' : 'cassandra'; @@ -155,15 +154,7 @@ describe('CassandraDriverInstrumentation', () => { this.skip(); } - // Cassandra takes a long time to boot up - 20 seconds easily. - this.timeout(cassandraTimeoutMs); - - if (testCassandraLocally) { - testUtils.startDocker('cassandra'); - } - instrumentation = new CassandraDriverInstrumentation(); - instrumentation.setTracerProvider(provider); const cassandra = require('cassandra-driver'); @@ -193,11 +184,7 @@ describe('CassandraDriverInstrumentation', () => { }); after(async function () { - this.timeout(60000); await client?.shutdown?.(); - if (testCassandraLocally) { - testUtils.cleanUpDocker('cassandra'); - } }); describe('execute', () => { diff --git a/test/test-services.env b/test/test-services.env index 4f8a62f10b..16300608bf 100644 --- a/test/test-services.env +++ b/test/test-services.env @@ -1,5 +1,5 @@ RUN_CASSANDRA_TESTS=1 -CASSANDRA_HOST=localhostç +CASSANDRA_HOST=localhost RUN_MEMCACHED_TESTS=1 OPENTELEMETRY_MEMCACHED_HOST=localhost From 240359f3f6b69825f1211a20b4b3c055b681d378 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 11:40:14 +0200 Subject: [PATCH 03/15] chore: add scripts to iosredis instrumentation --- packages/instrumentation-ioredis/package.json | 22 ++++++++++--------- .../test/ioredis.test.ts | 13 +---------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/packages/instrumentation-ioredis/package.json b/packages/instrumentation-ioredis/package.json index b6ac79cb89..e15cd4b2d2 100644 --- a/packages/instrumentation-ioredis/package.json +++ b/packages/instrumentation-ioredis/package.json @@ -10,20 +10,22 @@ "directory": "packages/instrumentation-ioredis" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", - "test:debug": "cross-env RUN_REDIS_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test-all-versions", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis", - "compile": "tsc -p .", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.test.ts'", + "test:debug": "cross-env RUN_REDIS_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start redis", + "test-services:stop": "cd ../.. && npm run test-services:stop redis", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "instrumentation", diff --git a/packages/instrumentation-ioredis/test/ioredis.test.ts b/packages/instrumentation-ioredis/test/ioredis.test.ts index cd164c3232..39472b858f 100644 --- a/packages/instrumentation-ioredis/test/ioredis.test.ts +++ b/packages/instrumentation-ioredis/test/ioredis.test.ts @@ -91,8 +91,7 @@ describe('ioredis', () => { }); let ioredis: typeof ioredisTypes.default; let instrumentation: IORedisInstrumentation; - const shouldTestLocal = process.env.RUN_REDIS_TESTS_LOCAL; - const shouldTest = process.env.RUN_REDIS_TESTS || shouldTestLocal; + const shouldTest = process.env.RUN_REDIS_TESTS; let contextManager: AsyncLocalStorageContextManager; beforeEach(() => { @@ -113,21 +112,11 @@ describe('ioredis', () => { this.skip(); } - if (shouldTestLocal) { - testUtils.startDocker('redis'); - } - instrumentation = new IORedisInstrumentation(); instrumentation.setTracerProvider(provider); ioredis = require('ioredis'); }); - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('redis'); - } - }); - it('should have correct module name', () => { assert.strictEqual( instrumentation.instrumentationName, From dafcf86f644e8bcfa69ab77f1973c396bd6b9f91 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 12:11:04 +0200 Subject: [PATCH 04/15] chore: update sceript to a batch of instrumentations --- packages/instrumentation-knex/package.json | 11 +++++----- packages/instrumentation-koa/package.json | 12 +++++------ .../instrumentation-long-task/package.json | 8 +++---- .../instrumentation-lru-memoizer/package.json | 12 +++++------ .../instrumentation-memcached/package.json | 9 +++++--- .../test/index.test.ts | 13 +----------- packages/instrumentation-mongodb/package.json | 20 +++++++++--------- .../instrumentation-mongoose/package.json | 21 +++++++++++-------- .../test/mongoose-common.test.ts | 2 +- .../test/mongoose-v5-v6.test.ts | 2 +- .../test/mongoose-v7-v8.test.ts | 2 +- packages/instrumentation-mysql/package.json | 6 +++++- .../test/index.metrics.test.ts | 2 +- .../instrumentation-mysql/test/index.test.ts | 2 +- packages/instrumentation-mysql2/package.json | 6 +++++- .../instrumentation-mysql2/test/mysql.test.ts | 2 +- 16 files changed, 67 insertions(+), 63 deletions(-) diff --git a/packages/instrumentation-knex/package.json b/packages/instrumentation-knex/package.json index fd67b40170..33dc371dc6 100644 --- a/packages/instrumentation-knex/package.json +++ b/packages/instrumentation-knex/package.json @@ -10,16 +10,17 @@ "directory": "packages/instrumentation-knex" }, "scripts": { - "test": "nyc mocha 'test/**/*.ts'", - "tdd": "yarn test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-knex", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "version:update": "node ../../scripts/version-update.js", "lint:readme": "node ../../scripts/lint-readme", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-knex", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.ts'", + "//todo": "echo \"add test-all-versions\"", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-koa/package.json b/packages/instrumentation-koa/package.json index 2ceba96abd..d12b4b7cde 100644 --- a/packages/instrumentation-koa/package.json +++ b/packages/instrumentation-koa/package.json @@ -10,17 +10,17 @@ "directory": "packages/instrumentation-koa" }, "scripts": { - "test": "nyc mocha 'test/**/*.ts'", - "test-all-versions": "tav", - "tdd": "yarn test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-koa", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-koa", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.ts'", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-long-task/package.json b/packages/instrumentation-long-task/package.json index 844b4bcca1..15890bf0cf 100644 --- a/packages/instrumentation-long-task/package.json +++ b/packages/instrumentation-long-task/package.json @@ -12,16 +12,16 @@ "directory": "packages/instrumentation-long-task" }, "scripts": { + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task", - "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, "keywords": [ diff --git a/packages/instrumentation-lru-memoizer/package.json b/packages/instrumentation-lru-memoizer/package.json index 501514de3f..306fe29c65 100644 --- a/packages/instrumentation-lru-memoizer/package.json +++ b/packages/instrumentation-lru-memoizer/package.json @@ -10,17 +10,17 @@ "directory": "packages/instrumentation-lru-memoizer" }, "scripts": { - "test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", - "test-all-versions": "tav", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "lru-memoizer", diff --git a/packages/instrumentation-memcached/package.json b/packages/instrumentation-memcached/package.json index 08779db07c..b1958bfa47 100644 --- a/packages/instrumentation-memcached/package.json +++ b/packages/instrumentation-memcached/package.json @@ -11,15 +11,18 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", - "test:debug": "cross-env RUN_MEMCACHED_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_MEMCACHED_TESTS_LOCAL=true npm run test", + "test:debug": "cross-env RUN_MEMCACHED_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "//todo": "echo \"add test-all-versions\"", + "test-services:start": "cd ../.. && npm run test-services:start memcached", + "test-services:stop": "cd ../.. && npm run test-services:stop memcached", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ diff --git a/packages/instrumentation-memcached/test/index.test.ts b/packages/instrumentation-memcached/test/index.test.ts index b07beb9333..038b2b5d72 100644 --- a/packages/instrumentation-memcached/test/index.test.ts +++ b/packages/instrumentation-memcached/test/index.test.ts @@ -71,8 +71,7 @@ const getClient = (...args: any[]): ExtendedMemcached => { }; const KEY = 'foo'; const VALUE = '_test_value_'; -const shouldTestLocal = process.env.RUN_MEMCACHED_TESTS_LOCAL; -const shouldTest = process.env.RUN_MEMCACHED_TESTS || shouldTestLocal; +const shouldTest = process.env.RUN_MEMCACHED_TESTS; describe('memcached@2.x', () => { const provider = new NodeTracerProvider({ @@ -103,16 +102,6 @@ describe('memcached@2.x', () => { this.test!.parent!.pending = true; this.skip(); } - - if (shouldTestLocal) { - testUtils.startDocker('memcached'); - } - }); - - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('memcached'); - } }); describe('default config', () => { diff --git a/packages/instrumentation-mongodb/package.json b/packages/instrumentation-mongodb/package.json index 349a3c8e13..086c470d8e 100644 --- a/packages/instrumentation-mongodb/package.json +++ b/packages/instrumentation-mongodb/package.json @@ -10,16 +10,6 @@ "directory": "packages/instrumentation-mongodb" }, "scripts": { - "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", - "test": "npm run test-v4 && npm run test-v5-v6", - "test-v3": "tav mongodb 3.7.4 npm run test-v3-run", - "test-v4": "tav mongodb 4.17.0 npm run test-v4-run", - "test-v5-v6": "npm run test-v5-v6-run", - "test-v3-run": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'", - "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'", - "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'", - "test-all-versions": "tav", - "tdd": "npm run test-v5-v6-run -- --watch-extensions ts --watch", "clean": "rimraf build/*", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", @@ -28,6 +18,16 @@ "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongodb", "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "npm run test-v5-v6-run -- --watch-extensions ts --watch", + "test": "npm run test-v5-v6", + "test-v3": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'", + "test-v4": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v4.test.ts'", + "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'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start mongodb", + "test-services:stop": "cd ../.. && npm run test-services:stop mongodb", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-mongoose/package.json b/packages/instrumentation-mongoose/package.json index fce1cd3973..ae4193cc16 100644 --- a/packages/instrumentation-mongoose/package.json +++ b/packages/instrumentation-mongoose/package.json @@ -10,20 +10,23 @@ "directory": "packages/instrumentation-mongoose" }, "scripts": { - "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", - "test": "npm run test-v5-v6", - "test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'", - "test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'", - "test-all-versions": "tav", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongoose", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongoose", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "npm run test-v5-v6", + "test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'", + "test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start mongodb", + "test-services:stop": "cd ../.. && npm run test-services:stop mongodb", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "mongodb", diff --git a/packages/instrumentation-mongoose/test/mongoose-common.test.ts b/packages/instrumentation-mongoose/test/mongoose-common.test.ts index ed954b8b54..77e581e46c 100644 --- a/packages/instrumentation-mongoose/test/mongoose-common.test.ts +++ b/packages/instrumentation-mongoose/test/mongoose-common.test.ts @@ -38,7 +38,7 @@ import User, { IUser, loadUsers } from './user'; import { assertSpan, getStatement } from './asserts'; import { DB_NAME, MONGO_URI } from './config'; -// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo +// Please run `npm run test-services:start` before describe('mongoose instrumentation [common]', () => { before(async () => { try { diff --git a/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts b/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts index be6f5fc5ed..782038f339 100644 --- a/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts +++ b/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts @@ -35,7 +35,7 @@ import { DB_NAME, MONGO_URI } from './config'; // We can't use @ts-expect-error because it will fail depending on the used mongoose version on tests /* eslint-disable @typescript-eslint/ban-ts-comment */ -// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo +// Please run `npm run test-services:start` before describe('mongoose instrumentation [v5/v6]', () => { before(async () => { try { diff --git a/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts b/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts index 2ef423f47f..efaa236d37 100644 --- a/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts +++ b/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts @@ -32,7 +32,7 @@ import User, { loadUsers } from './user'; import { assertSpan, getStatement } from './asserts'; import { DB_NAME, MONGO_URI } from './config'; -// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo +// Please run `npm run test-services:start` before describe('mongoose instrumentation [v7/v8]', () => { before(async () => { try { diff --git a/packages/instrumentation-mysql/package.json b/packages/instrumentation-mysql/package.json index 1a5b43173b..d422a703b0 100644 --- a/packages/instrumentation-mysql/package.json +++ b/packages/instrumentation-mysql/package.json @@ -11,13 +11,17 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "//todo": "echo \"add test-all-versions\"", + "test-services:start": "cd ../.. && npm run test-services:start mysql", + "test-services:stop": "cd ../.. && npm run test-services:stop mysql", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ diff --git a/packages/instrumentation-mysql/test/index.metrics.test.ts b/packages/instrumentation-mysql/test/index.metrics.test.ts index 89c40c891b..b2e11e5a8a 100644 --- a/packages/instrumentation-mysql/test/index.metrics.test.ts +++ b/packages/instrumentation-mysql/test/index.metrics.test.ts @@ -62,7 +62,7 @@ describe('mysql@2.x-Metrics', () => { let otelTestingMeterProvider; let inMemoryMetricsExporter: InMemoryMetricExporter; // assumes local mysql db is already available in CI or - // using `npm run test-services:start` script at the root folder + // using `npm run test-services:start` script const shouldTest = process.env.RUN_MYSQL_TESTS; function initMeterProvider() { diff --git a/packages/instrumentation-mysql/test/index.test.ts b/packages/instrumentation-mysql/test/index.test.ts index cd0ccc6e7f..4cb6f17259 100644 --- a/packages/instrumentation-mysql/test/index.test.ts +++ b/packages/instrumentation-mysql/test/index.test.ts @@ -54,7 +54,7 @@ describe('mysql@2.x-Tracing', () => { let pool: mysqlTypes.Pool; let poolCluster: mysqlTypes.PoolCluster; // assumes local mysql db is already available in CI or - // using `npm run test-services:start` script at the root folder + // using `npm run test-services:start` script const shouldTest = process.env.RUN_MYSQL_TESTS; const memoryExporter = new InMemorySpanExporter(); const provider = new BasicTracerProvider({ diff --git a/packages/instrumentation-mysql2/package.json b/packages/instrumentation-mysql2/package.json index 285c883b73..6f7f156d68 100644 --- a/packages/instrumentation-mysql2/package.json +++ b/packages/instrumentation-mysql2/package.json @@ -11,14 +11,18 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql2", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql2", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start mysql", + "test-services:stop": "cd ../.. && npm run test-services:stop mysql", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ diff --git a/packages/instrumentation-mysql2/test/mysql.test.ts b/packages/instrumentation-mysql2/test/mysql.test.ts index 1169e1e3d3..ada69941ad 100644 --- a/packages/instrumentation-mysql2/test/mysql.test.ts +++ b/packages/instrumentation-mysql2/test/mysql.test.ts @@ -76,7 +76,7 @@ const execPromise = (conn: Connection, command: string) => { describe('mysql2', () => { // assumes local mysql db is already available in CI or - // using `npm run test-services:start` script at the root folder + // using `npm run test-services:start` script const shouldTest = process.env.RUN_MYSQL_TESTS; before(async function () { From 6b88fdbd1ea79fdc6b752a3c2751868ab7edacb8 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 12:28:25 +0200 Subject: [PATCH 05/15] chore: updates cripts for oracle and pg instrumentations --- .../instrumentation-oracledb/package.json | 8 +++-- .../test/oracle.test.ts | 31 ++----------------- packages/instrumentation-pg/package.json | 8 +++-- .../instrumentation-pg/test/pg-pool.test.ts | 13 ++------ 4 files changed, 14 insertions(+), 46 deletions(-) diff --git a/packages/instrumentation-oracledb/package.json b/packages/instrumentation-oracledb/package.json index 866da46ed7..cb31c1fcd9 100644 --- a/packages/instrumentation-oracledb/package.json +++ b/packages/instrumentation-oracledb/package.json @@ -20,10 +20,12 @@ "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_ORACLEDB_TESTS_LOCAL=true npm run test-all-versions", "test:debug": "mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_ORACLEDB_TESTS_LOCAL=true npm run test", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start oracledb", + "test-services:stop": "cd ../.. && npm run test-services:stop oracledb", "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, diff --git a/packages/instrumentation-oracledb/test/oracle.test.ts b/packages/instrumentation-oracledb/test/oracle.test.ts index c8857eed25..0eec83b0ac 100644 --- a/packages/instrumentation-oracledb/test/oracle.test.ts +++ b/packages/instrumentation-oracledb/test/oracle.test.ts @@ -395,8 +395,7 @@ describe('oracledb', () => { let connection: oracledb.Connection; const testOracleDB = process.env.RUN_ORACLEDB_TESTS; // For CI: assumes local oracledb is already available - const testOracleDBLocally = process.env.RUN_ORACLEDB_TESTS_LOCAL; // For local: spins up local oracledb via docker - const shouldTest = testOracleDB || testOracleDBLocally; // Skips these tests if false (default) + const shouldTest = testOracleDB; // Skips these tests if false (default) const sql = 'select 1 from dual'; const sqlWithBinds = 'select :1 from dual'; const sqlWithBindsByName = 'select :name from dual'; @@ -483,29 +482,7 @@ describe('oracledb', () => { skip(); } - if (testOracleDBLocally) { - testUtils.startDocker('oracledb'); - - // increase test time - this.timeout(50000); - - // check if docker container is up - let retries = 6; - while (retries-- > 0) { - try { - connection = await oracledb.getConnection(CONFIG); - break; - } catch (err) { - console.log('retry count %d failed waiting for DB', retries); - await new Promise(r => setTimeout(r, 10000)); - } - } - if (retries < 0) { - throw new Error('docker setup Failed'); - } - } else { - connection = await oracledb.getConnection(CONFIG); - } + connection = await oracledb.getConnection(CONFIG); await doSetup(); updateAttrSpanList(connection); contextManager = new AsyncLocalStorageContextManager().enable(); @@ -520,10 +497,6 @@ describe('oracledb', () => { await connection.close(); } instrumentation.disable(); - if (testOracleDBLocally) { - this.timeout(5000); - testUtils.cleanUpDocker('oracledb'); - } }); beforeEach(() => { diff --git a/packages/instrumentation-pg/package.json b/packages/instrumentation-pg/package.json index 1069be9421..6eaf71c743 100644 --- a/packages/instrumentation-pg/package.json +++ b/packages/instrumentation-pg/package.json @@ -19,10 +19,12 @@ "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_POSTGRES_TESTS_LOCAL=true npm run test-all-versions", "test:debug": "mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_POSTGRES_TESTS_LOCAL=true npm run test", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start postgres", + "test-services:stop": "cd ../.. && npm run test-services:stop postgres", "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, diff --git a/packages/instrumentation-pg/test/pg-pool.test.ts b/packages/instrumentation-pg/test/pg-pool.test.ts index da240f6057..303fce0796 100644 --- a/packages/instrumentation-pg/test/pg-pool.test.ts +++ b/packages/instrumentation-pg/test/pg-pool.test.ts @@ -127,9 +127,8 @@ describe('pg-pool', () => { spanProcessors: [new SimpleSpanProcessor(memoryExporter)], }); - const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available - const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker - const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default) + const testPostgres = process.env.RUN_POSTGRES_TESTS; + const shouldTest = testPostgres; // Skips these tests if false (default) before(function () { const skip = () => { @@ -143,10 +142,6 @@ describe('pg-pool', () => { skip(); } - if (testPostgresLocally) { - testUtils.startDocker('postgres'); - } - instrumentation = new PgInstrumentation(); contextManager = new AsyncLocalStorageContextManager().enable(); @@ -158,10 +153,6 @@ describe('pg-pool', () => { }); after(done => { - if (testPostgresLocally) { - testUtils.cleanUpDocker('postgres'); - } - pool.end(() => { done(); }); From 9a8d2acf5c4faf6c3f3b7787bba13f7102383448 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 15:14:17 +0200 Subject: [PATCH 06/15] chore: update script for a batch of pacakges --- .../package.json | 2 +- .../auto-instrumentations-node/package.json | 2 +- .../auto-instrumentations-web/package.json | 2 +- .../baggage-log-record-processor/package.json | 2 +- packages/baggage-span-processor/package.json | 2 +- packages/contrib-test-utils/package.json | 4 +-- packages/host-metrics/package.json | 2 +- packages/id-generator-aws-xray/package.json | 4 +-- packages/instrumentation-redis/package.json | 26 +++++++++---------- .../test/v2-v3/redis.test.ts | 13 +--------- .../test/v4/redis.test.ts | 11 -------- .../instrumentation-redis/test/v4/utils.ts | 3 +-- packages/instrumentation-tedious/package.json | 6 ++++- .../test/instrumentation.test.ts | 21 +++------------ packages/instrumentation-typeorm/package.json | 2 +- packages/instrumentation-undici/package.json | 16 ++++++------ .../package.json | 8 +++--- packages/instrumentation-winston/package.json | 18 ++++++------- packages/plugin-react-load/package.json | 6 ++--- packages/propagation-utils/package.json | 2 +- .../propagator-aws-xray-lambda/package.json | 10 +++---- packages/propagator-aws-xray/package.json | 8 +++--- packages/propagator-instana/package.json | 12 ++++----- packages/propagator-ot-trace/package.json | 12 ++++----- packages/redis-common/package.json | 4 +-- .../package.json | 2 +- packages/resource-detector-aws/package.json | 2 +- packages/resource-detector-azure/package.json | 2 +- .../resource-detector-container/package.json | 2 +- packages/resource-detector-gcp/package.json | 2 +- .../resource-detector-github/package.json | 2 +- .../resource-detector-instana/package.json | 2 +- packages/sql-common/package.json | 4 +-- packages/winston-transport/package.json | 10 +++---- 34 files changed, 96 insertions(+), 130 deletions(-) diff --git a/packages/auto-configuration-propagators/package.json b/packages/auto-configuration-propagators/package.json index c4c27091e1..372c6b1f95 100644 --- a/packages/auto-configuration-propagators/package.json +++ b/packages/auto-configuration-propagators/package.json @@ -20,8 +20,8 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-configuration-propagators", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-configuration-propagators", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/auto-instrumentations-node/package.json b/packages/auto-instrumentations-node/package.json index c6df118ad9..62c0ca8732 100644 --- a/packages/auto-instrumentations-node/package.json +++ b/packages/auto-instrumentations-node/package.json @@ -24,8 +24,8 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-node", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-node", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/auto-instrumentations-web/package.json b/packages/auto-instrumentations-web/package.json index 8558be2b34..e467b3080a 100644 --- a/packages/auto-instrumentations-web/package.json +++ b/packages/auto-instrumentations-web/package.json @@ -22,8 +22,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-web", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-web", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/baggage-log-record-processor/package.json b/packages/baggage-log-record-processor/package.json index 484748b04e..9cc75efbe0 100644 --- a/packages/baggage-log-record-processor/package.json +++ b/packages/baggage-log-record-processor/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-log-record-processor", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-log-record-processor", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prewatch": "npm run precompile", diff --git a/packages/baggage-span-processor/package.json b/packages/baggage-span-processor/package.json index 9824b02d17..1185085b76 100644 --- a/packages/baggage-span-processor/package.json +++ b/packages/baggage-span-processor/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-span-processor", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-span-processor", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/contrib-test-utils/package.json b/packages/contrib-test-utils/package.json index 7b46fa0e4a..530f73831c 100644 --- a/packages/contrib-test-utils/package.json +++ b/packages/contrib-test-utils/package.json @@ -8,10 +8,10 @@ "access": "public" }, "scripts": { + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/contrib-test-utils", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/contrib-test-utils", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" }, diff --git a/packages/host-metrics/package.json b/packages/host-metrics/package.json index 8d7957fb9b..b09d9ab39b 100644 --- a/packages/host-metrics/package.json +++ b/packages/host-metrics/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/host-metrics", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/host-metrics", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/id-generator-aws-xray/package.json b/packages/id-generator-aws-xray/package.json index f99859cba7..2da29b740c 100644 --- a/packages/id-generator-aws-xray/package.json +++ b/packages/id-generator-aws-xray/package.json @@ -19,9 +19,9 @@ "directory": "packages/id-generator-aws-xray" }, "scripts": { - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/id-generator-aws-xray", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/id-generator-aws-xray", "test": "nyc mocha test/**/*.test.ts", "test:browser": "nyc karma start --single-run", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-redis/package.json b/packages/instrumentation-redis/package.json index adf8ecf1fa..01481fd4a6 100644 --- a/packages/instrumentation-redis/package.json +++ b/packages/instrumentation-redis/package.json @@ -10,23 +10,23 @@ "directory": "packages/instrumentation-redis" }, "scripts": { - "test-v2-v3": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v2-v3/*.test.ts'", - "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v4/*.test.ts'", - "test:debug": "cross-env RUN_REDIS_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test", - "test:docker:run": "docker run --rm -d --name otel-redis -p 63790:6379 redis:alpine", - "test:docker:stop": "docker stop otel-redis", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test-all-versions", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-redis", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-redis", - "compile": "tsc -p .", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test-v2-v3": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v2-v3/*.test.ts'", + "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v4/*.test.ts'", + "test:debug": "cross-env RUN_REDIS_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start redis", + "test-services:stop": "cd ../.. && npm run test-services:stop redis", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "instrumentation", diff --git a/packages/instrumentation-redis/test/v2-v3/redis.test.ts b/packages/instrumentation-redis/test/v2-v3/redis.test.ts index 529399823f..62d996cdba 100644 --- a/packages/instrumentation-redis/test/v2-v3/redis.test.ts +++ b/packages/instrumentation-redis/test/v2-v3/redis.test.ts @@ -62,8 +62,7 @@ const unsetStatus: SpanStatus = { describe('redis v2-v3', () => { let redis: any; - const shouldTestLocal = process.env.RUN_REDIS_TESTS_LOCAL; - const shouldTest = process.env.RUN_REDIS_TESTS || shouldTestLocal; + const shouldTest = process.env.RUN_REDIS_TESTS; const tracer = trace.getTracer('external'); before(function () { @@ -75,19 +74,9 @@ describe('redis v2-v3', () => { this.skip(); } - if (shouldTestLocal) { - testUtils.startDocker('redis'); - } - redis = require('redis'); }); - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('redis'); - } - }); - describe('#createClient()', () => { it('should propagate the current span to event handlers', done => { const span = tracer.startSpan('test span'); diff --git a/packages/instrumentation-redis/test/v4/redis.test.ts b/packages/instrumentation-redis/test/v4/redis.test.ts index 01927c1df5..ad1b52fcd8 100644 --- a/packages/instrumentation-redis/test/v4/redis.test.ts +++ b/packages/instrumentation-redis/test/v4/redis.test.ts @@ -27,7 +27,6 @@ import { redisTestConfig, redisTestUrl, shouldTest, - shouldTestLocal, } from './utils'; import * as testUtils from '@opentelemetry/contrib-test-utils'; @@ -64,16 +63,6 @@ describe('redis v4', () => { this.test!.parent!.pending = true; this.skip(); } - - if (shouldTestLocal) { - testUtils.startDocker('redis'); - } - }); - - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('redis'); - } }); let client: RedisClientType; diff --git a/packages/instrumentation-redis/test/v4/utils.ts b/packages/instrumentation-redis/test/v4/utils.ts index cc0e0a6609..b9c2e7705e 100644 --- a/packages/instrumentation-redis/test/v4/utils.ts +++ b/packages/instrumentation-redis/test/v4/utils.ts @@ -20,5 +20,4 @@ export const redisTestConfig = { export const redisTestUrl = `redis://${redisTestConfig.host}:${redisTestConfig.port}`; -export const shouldTestLocal = process.env.RUN_REDIS_TESTS_LOCAL; -export const shouldTest = process.env.RUN_REDIS_TESTS || shouldTestLocal; +export const shouldTest = process.env.RUN_REDIS_TESTS; diff --git a/packages/instrumentation-tedious/package.json b/packages/instrumentation-tedious/package.json index 4275614e49..d84cc2f7bd 100644 --- a/packages/instrumentation-tedious/package.json +++ b/packages/instrumentation-tedious/package.json @@ -11,14 +11,18 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-tedious", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-tedious", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", + "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", + "test-services:start": "cd ../.. && npm run test-services:start mssql", + "test-services:stop": "cd ../.. && npm run test-services:stop mssql", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ diff --git a/packages/instrumentation-tedious/test/instrumentation.test.ts b/packages/instrumentation-tedious/test/instrumentation.test.ts index 4c8c27e76b..46eed76563 100644 --- a/packages/instrumentation-tedious/test/instrumentation.test.ts +++ b/packages/instrumentation-tedious/test/instrumentation.test.ts @@ -93,31 +93,16 @@ describe('tedious', () => { const provider = new BasicTracerProvider({ spanProcessors: [new SimpleSpanProcessor(memoryExporter)], }); - const shouldTest = process.env.RUN_MSSQL_TESTS; // For CI: assumes local db is already available - const shouldTestLocally = process.env.RUN_MSSQL_TESTS_LOCAL; // For local: spins up local db via docker + const shouldTest = process.env.RUN_MSSQL_TESTS; before(function (done) { - if (!(shouldTest || shouldTestLocally) || incompatVersions) { + if (!shouldTest || incompatVersions) { // this.skip() workaround // https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901 this.test!.parent!.pending = true; this.skip(); } - if (shouldTestLocally) { - testUtils.startDocker('mssql'); - // wait 15 seconds for docker container to start - this.timeout(20000); - setTimeout(done, 15000); - } else { - done(); - } - }); - - after(function () { - if (shouldTestLocally) { - this.timeout(15000); - testUtils.cleanUpDocker('mssql'); - } + done(); }); beforeEach(async function () { diff --git a/packages/instrumentation-typeorm/package.json b/packages/instrumentation-typeorm/package.json index 993eab6a00..bcef4ad23b 100644 --- a/packages/instrumentation-typeorm/package.json +++ b/packages/instrumentation-typeorm/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-typeorm", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-typeorm", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", diff --git a/packages/instrumentation-undici/package.json b/packages/instrumentation-undici/package.json index 7cf84e2d07..46df2808c4 100644 --- a/packages/instrumentation-undici/package.json +++ b/packages/instrumentation-undici/package.json @@ -10,17 +10,17 @@ "directory": "packages/instrumentation-undici" }, "scripts": { - "prepublishOnly": "npm run compile", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-undici", - "compile": "tsc -p .", - "test": "nyc mocha test/**/*.test.ts", - "test-all-versions": "tav", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-undici", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc -w", - "version:update": "node ../../scripts/version-update.js" + "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha test/**/*.test.ts", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js", + "watch": "tsc -w" }, "keywords": [ "opentelemetry", diff --git a/packages/instrumentation-user-interaction/package.json b/packages/instrumentation-user-interaction/package.json index 8acb410df3..dc115677c5 100644 --- a/packages/instrumentation-user-interaction/package.json +++ b/packages/instrumentation-user-interaction/package.json @@ -12,16 +12,16 @@ "directory": "packages/instrumentation-user-interaction" }, "scripts": { + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-user-interaction", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-user-interaction", - "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "karma start --single-run", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, "keywords": [ diff --git a/packages/instrumentation-winston/package.json b/packages/instrumentation-winston/package.json index b1e8f5946a..e000cce64d 100644 --- a/packages/instrumentation-winston/package.json +++ b/packages/instrumentation-winston/package.json @@ -10,20 +10,20 @@ "directory": "packages/instrumentation-winston" }, "scripts": { - "test": "npm run test-v1-v2 && npm run test-v3 && nyc merge .nyc_output ./coverage/coverage-final.json", - "test-v1-v2": "tav winston 2.4.7 npm run test-run", - "test-v3": "npm run test-run", - "test-run": "nyc --no-clean mocha 'test/**/*.test.ts'", - "test-all-versions": "tav", - "tdd": "npm run test-run -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-winston", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-winston", - "compile": "tsc -p ." + "tdd": "npm run test-run -- --watch-extensions ts --watch", + "test": "npm run test-v1-v2 && npm run test-v3 && nyc merge .nyc_output ./coverage/coverage-final.json", + "test-v1-v2": "tav winston 2.4.7 npm run test-run", + "test-v3": "npm run test-run", + "test-run": "nyc --no-clean mocha 'test/**/*.test.ts'", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "instrumentation", diff --git a/packages/plugin-react-load/package.json b/packages/plugin-react-load/package.json index 26634f5f3c..4a68753ec0 100644 --- a/packages/plugin-react-load/package.json +++ b/packages/plugin-react-load/package.json @@ -13,15 +13,15 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/plugin-react-load", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/plugin-react-load", - "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, "keywords": [ diff --git a/packages/propagation-utils/package.json b/packages/propagation-utils/package.json index fbf1b88bb9..e780044f6f 100644 --- a/packages/propagation-utils/package.json +++ b/packages/propagation-utils/package.json @@ -9,8 +9,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagation-utils", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagation-utils", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/propagator-aws-xray-lambda/package.json b/packages/propagator-aws-xray-lambda/package.json index 72aed9a336..e01c8e2d56 100644 --- a/packages/propagator-aws-xray-lambda/package.json +++ b/packages/propagator-aws-xray-lambda/package.json @@ -11,14 +11,14 @@ "directory": "packages/propagator-aws-xray-lambda" }, "scripts": { - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray-lambda", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "test": "nyc mocha test/**/*.test.ts", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray-lambda", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "test": "nyc mocha test/**/*.test.ts", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/packages/propagator-aws-xray/package.json b/packages/propagator-aws-xray/package.json index 16c47a3519..2171b19ea6 100644 --- a/packages/propagator-aws-xray/package.json +++ b/packages/propagator-aws-xray/package.json @@ -11,17 +11,17 @@ "directory": "packages/propagator-aws-xray" }, "scripts": { - "prepublishOnly": "npm run compile", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "prepublishOnly": "npm run compile", "test": "nyc mocha test/**/*.test.ts", "test:browser": "nyc karma start --single-run", "tdd": "npm run tdd:node", "tdd:node": "npm run test -- --watch-extensions ts --watch", "tdd:browser": "karma start", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "lint": "eslint . --ext .ts", - "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, diff --git a/packages/propagator-instana/package.json b/packages/propagator-instana/package.json index 54af171aaf..47d8de0018 100644 --- a/packages/propagator-instana/package.json +++ b/packages/propagator-instana/package.json @@ -11,15 +11,15 @@ "directory": "packages/propagator-instana" }, "scripts": { - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-instana", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "test": "nyc mocha test/**/*.test.ts", - "test:browser": "nyc karma start --single-run", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-instana", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "test": "nyc mocha test/**/*.test.ts", + "test:browser": "nyc karma start --single-run", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/packages/propagator-ot-trace/package.json b/packages/propagator-ot-trace/package.json index d5091c3686..93bebe1cf8 100644 --- a/packages/propagator-ot-trace/package.json +++ b/packages/propagator-ot-trace/package.json @@ -11,15 +11,15 @@ "directory": "packages/propagator-ot-trace" }, "scripts": { - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-ot-trace", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "test": "nyc mocha test/**/*.test.ts", - "test:browser": "nyc karma start --single-run", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-ot-trace", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "test": "nyc mocha test/**/*.test.ts", + "test:browser": "nyc karma start --single-run", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/packages/redis-common/package.json b/packages/redis-common/package.json index fa94d28d68..687a6d34c0 100644 --- a/packages/redis-common/package.json +++ b/packages/redis-common/package.json @@ -8,10 +8,10 @@ "access": "public" }, "scripts": { + "compile": "tsc --build tsconfig.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/redis-common", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/redis-common", - "compile": "tsc --build tsconfig.json", "prepublishOnly": "npm run compile", "test": "nyc mocha 'test/**/*.test.ts'", "watch": "tsc -w" diff --git a/packages/resource-detector-alibaba-cloud/package.json b/packages/resource-detector-alibaba-cloud/package.json index bf061e0953..6c58d8a614 100644 --- a/packages/resource-detector-alibaba-cloud/package.json +++ b/packages/resource-detector-alibaba-cloud/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-alibaba-cloud", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-alibaba-cloud", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-aws/package.json b/packages/resource-detector-aws/package.json index 18fc27558f..7a17d39f3d 100644 --- a/packages/resource-detector-aws/package.json +++ b/packages/resource-detector-aws/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-aws", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-aws", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-azure/package.json b/packages/resource-detector-azure/package.json index f56df8cf09..d41c9bb3ed 100644 --- a/packages/resource-detector-azure/package.json +++ b/packages/resource-detector-azure/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-azure", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-azure", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-container/package.json b/packages/resource-detector-container/package.json index 7dbd0debb4..bfe1725598 100644 --- a/packages/resource-detector-container/package.json +++ b/packages/resource-detector-container/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-container", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-container", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-gcp/package.json b/packages/resource-detector-gcp/package.json index 0c974ba620..7becc0e730 100644 --- a/packages/resource-detector-gcp/package.json +++ b/packages/resource-detector-gcp/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-gcp", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-gcp", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-github/package.json b/packages/resource-detector-github/package.json index 7195234c7b..e34e89ea5b 100644 --- a/packages/resource-detector-github/package.json +++ b/packages/resource-detector-github/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-github", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-github", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-instana/package.json b/packages/resource-detector-instana/package.json index f90ef1a71d..cf614b10e1 100644 --- a/packages/resource-detector-instana/package.json +++ b/packages/resource-detector-instana/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-instana", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-instana", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/sql-common/package.json b/packages/sql-common/package.json index fb2752cb2c..43f53d1a37 100644 --- a/packages/sql-common/package.json +++ b/packages/sql-common/package.json @@ -8,10 +8,10 @@ "access": "public" }, "scripts": { - "lint": "eslint . --ext .ts", - "lint:fix": "eslint . --ext .ts --fix", "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sql-common", "compile": "tsc --build tsconfig.json", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", "test": "nyc mocha 'test/**/*.test.ts'", "watch": "tsc -w" diff --git a/packages/winston-transport/package.json b/packages/winston-transport/package.json index 10c2090691..64f9b82123 100644 --- a/packages/winston-transport/package.json +++ b/packages/winston-transport/package.json @@ -10,15 +10,15 @@ "directory": "packages/winston-transport" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/winston-transport", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/winston-transport", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.test.ts'", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "transport", From 978520104a416378febcb5455228662e0391565f Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 16:16:51 +0200 Subject: [PATCH 07/15] chore: organize npm scripts --- incubator/opentelemetry-sampler-aws-xray/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incubator/opentelemetry-sampler-aws-xray/package.json b/incubator/opentelemetry-sampler-aws-xray/package.json index da7c3aaca6..70b9409204 100644 --- a/incubator/opentelemetry-sampler-aws-xray/package.json +++ b/incubator/opentelemetry-sampler-aws-xray/package.json @@ -28,11 +28,11 @@ ], "repository": "open-telemetry/opentelemetry-js-contrib", "scripts": { - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sampler-aws-xray", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sampler-aws-xray", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", From 2eef9139b1a1fbac09b410777d4bb42030c8a050 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 16:46:47 +0200 Subject: [PATCH 08/15] chore: fix lint issues --- .../test/cassandra-driver.test.ts | 7 +++---- packages/instrumentation-redis/test/v4/redis.test.ts | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts index 8d918f8576..aab605cdca 100644 --- a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts +++ b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts @@ -58,10 +58,9 @@ context.setGlobalContextManager(new AsyncLocalStorageContextManager()); const testCassandra = process.env.RUN_CASSANDRA_TESTS; const shouldTest = testCassandra; const cassandraTimeoutMs = 60000; -const cassandraContactPoint = - process.env.CASSANDRA_HOST - ? '127.0.0.1' - : 'cassandra'; +const cassandraContactPoint = process.env.CASSANDRA_HOST + ? '127.0.0.1' + : 'cassandra'; function assertSpan( span: ReadableSpan, diff --git a/packages/instrumentation-redis/test/v4/redis.test.ts b/packages/instrumentation-redis/test/v4/redis.test.ts index ad1b52fcd8..95166d207f 100644 --- a/packages/instrumentation-redis/test/v4/redis.test.ts +++ b/packages/instrumentation-redis/test/v4/redis.test.ts @@ -23,11 +23,7 @@ import { RedisInstrumentation } from '../../src'; import type { MultiErrorReply } from '../../src/v4/internal-types'; import * as assert from 'assert'; -import { - redisTestConfig, - redisTestUrl, - shouldTest, -} from './utils'; +import { redisTestConfig, redisTestUrl, shouldTest } from './utils'; import * as testUtils from '@opentelemetry/contrib-test-utils'; const instrumentation = registerInstrumentationTesting( From 813a7c78de06fdd0f46d14d5eb312f522c2bb953 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 16:58:47 +0200 Subject: [PATCH 09/15] chore: add cros-env where needed --- package-lock.json | 14 ++++++++++++++ packages/instrumentation-amqplib/package.json | 1 + .../instrumentation-cassandra-driver/package.json | 1 + packages/instrumentation-mongodb/package.json | 1 + packages/instrumentation-mongoose/package.json | 1 + packages/instrumentation-mysql/package.json | 1 + packages/instrumentation-mysql2/package.json | 1 + packages/instrumentation-tedious/package.json | 1 + 8 files changed, 21 insertions(+) diff --git a/package-lock.json b/package-lock.json index 4fee947cdd..d265e1145a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31624,6 +31624,7 @@ "@types/node": "18.18.14", "@types/sinon": "17.0.4", "amqplib": "0.8.0", + "cross-env": "7.0.3", "expect": "29.2.0", "lodash": "4.17.21", "nyc": "17.1.0", @@ -31762,6 +31763,7 @@ "@types/semver": "7.5.8", "@types/sinon": "17.0.4", "cassandra-driver": "4.6.4", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "sinon": "15.2.0", @@ -32429,6 +32431,7 @@ "@types/bson": "4.0.5", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "mongodb": "6.15.0", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -32592,6 +32595,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "expect": "29.2.0", "mongoose": "6.13.8", "nyc": "17.1.0", @@ -32624,6 +32628,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/sinon": "17.0.4", + "cross-env": "7.0.3", "mysql": "2.18.1", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -32654,6 +32659,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/semver": "7.5.8", + "cross-env": "7.0.3", "mysql2": "3.11.5", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -33147,6 +33153,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "semver": "7.7.2", @@ -40255,6 +40262,7 @@ "@types/node": "18.18.14", "@types/sinon": "17.0.4", "amqplib": "0.8.0", + "cross-env": "7.0.3", "expect": "29.2.0", "lodash": "4.17.21", "nyc": "17.1.0", @@ -40353,6 +40361,7 @@ "@types/semver": "7.5.8", "@types/sinon": "17.0.4", "cassandra-driver": "4.6.4", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "sinon": "15.2.0", @@ -40852,6 +40861,7 @@ "@types/bson": "4.0.5", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "mongodb": "6.15.0", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -40957,6 +40967,7 @@ "@opentelemetry/semantic-conventions": "^1.27.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "expect": "29.2.0", "mongoose": "6.13.8", "nyc": "17.1.0", @@ -40979,6 +40990,7 @@ "@types/mysql": "2.15.27", "@types/node": "18.18.14", "@types/sinon": "17.0.4", + "cross-env": "7.0.3", "mysql": "2.18.1", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -40999,6 +41011,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/semver": "7.5.8", + "cross-env": "7.0.3", "mysql2": "3.11.5", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -41351,6 +41364,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/tedious": "^4.0.14", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "semver": "7.7.2", diff --git a/packages/instrumentation-amqplib/package.json b/packages/instrumentation-amqplib/package.json index 3107436d25..6d49a6a5f9 100644 --- a/packages/instrumentation-amqplib/package.json +++ b/packages/instrumentation-amqplib/package.json @@ -64,6 +64,7 @@ "@types/node": "18.18.14", "@types/sinon": "17.0.4", "amqplib": "0.8.0", + "cross-env": "7.0.3", "expect": "29.2.0", "lodash": "4.17.21", "nyc": "17.1.0", diff --git a/packages/instrumentation-cassandra-driver/package.json b/packages/instrumentation-cassandra-driver/package.json index 8af3287486..c34d016676 100644 --- a/packages/instrumentation-cassandra-driver/package.json +++ b/packages/instrumentation-cassandra-driver/package.json @@ -63,6 +63,7 @@ "@types/semver": "7.5.8", "@types/sinon": "17.0.4", "cassandra-driver": "4.6.4", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "sinon": "15.2.0", diff --git a/packages/instrumentation-mongodb/package.json b/packages/instrumentation-mongodb/package.json index c947955230..a1689fa393 100644 --- a/packages/instrumentation-mongodb/package.json +++ b/packages/instrumentation-mongodb/package.json @@ -64,6 +64,7 @@ "@types/bson": "4.0.5", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "mongodb": "6.15.0", "nyc": "17.1.0", "rimraf": "5.0.10", diff --git a/packages/instrumentation-mongoose/package.json b/packages/instrumentation-mongoose/package.json index 49e4aeb465..91ce14d9af 100644 --- a/packages/instrumentation-mongoose/package.json +++ b/packages/instrumentation-mongoose/package.json @@ -59,6 +59,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "expect": "29.2.0", "mongoose": "6.13.8", "nyc": "17.1.0", diff --git a/packages/instrumentation-mysql/package.json b/packages/instrumentation-mysql/package.json index e354a7712f..0c9a46b8ce 100644 --- a/packages/instrumentation-mysql/package.json +++ b/packages/instrumentation-mysql/package.json @@ -57,6 +57,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/sinon": "17.0.4", + "cross-env": "7.0.3", "mysql": "2.18.1", "nyc": "17.1.0", "rimraf": "5.0.10", diff --git a/packages/instrumentation-mysql2/package.json b/packages/instrumentation-mysql2/package.json index c728964d28..2b6da46b80 100644 --- a/packages/instrumentation-mysql2/package.json +++ b/packages/instrumentation-mysql2/package.json @@ -58,6 +58,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/semver": "7.5.8", + "cross-env": "7.0.3", "mysql2": "3.11.5", "nyc": "17.1.0", "rimraf": "5.0.10", diff --git a/packages/instrumentation-tedious/package.json b/packages/instrumentation-tedious/package.json index 544a5fbdc3..b4a16d8627 100644 --- a/packages/instrumentation-tedious/package.json +++ b/packages/instrumentation-tedious/package.json @@ -60,6 +60,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "semver": "7.7.2", From 7d7d919e492c05a0d8510ca5fd12c87a558755d9 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 18:01:17 +0200 Subject: [PATCH 10/15] chore: remove unused test utils for docker --- packages/contrib-test-utils/src/index.ts | 2 - packages/contrib-test-utils/src/test-utils.ts | 57 ------------------- .../test/cassandra-driver.test.ts | 1 - .../test/index.test.ts | 1 - packages/instrumentation-pg/test/pg.test.ts | 13 +---- .../test/v4/redis.test.ts | 1 - 6 files changed, 2 insertions(+), 73 deletions(-) diff --git a/packages/contrib-test-utils/src/index.ts b/packages/contrib-test-utils/src/index.ts index 6853e6970c..005d2c9f1a 100644 --- a/packages/contrib-test-utils/src/index.ts +++ b/packages/contrib-test-utils/src/index.ts @@ -34,10 +34,8 @@ export type { TestSpan, RunTestFixtureOptions } from './test-fixtures'; export { assertPropagation, assertSpan, - cleanUpDocker, getPackageVersion, initMeterProvider, - startDocker, TestMetricReader, } from './test-utils'; export type { TimedEvent } from './test-utils'; diff --git a/packages/contrib-test-utils/src/test-utils.ts b/packages/contrib-test-utils/src/test-utils.ts index fdcc0b6e4a..56a9bafbe5 100644 --- a/packages/contrib-test-utils/src/test-utils.ts +++ b/packages/contrib-test-utils/src/test-utils.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import * as childProcess from 'child_process'; import { HrTime, Span, @@ -33,62 +32,6 @@ import * as path from 'path'; import * as fs from 'fs'; import { InstrumentationBase } from '@opentelemetry/instrumentation'; -const dockerRunCmds = { - cassandra: - 'docker run --rm -d --name otel-cassandra -p 9042:9042 bitnami/cassandra:3', - memcached: - 'docker run --rm -d --name otel-memcached -p 11211:11211 memcached:1.6.9-alpine', - mssql: - 'docker run --rm -d --name otel-mssql -p 1433:1433 -e MSSQL_SA_PASSWORD=mssql_passw0rd -e ACCEPT_EULA=Y mcr.microsoft.com/mssql/server:2022-latest', - mysql: - 'docker run --rm -d --name otel-mysql -p 33306:3306 -e MYSQL_ROOT_PASSWORD=rootpw -e MYSQL_DATABASE=test_db -e MYSQL_USER=otel -e MYSQL_PASSWORD=secret mysql:5.7 --log_output=TABLE --general_log=ON', - oracledb: - 'docker run --rm -d --name otel-oracledb -p 1521:1521 -e ORACLE_PASSWORD=oracle -e APP_USER=otel -e APP_USER_PASSWORD=secret gvenzl/oracle-free:slim', - postgres: - 'docker run --rm -d --name otel-postgres -p 54320:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=otel_pg_database postgres:16-alpine', - redis: 'docker run --rm -d --name otel-redis -p 63790:6379 redis:alpine', -}; - -export function startDocker(db: keyof typeof dockerRunCmds) { - const tasks = [run(dockerRunCmds[db])]; - - for (let i = 0; i < tasks.length; i++) { - const task = tasks[i]; - if (task && task.code !== 0) { - console.error('Failed to start container!'); - console.error(task.output); - return false; - } - } - return true; -} - -export function cleanUpDocker(db: keyof typeof dockerRunCmds) { - run(`docker stop otel-${db}`); -} - -function run(cmd: string) { - try { - const proc = childProcess.spawnSync(cmd, { - shell: true, - }); - const output = Buffer.concat( - proc.output.filter(c => c) as Buffer[] - ).toString('utf8'); - if (proc.status !== 0) { - console.error('Failed run command:', cmd); - console.error(output); - } - return { - code: proc.status, - output, - }; - } catch (e) { - console.log(e); - return; - } -} - export const assertSpan = ( span: ReadableSpan, kind: SpanKind, diff --git a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts index aab605cdca..cba1436637 100644 --- a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts +++ b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts @@ -57,7 +57,6 @@ context.setGlobalContextManager(new AsyncLocalStorageContextManager()); const testCassandra = process.env.RUN_CASSANDRA_TESTS; const shouldTest = testCassandra; -const cassandraTimeoutMs = 60000; const cassandraContactPoint = process.env.CASSANDRA_HOST ? '127.0.0.1' : 'cassandra'; diff --git a/packages/instrumentation-memcached/test/index.test.ts b/packages/instrumentation-memcached/test/index.test.ts index 038b2b5d72..d898990502 100644 --- a/packages/instrumentation-memcached/test/index.test.ts +++ b/packages/instrumentation-memcached/test/index.test.ts @@ -23,7 +23,6 @@ import { } from '@opentelemetry/api'; import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; -import * as testUtils from '@opentelemetry/contrib-test-utils'; import { InMemorySpanExporter, SimpleSpanProcessor, diff --git a/packages/instrumentation-pg/test/pg.test.ts b/packages/instrumentation-pg/test/pg.test.ts index 267e0b968a..4e0aea874a 100644 --- a/packages/instrumentation-pg/test/pg.test.ts +++ b/packages/instrumentation-pg/test/pg.test.ts @@ -123,9 +123,8 @@ describe('pg', () => { }); const tracer = provider.getTracer('external'); - const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available - const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker - const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default) + const testPostgres = process.env.RUN_POSTGRES_TESTS; + const shouldTest = testPostgres; // Skips these tests if false (default) function getExecutedQueries() { return (client as any).queryQueue.push.args.flat() as (pg.Query & { @@ -145,10 +144,6 @@ describe('pg', () => { skip(); } - if (testPostgresLocally) { - testUtils.startDocker('postgres'); - } - instrumentation = new PgInstrumentation(); contextManager = new AsyncLocalStorageContextManager().enable(); @@ -162,10 +157,6 @@ describe('pg', () => { }); after(async () => { - if (testPostgresLocally) { - testUtils.cleanUpDocker('postgres'); - } - await client.end(); }); diff --git a/packages/instrumentation-redis/test/v4/redis.test.ts b/packages/instrumentation-redis/test/v4/redis.test.ts index 95166d207f..9b92d52f75 100644 --- a/packages/instrumentation-redis/test/v4/redis.test.ts +++ b/packages/instrumentation-redis/test/v4/redis.test.ts @@ -24,7 +24,6 @@ import type { MultiErrorReply } from '../../src/v4/internal-types'; import * as assert from 'assert'; import { redisTestConfig, redisTestUrl, shouldTest } from './utils'; -import * as testUtils from '@opentelemetry/contrib-test-utils'; const instrumentation = registerInstrumentationTesting( new RedisInstrumentation() From 188d6a19815db492ac2118df6ab9465c076b7744 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 9 Jul 2025 18:19:32 +0200 Subject: [PATCH 11/15] chore: update cassandra instr scripts --- packages/instrumentation-cassandra-driver/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/instrumentation-cassandra-driver/package.json b/packages/instrumentation-cassandra-driver/package.json index c34d016676..0b11ecea75 100644 --- a/packages/instrumentation-cassandra-driver/package.json +++ b/packages/instrumentation-cassandra-driver/package.json @@ -20,9 +20,7 @@ "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", - "//todo": "echo test all versions should be configured", - "test-all-versions": "tav", - "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", + "//todo": "echo \"add test-all-versions\"", "test-services:start": "cd ../.. && npm run test-services:start cassandra", "test-services:stop": "cd ../.. && npm run test-services:stop cassandra", "version:update": "node ../../scripts/version-update.js" From 76f9219708640dc75604bdb23f5fdc9e5045334c Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 23 Jul 2025 18:52:53 +0200 Subject: [PATCH 12/15] chore: cat file for debugging --- packages/instrumentation-pg/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/instrumentation-pg/package.json b/packages/instrumentation-pg/package.json index bd45cee654..f4f4e0d9f7 100644 --- a/packages/instrumentation-pg/package.json +++ b/packages/instrumentation-pg/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", - "test": "nyc mocha 'test/**/*.test.ts'", + "test": "cat test/pg-pool.test.ts nyc mocha 'test/**/*.test.ts'", "test:debug": "mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", From a3ac2f2ad60433179a85202a4739082bdcfbe280 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 23 Jul 2025 18:55:47 +0200 Subject: [PATCH 13/15] chore: fix conflicts with main --- packages/instrumentation-pg/package.json | 2 +- packages/instrumentation-pg/test/pg-pool.test.ts | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/instrumentation-pg/package.json b/packages/instrumentation-pg/package.json index 7d8f6611f2..b84e9fbd0b 100644 --- a/packages/instrumentation-pg/package.json +++ b/packages/instrumentation-pg/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", - "test": "cat test/pg-pool.test.ts nyc mocha 'test/**/*.test.ts'", + "test": "nyc mocha 'test/**/*.test.ts'", "test:debug": "mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", diff --git a/packages/instrumentation-pg/test/pg-pool.test.ts b/packages/instrumentation-pg/test/pg-pool.test.ts index fcb8f7e141..5c78ec4332 100644 --- a/packages/instrumentation-pg/test/pg-pool.test.ts +++ b/packages/instrumentation-pg/test/pg-pool.test.ts @@ -982,9 +982,8 @@ describe('pg semantic conventions env variable', () => { const provider = new BasicTracerProvider({ spanProcessors: [new SimpleSpanProcessor(memoryExporter)], }); - const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available - const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker - const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default) + const testPostgres = process.env.RUN_POSTGRES_TESTS; + const shouldTest = testPostgres; // Here we are `require`ing *before* the instrumentation is created below. // In *general* this is a potential instrumentation issue, but this works for // `pg-pool` instrumentation because it patches the `pgPool.prototype` @@ -1003,10 +1002,6 @@ describe('pg semantic conventions env variable', () => { if (!shouldTest) { skip(); } - - if (testPostgresLocally) { - testUtils.startDocker('postgres'); - } }); beforeEach(() => { @@ -1014,12 +1009,6 @@ describe('pg semantic conventions env variable', () => { context.setGlobalContextManager(contextManager); }); - after(() => { - if (testPostgresLocally) { - testUtils.cleanUpDocker('postgres'); - } - }); - afterEach(() => { delete process.env.OTEL_SEMCONV_STABILITY_OPT_IN; memoryExporter.reset(); From bb454f516ea621bfca0e066ff620fee91189520d Mon Sep 17 00:00:00 2001 From: David Luna Date: Thu, 31 Jul 2025 08:34:17 +0200 Subject: [PATCH 14/15] chore: revert instr-wiston test scripts to use the one from main --- packages/instrumentation-winston/package.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/instrumentation-winston/package.json b/packages/instrumentation-winston/package.json index 8e8a0e24af..71d179b048 100644 --- a/packages/instrumentation-winston/package.json +++ b/packages/instrumentation-winston/package.json @@ -17,11 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "tdd": "npm run test-run -- --watch-extensions ts --watch", - "test": "npm run test-v1-v2 && npm run test-v3 && nyc merge .nyc_output ./coverage/coverage-final.json", - "test-v1-v2": "tav winston 2.4.7 npm run test-run", - "test-v3": "npm run test-run", - "test-run": "nyc --no-clean mocha 'test/**/*.test.ts'", + "test": "nyc mocha 'test/**/*.test.ts'", "test-all-versions": "tav", "version:update": "node ../../scripts/version-update.js" }, From 8c2783d69a6d4e6601c4bba31c0e9867f040c6af Mon Sep 17 00:00:00 2001 From: David Luna Date: Thu, 31 Jul 2025 08:39:00 +0200 Subject: [PATCH 15/15] chore: remove env file in mysql2 instr --- packages/instrumentation-mysql2/env | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/instrumentation-mysql2/env diff --git a/packages/instrumentation-mysql2/env b/packages/instrumentation-mysql2/env deleted file mode 100644 index 5c3993ada9..0000000000 --- a/packages/instrumentation-mysql2/env +++ /dev/null @@ -1,5 +0,0 @@ -export MYSQL_DATABASE=otel_mysql_database -export MYSQL_HOST=mysql -export MYSQL_PASSWORD=secret -export MYSQL_PORT=3306 -export MYSQL_USER=otel \ No newline at end of file