diff --git a/.github/workflows/unit-test.yml b/.github/workflows/pr-test.yml similarity index 69% rename from .github/workflows/unit-test.yml rename to .github/workflows/pr-test.yml index 7c571d2d6d..f8ae364aae 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/pr-test.yml @@ -1,14 +1,14 @@ -name: Unit Tests +name: Pull Request Tests on: - push: - branches: [main] pull_request: + # TODO: remove it + branches: [main] permissions: contents: read jobs: - build-and-cache: + compile: strategy: fail-fast: false runs-on: ubuntu-latest @@ -26,19 +26,20 @@ jobs: node-version: 18 - name: Install run: npm ci - - name: Build - run: npm run compile + # TODO: check if compiling only the affected modules is correct + - name: Compile (Delta) + run: npm run compile:ci:affected - name: Upload Build Artifacts uses: actions/upload-artifact@v4 with: - name: tests-build-cache-${{ github.run_number }} + name: compile-cache-${{ github.run_number }} path: .nx include-hidden-files: true if-no-files-found: error retention-days: 1 unit-test: - needs: build-and-cache + needs: compile strategy: fail-fast: false matrix: @@ -48,9 +49,6 @@ jobs: - "20.6.0" - "20" - "22" - include: - - node: 18 - code-coverage: true runs-on: ubuntu-latest services: memcached: @@ -184,26 +182,27 @@ jobs: - name: Download Build Artifacts uses: actions/download-artifact@v4 with: - name: tests-build-cache-${{ github.run_number }} + name: compile-cache-${{ github.run_number }} path: .nx - - name: Build - run: npm run compile - - name: Unit tests (Full) - if: matrix.code-coverage - run: npm run test + - name: Compile (Delta) + run: npm run compile:ci:affected - name: Unit tests (Delta) - if: ${{ !matrix.code-coverage }} - run: npm run test:ci:changed - - name: Report Coverage - if: ${{ matrix.code-coverage && !cancelled()}} - uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: npm run test:ci:affected + - name: Test All Versions (Delta) + run: npm run test-all-versions:ci:affected + - name: Upload Test Artifacts + uses: actions/upload-artifact@v4 with: - verbose: true + name: tests-coverage-cache-${{ github.run_number }}-${{ matrix.node }} + include-hidden-files: true + if-no-files-found: error + retention-days: 1 + path: | + !node_modules + **/.nyc_output/** browser-test: - needs: build-and-cache + needs: compile strategy: fail-fast: false matrix: @@ -225,7 +224,7 @@ jobs: - name: Download Build Artifacts uses: actions/download-artifact@v4 with: - name: tests-build-cache-${{ github.run_number }} + name: compile-cache-${{ github.run_number }} path: .nx - name: Build run: npm run compile @@ -237,3 +236,56 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: verbose: true + + test-coverage-report: + runs-on: ubuntu-latest + needs: unit-test + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Install + run: npm ci + # NOTE: keep this in sync with the node versions from `unit-test` job + # TODO: doownload browser coverage + - name: Download Test Artifacts (18) + uses: actions/download-artifact@v4 + with: + name: tests-coverage-cache-${{ github.run_number }}-18 + path: . + - name: Download Test Artifacts (18.19.0) + uses: actions/download-artifact@v4 + with: + name: tests-coverage-cache-${{ github.run_number }}-18.19.0 + path: . + - name: Download Test Artifacts (20) + uses: actions/download-artifact@v4 + with: + name: tests-coverage-cache-${{ github.run_number }}-20 + path: . + - name: Download Test Artifacts (20.6.0) + uses: actions/download-artifact@v4 + with: + name: tests-coverage-cache-${{ github.run_number }}-20.6.0 + path: . + - name: Download Test Artifacts (22) + uses: actions/download-artifact@v4 + with: + name: tests-coverage-cache-${{ github.run_number }}-22 + path: . + - name: Merge coverage (Delta) + run: npm run coverage:merge:ci:affected + - name: Check coverage + run: find . | grep coverage-final + + - name: Report Coverage + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + verbose: true + dry_run: true diff --git a/.github/workflows/test-all-versions.pr.yml b/.github/workflows/test-all-versions.pr.yml deleted file mode 100644 index 8b213f6d70..0000000000 --- a/.github/workflows/test-all-versions.pr.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: TAV for PR -on: - pull_request: - types: - - opened - - synchronize - - reopened - - labeled - - unlabeled - -permissions: - contents: read - -jobs: - parse-labels: - runs-on: ubuntu-latest - container: - image: node:20 - env: - PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }} - outputs: - args: ${{ steps.npm-workspace-args.outputs.args }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Parse labels into npm workspace arguments - id: npm-workspace-args - run: | - OUTPUT=`node scripts/pr-labels-to-npm-workspace-args.mjs "$PR_LABELS"` - echo "args=$OUTPUT" >> $GITHUB_OUTPUT - - tav: - uses: ./.github/workflows/test-all-versions.yml - needs: parse-labels - with: - npm-workspace-args: ${{ needs.parse-labels.outputs.args }} - if: ${{ needs.parse-labels.outputs.args != '' }} diff --git a/codecov.yml b/codecov.yml index 1beb17b8de..e0f5e96dae 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,15 +1,278 @@ codecov: notify: - require_ci_to_pass: no + after_n_builds: 1 + require_ci_to_pass: no comment: - layout: "header, changes, diff, files" + layout: 'header, changes, diff, files' behavior: default -coverage: - status: - patch: - default: - target: 80% - project: - default: - target: auto - threshold: 1% +# We set the flags manually to have better control of it +# ref: https://docs.codecov.com/docs/flags#advanced-bespoke-flag-management +flags: + winston-transport: + paths: + - packages/winston-transport/ + carryforward: true + contrib-test-utils: + paths: + - packages/opentelemetry-test-utils/ + carryforward: true + sql-common: + paths: + - packages/opentelemetry-sql-common/ + carryforward: true + redis-common: + paths: + - packages/opentelemetry-redis-common/ + carryforward: true + propagation-utils: + paths: + - packages/opentelemetry-propagation-utils/ + carryforward: true + id-generator-aws-xray: + paths: + - packages/opentelemetry-id-generator-aws-xray/ + carryforward: true + host-metrics: + paths: + - packages/opentelemetry-host-metrics/ + carryforward: true + baggage-span-processor: + paths: + - packages/baggage-span-processor/ + carryforward: true + baggage-log-record-processor: + paths: + - packages/baggage-log-record-processor/ + carryforward: true + instrumentation-winston: + paths: + - packages/instrumentation-winston/ + carryforward: true + instrumentation-router: + paths: + - packages/instrumentation-router/ + carryforward: true + instrumentation-restify: + paths: + - packages/instrumentation-restify/ + carryforward: true + instrumentation-redis-4: + paths: + - packages/instrumentation-redis-4/ + carryforward: true + instrumentation-redis: + paths: + - packages/instrumentation-redis/ + carryforward: true + instrumentation-pino: + paths: + - packages/instrumentation-pino/ + carryforward: true + instrumentation-pg: + paths: + - packages/instrumentation-pg/ + carryforward: true + instrumentation-oracledb: + paths: + - packages/instrumentation-oracledb/ + carryforward: true + instrumentation-net: + paths: + - packages/instrumentation-net/ + carryforward: true + instrumentation-nestjs-core: + paths: + - packages/instrumentation-nestjs-core/ + carryforward: true + instrumentation-mysql2: + paths: + - packages/instrumentation-mysql2/ + carryforward: true + instrumentation-mysql: + paths: + - packages/instrumentation-mysql/ + carryforward: true + instrumentation-mongodb: + paths: + - packages/instrumentation-mongodb/ + carryforward: true + instrumentation-memcached: + paths: + - packages/instrumentation-memcached/ + carryforward: true + instrumentation-koa: + paths: + - packages/instrumentation-koa/ + carryforward: true + instrumentation-knex: + paths: + - packages/instrumentation-knex/ + carryforward: true + instrumentation-ioredis: + paths: + - packages/instrumentation-ioredis/ + carryforward: true + instrumentation-hapi: + paths: + - packages/instrumentation-hapi/ + carryforward: true + instrumentation-graphql: + paths: + - packages/instrumentation-graphql/ + carryforward: true + instrumentation-generic-pool: + paths: + - packages/instrumentation-generic-pool/ + carryforward: true + instrumentation-fastify: + paths: + - packages/instrumentation-fastify/ + carryforward: true + instrumentation-express: + paths: + - packages/instrumentation-express/ + carryforward: true + instrumentation-dns: + paths: + - packages/instrumentation-dns/ + carryforward: true + instrumentation-connect: + paths: + - packages/instrumentation-connect/ + carryforward: true + instrumentation-cassandra-driver: + paths: + - packages/instrumentation-cassandra/ + carryforward: true + instrumentation-bunyan: + paths: + - packages/instrumentation-bunyan/ + carryforward: true + instrumentation-aws-sdk: + paths: + - packages/instrumentation-aws-sdk/ + carryforward: true + instrumentation-aws-lambda: + paths: + - packages/instrumentation-aws-lambda/ + carryforward: true + instrumentation-undici: + paths: + - packages/instrumentation-undici/ + carryforward: true + instrumentation-typeorm: + paths: + - packages/instrumentation-typeorm/ + carryforward: true + instrumentation-tedious: + paths: + - packages/instrumentation-tedious/ + carryforward: true + instrumentation-socket.io: + paths: + - packages/instrumentation-socket.io/ + carryforward: true + instrumentation-runtime-node: + paths: + - packages/instrumentation-runtime-node/ + carryforward: true + instrumentation-mongoose: + paths: + - packages/instrumentation-mongoose/ + carryforward: true + instrumentation-lru-memoizer: + paths: + - packages/instrumentation-lru-memoizer/ + carryforward: true + instrumentation-kafkajs: + paths: + - packages/instrumentation-kafkajs/ + carryforward: true + instrumentation-fs: + paths: + - packages/instrumentation-fs/ + carryforward: true + instrumentation-dataloader: + paths: + - packages/instrumentation-dataloader/ + carryforward: true + instrumentation-cucumber: + paths: + - packages/instrumentation-cucumber/ + carryforward: true + instrumentation-amqplib: + paths: + - packages/instrumentation-amqplib/ + carryforward: true + plugin-react-load: + paths: + - packages/plugin-react-load/ + carryforward: true + instrumentation-user-interaction: + paths: + - packages/instrumentation-user-interaction/ + carryforward: true + instrumentation-long-task: + paths: + - packages/instrumentation-long-task/ + carryforward: true + instrumentation-document-load: + paths: + - packages/instrumentation-document-load/ + carryforward: true + propagator-aws-xray-lambda: + paths: + - packages/propagator-aws-xray-lambda/ + carryforward: true + propagator-aws-xray: + paths: + - packages/propagator-aws-xray/ + carryforward: true + propagator-ot-trace: + paths: + - packages/opentelemetry-propagator-ot-trace/ + carryforward: true + propagator-instana: + paths: + - packages/opentelemetry-propagator-instana/ + carryforward: true + resource-detector-instana: + paths: + - packages/resource-detector-instana/ + carryforward: true + resource-detector-github: + paths: + - packages/resource-detector-github/ + carryforward: true + resource-detector-gcp: + paths: + - packages/resource-detector-gcp/ + carryforward: true + resource-detector-container: + paths: + - packages/resource-detector-container/ + carryforward: true + resource-detector-azure: + paths: + - packages/resource-detector-azure/ + carryforward: true + resource-detector-aws: + paths: + - packages/resource-detector-aws/ + carryforward: true + resource-detector-alibaba-cloud: + paths: + - packages/resource-detector-alibaba-cloud/ + carryforward: true + auto-instrumentations-web: + paths: + - packages/auto-instrumentations-web/ + carryforward: true + auto-instrumentations-node: + paths: + - packages/auto-instrumentations-node/ + carryforward: true + auto-configuration-propagators: + paths: + - packages/auto-configuration-packages/ + carryforward: true diff --git a/package.json b/package.json index 72f46b91f8..4d2348ee89 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,14 @@ "clean": "nx run-many -t clean", "version:update": "nx run-many -t version:update", "compile": "nx run-many -t compile", + "compile:ci:affected": "nx affected -t compile --base=origin/main --head=HEAD", "test": "nx run-many -t test", + "test:ci:affected": "nx affected -t test --base=origin/main --head=HEAD", "test:browser": "nx run-many -t test:browser", - "test:ci:changed": "nx affected -t test --base=origin/main --head=HEAD", + "test:browser:ci:affected": "nx affected -t test:browser --base=origin/main --head=HEAD", "test-all-versions": "nx run-many -t test-all-versions", + "test-all-versions:ci:affected": "nx affected -t test-all-versions --base=origin/main --head=HEAD", + "coverage:merge:ci:affected": "nx affected -t coverage:merge --base=origin/main --head=HEAD", "test-services:start": "docker compose -f ./test/docker-compose.yaml up -d --wait", "test-services:stop": "docker compose -f ./test/docker-compose.yaml down", "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-amqplib/package.json b/packages/instrumentation-amqplib/package.json index 9d4394fa9a..46ce856634 100644 --- a/packages/instrumentation-amqplib/package.json +++ b/packages/instrumentation-amqplib/package.json @@ -38,10 +38,11 @@ "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: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 rabbitmq", "test-services:stop": "cd ../.. && npm run test-services:stop rabbitmq", "version:update": "node ../../scripts/version-update.js", diff --git a/packages/instrumentation-aws-lambda/package.json b/packages/instrumentation-aws-lambda/package.json index 908e795aae..55478df52e 100644 --- a/packages/instrumentation-aws-lambda/package.json +++ b/packages/instrumentation-aws-lambda/package.json @@ -10,16 +10,17 @@ "directory": "packages/instrumentation-aws-lambda" }, "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-aws-lambda", "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-aws-lambda", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "aws-lambda", diff --git a/packages/instrumentation-bunyan/package.json b/packages/instrumentation-bunyan/package.json index 286f536493..391eab5f48 100644 --- a/packages/instrumentation-bunyan/package.json +++ b/packages/instrumentation-bunyan/package.json @@ -11,14 +11,15 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-bunyan", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-bunyan", "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": "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" }, "keywords": [ diff --git a/packages/instrumentation-cassandra-driver/package.json b/packages/instrumentation-cassandra-driver/package.json index 38b0325d4f..092f67bfe8 100644 --- a/packages/instrumentation-cassandra-driver/package.json +++ b/packages/instrumentation-cassandra-driver/package.json @@ -17,10 +17,12 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", + "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-cassandra-driver", "tdd": "npm run test -- --watch-extensions ts --watch", - "test": "nyc mocha 'test/**/*.test.ts'", + "test": "nyc --no-clean 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-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "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" diff --git a/packages/instrumentation-connect/package.json b/packages/instrumentation-connect/package.json index 5ac4985ac8..687d95550a 100644 --- a/packages/instrumentation-connect/package.json +++ b/packages/instrumentation-connect/package.json @@ -17,7 +17,8 @@ "lint:fix": "eslint . --ext .ts --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-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-dataloader/package.json b/packages/instrumentation-dataloader/package.json index e134de1937..e582dfcad3 100644 --- a/packages/instrumentation-dataloader/package.json +++ b/packages/instrumentation-dataloader/package.json @@ -17,8 +17,9 @@ "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": "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" }, "keywords": [ diff --git a/packages/instrumentation-dns/package.json b/packages/instrumentation-dns/package.json index 6d523d5298..02c76ee053 100644 --- a/packages/instrumentation-dns/package.json +++ b/packages/instrumentation-dns/package.json @@ -10,16 +10,17 @@ "directory": "packages/instrumentation-dns" }, "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-dns", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", "lint:readme": "node ../../scripts/lint-readme", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-dns", - "compile": "tsc -p ." + "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "dns", diff --git a/packages/instrumentation-express/package.json b/packages/instrumentation-express/package.json index a87a98d046..1c54ccf5b5 100644 --- a/packages/instrumentation-express/package.json +++ b/packages/instrumentation-express/package.json @@ -10,17 +10,18 @@ "directory": "packages/instrumentation-express" }, "scripts": { - "test-all-versions": "tav", - "test": "nyc mocha 'test/**/*.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-express", "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-express", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "yarn test -- --watch-extensions ts --watch", + "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", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-fastify/package.json b/packages/instrumentation-fastify/package.json index 86a5150fc5..448e11115c 100644 --- a/packages/instrumentation-fastify/package.json +++ b/packages/instrumentation-fastify/package.json @@ -17,8 +17,9 @@ "lint:fix": "eslint . --ext .ts --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", "watch": "tsc -w" }, diff --git a/packages/instrumentation-fs/package.json b/packages/instrumentation-fs/package.json index a7bb853e3e..2dd93920ca 100644 --- a/packages/instrumentation-fs/package.json +++ b/packages/instrumentation-fs/package.json @@ -10,7 +10,7 @@ "directory": "packages/instrumentation-fs" }, "scripts": { - "test": "mocha 'test/**/*.test.ts'", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-generic-pool/package.json b/packages/instrumentation-generic-pool/package.json index ad5790ec33..1efcff7908 100644 --- a/packages/instrumentation-generic-pool/package.json +++ b/packages/instrumentation-generic-pool/package.json @@ -10,16 +10,17 @@ "directory": "packages/instrumentation-generic-pool" }, "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-generic-pool", "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-generic-pool", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "yarn test -- --watch-extensions ts --watch", + "test": "nyc --no-clean mocha 'test/**/*.ts'", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-graphql/package.json b/packages/instrumentation-graphql/package.json index ac801514ef..f0c965b8cd 100644 --- a/packages/instrumentation-graphql/package.json +++ b/packages/instrumentation-graphql/package.json @@ -11,15 +11,16 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-graphql", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-graphql", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "test": "nyc mocha 'test/**/*.test.ts'", - "test-all-versions": "tav", "tdd": "npm run test -- --watch-extensions ts --watch", + "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", "watch": "tsc -w" }, diff --git a/packages/instrumentation-hapi/package.json b/packages/instrumentation-hapi/package.json index 6552191482..278c35cdf1 100644 --- a/packages/instrumentation-hapi/package.json +++ b/packages/instrumentation-hapi/package.json @@ -10,17 +10,18 @@ "directory": "packages/instrumentation-hapi" }, "scripts": { - "test": "nyc mocha 'test/**/*.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-hapi", "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-hapi", - "compile": "tsc -p .", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "tdd": "npm test -- --watch-extensions ts --watch", + "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" }, "keywords": [ "hapi", diff --git a/packages/instrumentation-ioredis/package.json b/packages/instrumentation-ioredis/package.json index 0cfe63e1eb..09630f29e9 100644 --- a/packages/instrumentation-ioredis/package.json +++ b/packages/instrumentation-ioredis/package.json @@ -17,11 +17,11 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", + "test-all-versions": "tav", "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", diff --git a/packages/instrumentation-kafkajs/package.json b/packages/instrumentation-kafkajs/package.json index a113a24031..5996449536 100644 --- a/packages/instrumentation-kafkajs/package.json +++ b/packages/instrumentation-kafkajs/package.json @@ -10,17 +10,18 @@ "directory": "packages/instrumentation-kafkajs" }, "scripts": { - "test": "nyc 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-kafkajs", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-kafkajs", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "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" }, "keywords": [ "kafkajs", diff --git a/packages/instrumentation-knex/package.json b/packages/instrumentation-knex/package.json index 206f6ebc1a..8f3505d366 100644 --- a/packages/instrumentation-knex/package.json +++ b/packages/instrumentation-knex/package.json @@ -19,6 +19,7 @@ "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.ts'", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "//todo": "echo \"add test-all-versions\"", "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" diff --git a/packages/instrumentation-koa/package.json b/packages/instrumentation-koa/package.json index c160c42c5b..f29bef89c4 100644 --- a/packages/instrumentation-koa/package.json +++ b/packages/instrumentation-koa/package.json @@ -18,8 +18,9 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", - "test": "nyc mocha 'test/**/*.ts'", + "test": "nyc --no-clean mocha '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-lru-memoizer/package.json b/packages/instrumentation-lru-memoizer/package.json index d2a81ca88f..f4a92e51f3 100644 --- a/packages/instrumentation-lru-memoizer/package.json +++ b/packages/instrumentation-lru-memoizer/package.json @@ -18,8 +18,9 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", - "test": "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" }, "keywords": [ diff --git a/packages/instrumentation-memcached/package.json b/packages/instrumentation-memcached/package.json index ed631d6dc5..bc76ead31f 100644 --- a/packages/instrumentation-memcached/package.json +++ b/packages/instrumentation-memcached/package.json @@ -20,6 +20,7 @@ "test": "nyc mocha 'test/**/*.test.ts'", "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", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "//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", diff --git a/packages/instrumentation-mongodb/package.json b/packages/instrumentation-mongodb/package.json index 843588c417..4942b6d969 100644 --- a/packages/instrumentation-mongodb/package.json +++ b/packages/instrumentation-mongodb/package.json @@ -26,6 +26,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 mongodb", "test-services:stop": "cd ../.. && npm run test-services:stop mongodb", "watch": "tsc -w" diff --git a/packages/instrumentation-mysql/package.json b/packages/instrumentation-mysql/package.json index cf50683cb2..da13891d8a 100644 --- a/packages/instrumentation-mysql/package.json +++ b/packages/instrumentation-mysql/package.json @@ -17,8 +17,9 @@ "lint": "eslint . --ext .ts", "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:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "//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", diff --git a/packages/instrumentation-mysql2/package.json b/packages/instrumentation-mysql2/package.json index b4f430f3d0..54a65c65a6 100644 --- a/packages/instrumentation-mysql2/package.json +++ b/packages/instrumentation-mysql2/package.json @@ -17,10 +17,11 @@ "lint": "eslint . --ext .ts", "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: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 mysql", "test-services:stop": "cd ../.. && npm run test-services:stop mysql", "version:update": "node ../../scripts/version-update.js" diff --git a/packages/instrumentation-nestjs-core/package.json b/packages/instrumentation-nestjs-core/package.json index 05c9cb36a5..3fa7216168 100644 --- a/packages/instrumentation-nestjs-core/package.json +++ b/packages/instrumentation-nestjs-core/package.json @@ -11,16 +11,17 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-nestjs-core", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-nestjs-core", "compile:watch": "tsc -w", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", - "test": "npm run test-required-node-version && nyc mocha --timeout 5000 'test/**/*.test.ts' || echo 'Node version is not supported for testing'", + "test": "npm run test-required-node-version && nyc --no-clean mocha --timeout 5000 'test/**/*.test.ts' || echo 'Node version is not supported for testing'", "test-required-node-version": "node -e \"process.exit(parseInt(process.versions.node.split('.')[0], 10) >= 15 ? 0 : 1)\"", "test-all-versions": "tav", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ diff --git a/packages/instrumentation-net/package.json b/packages/instrumentation-net/package.json index 8012941ad5..e13db7a628 100644 --- a/packages/instrumentation-net/package.json +++ b/packages/instrumentation-net/package.json @@ -10,7 +10,7 @@ "directory": "packages/instrumentation-net" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", "lint": "eslint . --ext .ts", @@ -18,8 +18,9 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", + "compile": "tsc -p .", "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-net", - "compile": "tsc -p ." + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json" }, "keywords": [ "connect", diff --git a/packages/instrumentation-oracledb/package.json b/packages/instrumentation-oracledb/package.json index 4576a38720..4da27704ec 100644 --- a/packages/instrumentation-oracledb/package.json +++ b/packages/instrumentation-oracledb/package.json @@ -11,19 +11,20 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-oracledb", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-oracledb", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prewatch": "npm run precompile", "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 oracledb", "test-services:stop": "cd ../.. && npm run test-services:stop oracledb", "version:update": "node ../../scripts/version-update.js", diff --git a/packages/instrumentation-pino/.tav.yml b/packages/instrumentation-pino/.tav.yml index 737cc73989..a2ff2d05fe 100644 --- a/packages/instrumentation-pino/.tav.yml +++ b/packages/instrumentation-pino/.tav.yml @@ -5,7 +5,16 @@ pino: node: ">=18" commands: npm run test - versions: - include: '>=5.14.0 <9' + include: '>=7.0.0 <9' mode: max-7 node: ">=14" commands: npm run test + - versions: + include: '>=5.14.0 <7' + mode: max-7 + node: ">=14" + peerDependencies: + - "fast-safe-stringify@2.1.1" + commands: + - npm ls -la + - npm run test diff --git a/packages/instrumentation-pino/package.json b/packages/instrumentation-pino/package.json index 17f98f43f7..62f7cac0cd 100644 --- a/packages/instrumentation-pino/package.json +++ b/packages/instrumentation-pino/package.json @@ -10,17 +10,18 @@ "directory": "packages/instrumentation-pino" }, "scripts": { - "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-pino", "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-pino", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "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" }, "keywords": [ "instrumentation", diff --git a/packages/instrumentation-restify/package.json b/packages/instrumentation-restify/package.json index 8e4217de21..eeb963a487 100644 --- a/packages/instrumentation-restify/package.json +++ b/packages/instrumentation-restify/package.json @@ -11,15 +11,16 @@ }, "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-restify", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-restify", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "tdd": "yarn test -- --watch-extensions ts --watch", - "test": "nyc mocha 'test/**/*.ts'", + "tdd": "npm test -- --watch-extensions ts --watch", + "test": "nyc --no-clean mocha '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-router/package.json b/packages/instrumentation-router/package.json index 71200635f7..f8e5d92862 100644 --- a/packages/instrumentation-router/package.json +++ b/packages/instrumentation-router/package.json @@ -10,16 +10,17 @@ "directory": "packages/instrumentation-router" }, "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-router", "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-router", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "npm test -- --watch-extensions ts --watch", + "test": "nyc --no-clean mocha 'test/**/*.ts'", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-runtime-node/package.json b/packages/instrumentation-runtime-node/package.json index ddfe1261ed..05e3964a42 100644 --- a/packages/instrumentation-runtime-node/package.json +++ b/packages/instrumentation-runtime-node/package.json @@ -12,12 +12,13 @@ "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-runtime-node#readme", "scripts": { "clean": "rimraf build/*", - "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-runtime-node", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-runtime-node", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", - "test": "nyc mocha 'test/**/*.test.ts'", + "test": "nyc --no-clean mocha 'test/**/*.test.ts'", + "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json", "version:update": "node ../../scripts/version-update.js" }, "author": "OpenTelemetry Authors", diff --git a/packages/instrumentation-socket.io/package.json b/packages/instrumentation-socket.io/package.json index a9eaf9fe67..8f97e6db9f 100644 --- a/packages/instrumentation-socket.io/package.json +++ b/packages/instrumentation-socket.io/package.json @@ -10,17 +10,18 @@ "directory": "packages/instrumentation-socket.io" }, "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-socket.io", "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-socket.io", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "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" }, "keywords": [ "socket.io", diff --git a/packages/instrumentation-tedious/package.json b/packages/instrumentation-tedious/package.json index 500ab8e30b..f74e1f18e1 100644 --- a/packages/instrumentation-tedious/package.json +++ b/packages/instrumentation-tedious/package.json @@ -17,10 +17,11 @@ "lint": "eslint . --ext .ts", "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: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 mssql", "test-services:stop": "cd ../.. && npm run test-services:stop mssql", "version:update": "node ../../scripts/version-update.js" diff --git a/packages/instrumentation-typeorm/package.json b/packages/instrumentation-typeorm/package.json index 68cc669b1c..0d1facb32f 100644 --- a/packages/instrumentation-typeorm/package.json +++ b/packages/instrumentation-typeorm/package.json @@ -19,9 +19,10 @@ "prewatch": "npm run precompile", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", - "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", - "test-all-versions": "tav", + "test": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", "test:debug": "mocha --inspect-brk --no-timeouts '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-undici/package.json b/packages/instrumentation-undici/package.json index fa219a7f0f..152ff6fc16 100644 --- a/packages/instrumentation-undici/package.json +++ b/packages/instrumentation-undici/package.json @@ -17,8 +17,9 @@ "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": "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", "watch": "tsc -w" }, diff --git a/packages/instrumentation-winston/package.json b/packages/instrumentation-winston/package.json index 71d179b048..f4f651094c 100644 --- a/packages/instrumentation-winston/package.json +++ b/packages/instrumentation-winston/package.json @@ -19,6 +19,7 @@ "prepublishOnly": "npm run compile", "test": "nyc 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" }, "keywords": [ diff --git a/scripts/codecov-upload-flags.mjs b/scripts/codecov-upload-flags.mjs new file mode 100644 index 0000000000..1420f559ec --- /dev/null +++ b/scripts/codecov-upload-flags.mjs @@ -0,0 +1,26 @@ +import path from 'path'; +import { readFileSync } from 'fs'; +import { globSync } from 'glob'; + +const readPkg = (dir) => JSON.parse(readFileSync(path.join(dir, 'package.json'), 'utf8')); + +const TOP = process.cwd(); +const pkgInfo = readPkg(TOP); +const pkgFiles = pkgInfo.workspaces.map((exp) => globSync(path.join(exp, 'package.json'))); +const pkgFlags = pkgFiles.flat().map((f) => { + const path = f.replace('package.json', ''); + const info = readPkg(path); + const name = info.name; + const flag = name.replace('@opentelemetry/', ''); + + return { name, flag, len: flag.length, path }; +}); + +// Print the flags +pkgFlags.forEach((pf) => { + console.log(` + ${pf.flag}: + paths: + - ${pf.path} + carryforward: true`) +}); \ No newline at end of file