From 6467a1842ca07619c2333433fd3c30c1bd711780 Mon Sep 17 00:00:00 2001 From: David Luna Date: Thu, 4 Sep 2025 19:47:26 +0200 Subject: [PATCH 1/3] fix: fix test-all-versions script --- package.json | 5 +++-- packages/instrumentation-aws-sdk/package.json | 1 + packages/instrumentation-cucumber/package.json | 3 ++- packages/instrumentation-ioredis/package.json | 1 + packages/instrumentation-mongoose/package.json | 3 ++- packages/instrumentation-pg/package.json | 3 ++- packages/instrumentation-redis/package.json | 1 + 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d6ee54c9a0..f80f605033 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,13 @@ "version:update": "nx run-many -t version:update", "compile": "nx run-many -t compile", "compile:ci:affected": "nx affected -t compile", + "list:affected": "nx affected -t test-all-versions --graph=stdout | jq -c '.tasks.tasks[].target.project'", "test": "nx run-many -t test", "test:ci:affected": "nx affected -t test", "test:browser": "nx run-many -t test:browser", "test:browser:ci:affected": "nx affected -t test:browser", - "test-all-versions": "nx run-many --parallel=false -t test-all-versions", - "test-all-versions:ci:affected": "nx affected --parallel=false -t test-all-versions", + "test-all-versions": "npm run --if-present test-all-versions --workspaces", + "test-all-versions:ci:affected": "npm run list:affected | tail -n +5 | xargs -I {} -t npm run --if-present test-all-versions -w {}", "test-merge-coverage:ci:affected": "nx affected -t test-merge-coverage", "test-services:start": "docker compose -f ./test/docker-compose.yaml up -d --wait", "test-services:stop": "docker compose -f ./test/docker-compose.yaml down", diff --git a/packages/instrumentation-aws-sdk/package.json b/packages/instrumentation-aws-sdk/package.json index 4fb923c096..a886bddefd 100644 --- a/packages/instrumentation-aws-sdk/package.json +++ b/packages/instrumentation-aws-sdk/package.json @@ -41,6 +41,7 @@ "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", "test-all-versions": "tav", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, diff --git a/packages/instrumentation-cucumber/package.json b/packages/instrumentation-cucumber/package.json index dff0e1cc7a..a277456d10 100644 --- a/packages/instrumentation-cucumber/package.json +++ b/packages/instrumentation-cucumber/package.json @@ -10,8 +10,9 @@ "directory": "packages/instrumentation-cucumber" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", "test-all-versions": "tav", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", "lint": "eslint . --ext=ts,js,mjs", diff --git a/packages/instrumentation-ioredis/package.json b/packages/instrumentation-ioredis/package.json index c11c8c6f82..789f65cbb5 100644 --- a/packages/instrumentation-ioredis/package.json +++ b/packages/instrumentation-ioredis/package.json @@ -19,6 +19,7 @@ "prepublishOnly": "npm run compile", "test": "nyc --no-clean mocha 'test/**/*.test.ts'", "test-all-versions": "tav", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "tdd": "npm run test -- --watch-extensions ts --watch", "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", diff --git a/packages/instrumentation-mongoose/package.json b/packages/instrumentation-mongoose/package.json index f7fae2afb9..8eb6fa9fb1 100644 --- a/packages/instrumentation-mongoose/package.json +++ b/packages/instrumentation-mongoose/package.json @@ -22,8 +22,9 @@ "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": "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-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "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" diff --git a/packages/instrumentation-pg/package.json b/packages/instrumentation-pg/package.json index edf131cae7..3c1ae1c1c4 100644 --- a/packages/instrumentation-pg/package.json +++ b/packages/instrumentation-pg/package.json @@ -18,11 +18,12 @@ "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": "nyc --no-clean 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", "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-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "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", diff --git a/packages/instrumentation-redis/package.json b/packages/instrumentation-redis/package.json index 7b2ceb349a..d5c1f37f93 100644 --- a/packages/instrumentation-redis/package.json +++ b/packages/instrumentation-redis/package.json @@ -24,6 +24,7 @@ "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-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "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" From 8a90ea46ca721ed85c4fff4ee38767fe3ce5d66b Mon Sep 17 00:00:00 2001 From: David Luna Date: Thu, 4 Sep 2025 20:13:21 +0200 Subject: [PATCH 2/3] chore: leftovers in test workflow --- .github/workflows/test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c53bdcc73b..0b9346c05d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,9 +64,6 @@ jobs: - "20" - "22" - "24" - include: - - node: 18 - code-coverage: true runs-on: ubuntu-latest services: memcached: @@ -273,6 +270,11 @@ jobs: with: name: tests-coverage-cache-${{ github.run_number }}-22 path: . + - name: Download Test Artifacts (24) + uses: actions/download-artifact@v5 + with: + name: tests-coverage-cache-${{ github.run_number }}-24 + path: . # Note: see comment in the compile job - name: Set base and head commits run: | From 3bc55386fc72437cdb36ea6e7c17902a25a295fd Mon Sep 17 00:00:00 2001 From: David Luna Date: Thu, 4 Sep 2025 21:30:32 +0200 Subject: [PATCH 3/3] chore: add mssing flags to avoid cleanup of coverage --- packages/instrumentation-aws-sdk/package.json | 2 +- packages/instrumentation-redis/package.json | 4 ++-- packages/instrumentation-winston/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/instrumentation-aws-sdk/package.json b/packages/instrumentation-aws-sdk/package.json index a886bddefd..ac9d0ff7bc 100644 --- a/packages/instrumentation-aws-sdk/package.json +++ b/packages/instrumentation-aws-sdk/package.json @@ -39,7 +39,7 @@ "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": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", "test-all-versions": "tav", "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "version:update": "node ../../scripts/version-update.js", diff --git a/packages/instrumentation-redis/package.json b/packages/instrumentation-redis/package.json index d5c1f37f93..80ca55d575 100644 --- a/packages/instrumentation-redis/package.json +++ b/packages/instrumentation-redis/package.json @@ -18,8 +18,8 @@ "lint:readme": "node ../../scripts/lint-readme.js", "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-v5/*.test.ts'", + "test-v2-v3": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/v2-v3/*.test.ts'", + "test": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/v4-v5/*.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", diff --git a/packages/instrumentation-winston/package.json b/packages/instrumentation-winston/package.json index cf5f185786..bd0c998391 100644 --- a/packages/instrumentation-winston/package.json +++ b/packages/instrumentation-winston/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext=ts,js,mjs --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "test": "nyc mocha 'test/**/*.test.ts'", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", "test-all-versions": "tav", "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "version:update": "node ../../scripts/version-update.js"