Skip to content

Commit

Permalink
chore: update test-all-versions configs to test fewer package versions (
Browse files Browse the repository at this point in the history
#2464)

The TAV tests in CI are taking 2.5h - 3h, for a total usage of over 13h
compute time. E.g.: https://github.com/open-telemetry/opentelemetry-js-contrib/actions/runs/11233652488/usage

This change reduces the number of tested versions from 839 to 317
(for a TAV run with Node.js v20). For a few of the .tav.yml files the
tested version range was actually increased to capture some versions
that the instrumentation supported, but were not being tested by TAV.
trentm authored Oct 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ad560df commit 0341e89
Showing 33 changed files with 278 additions and 186 deletions.
148 changes: 123 additions & 25 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions plugins/node/instrumentation-amqplib/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'amqplib':
versions: ">=0.5.5"
amqplib:
versions:
include: ">=0.5.5"
mode: latest-minors
commands:
- yarn test
- npm test
8 changes: 6 additions & 2 deletions plugins/node/instrumentation-cucumber/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'@cucumber/cucumber':
- versions: '^8.0.0 || ^9.0.0'
- versions:
include: '^8.0.0 || ^9.0.0'
mode: latest-minors
node: '>=14'
commands: npm test
- versions: '^10.0.0'
- versions:
include: '^10.0.0'
mode: latest-minors
node: '>=18'
commands: npm test
4 changes: 3 additions & 1 deletion plugins/node/instrumentation-dataloader/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dataloader:
# Testing ^2.0.0 covers about 90% of the downloaded versions
versions: "^2.0.0"
versions:
include: "^2.0.0"
mode: latest-minors
commands: npm run test
4 changes: 3 additions & 1 deletion plugins/node/instrumentation-lru-memoizer/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'lru-memoizer':
versions: ">=1.3 <3"
versions:
include: ">=1.3 <3"
mode: latest-minors
commands:
- npm test
8 changes: 6 additions & 2 deletions plugins/node/instrumentation-socket.io/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'socket.io':
- versions: "2.1.1 || 2.2.0 || 2.3.0 || 2.4.0 || ^2.5.0"
- versions:
include: "^2.1.1"
mode: latest-minors
peerDependencies: socket.io-client@^2
commands:
- npm run test
@@ -9,7 +11,9 @@
commands:
- npm run test

- versions: "4.5.3 || 4.6.2 || ^4.7.1"
- versions:
include: "^4.5.3"
mode: latest-minors
peerDependencies: socket.io-client@^4
commands:
- npm run test
21 changes: 15 additions & 6 deletions plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
"aws-sdk":
# A small subset of releases in the range [2.308.0, 3) to reduce testing time.
versions: "2.308.0 || 2.556.0 || 2.801.0 || 2.1049.0 || 2.1297.0 || 2.1546.0 || >=2.1548.0"
versions:
include: "^2.308.0"
mode: max-7
commands:
- npm run test

# Versions [3.363.0, 3.377.0] of all @aws-sdk/client-* were bad releases. See:
# - https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2464#issuecomment-2403652552
# - https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1828#issuecomment-1834276719

"@aws-sdk/client-s3":
# A small subset of releases in the range [3.6.1, 4) to reduce testing time.
# - 3.377.0 was a bad release (see issue #1828).
# - 3.529.0 was missing the fast-xml-parser dependency (https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.529.1)
versions: "3.6.1 || 3.55.0 || 3.180.0 || 3.289.0 || 3.385.0 || 3.498.0 || >=3.529.1"
versions:
include: "^3.6.1"
exclude: "3.529.0 || >=3.363.0 <=3.377.0"
mode: "max-7"
commands:
- npm run test

"@aws-sdk/client-sqs":
# A small subset of releases in the range [3.24.0, 4) to reduce testing time.
versions: "3.24.0 || 3.94.0 || 3.202.0 || 3.296.0 || 3.388.0 || 3.496.0 || >=3.503.1"
versions:
include: "^3.24.0"
exclude: ">=3.363.0 <=3.377.0"
mode: "max-7"
commands:
- npm run test
4 changes: 3 additions & 1 deletion plugins/node/opentelemetry-instrumentation-bunyan/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
bunyan:
# Testing ^1.8.12 covers at least 95% of the downloaded versions
versions: "^1.8.12"
versions:
include: "^1.8.12"
mode: latest-minors
commands: npm run test
4 changes: 3 additions & 1 deletion plugins/node/opentelemetry-instrumentation-express/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
express:
- versions: "^4.16.2"
- versions:
include: "^4.16.2"
mode: latest-minors
commands: npm run test
10 changes: 6 additions & 4 deletions plugins/node/opentelemetry-instrumentation-fastify/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"fastify":
# Sanity check the first 4.x release, instead of all releases, plus recent
# releases.
- versions: "4.0.0 || >=4.24.3 <5"
- versions:
include: "^4.0.0"
mode: max-7
commands: npm run test
- versions: ">=5 <6"
- versions:
include: ">=5 <6"
mode: max-7
commands: npm run test
peerDependencies: "@fastify/express@4.0.1"
node: '>=20'
5 changes: 3 additions & 2 deletions plugins/node/opentelemetry-instrumentation-graphql/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
graphql:
# Taking a sample from the most downloaded versions in the range "14 || 15 || 16"
versions: "16.4.0 || 16.3.0 || 16.2.0 || 16.0.0 || ^15.8.0 || 15.7.2 || 15.6.1 || 15.6.0 || 15.5.3 || 15.5.1 || 15.5.0 || 15.4.0 || 15.3.0 || ^14.7.0 || 14.6.0 || 14.5.8 || 14.0.0"
versions:
include: "14 || 15 || 16"
mode: max-7
commands: npm run test
12 changes: 9 additions & 3 deletions plugins/node/opentelemetry-instrumentation-hapi/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
"@hapi/hapi":
- versions: "^19.2.0 || ^18.4.1 || ^17.9.0"
- versions:
include: "^19.2.0 || ^18.4.1 || ^17.9.0"
mode: latest-minors
node: ">=14 <16"
commands: npm test
- versions: "^20.3.0"
- versions:
include: "^20.3.0"
mode: latest-minors
node: ">=14"
commands: npm test
- versions: "^21.3.3"
- versions:
include: "^21.3.3"
mode: latest-minors
node: ">=14.15.0"
commands: npm test

5 changes: 4 additions & 1 deletion plugins/node/opentelemetry-instrumentation-ioredis/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
ioredis:
# Ignoring v4.19.0. Tests never ends. Caused by https://github.com/luin/ioredis/pull/1219
versions: "^2.5.0 || ^3.2.2 || 4.14.1 || 4.16.3 || 4.17.3 || 4.18.0 || 4.19.2 || 4.19.4 || 4.22.0 || 4.24.5 || 4.26.0 || 4.27.11 || ^4.28.5 || 5.0.6 || 5.2.6 || ^5.3.2"
versions:
include: '>=2.0.0 <6'
exclude: '4.19.0'
mode: max-7
commands: npm run test
8 changes: 6 additions & 2 deletions plugins/node/opentelemetry-instrumentation-koa/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"@koa/router":
versions: "8.0.8 || 9.4.0 || 10.0.0 || 10.1.1 || 11.0.1 || >=12.0.0"
versions:
include: ">=8.0.0"
mode: latest-minors
commands: npm run test

koa:
# Testing ^2.7.0 covers at least 97% of the downloaded koa versions
versions: "^2.7.0"
versions:
include: "^2.7.0"
mode: latest-minors
commands: npm run test
13 changes: 10 additions & 3 deletions plugins/node/opentelemetry-instrumentation-mongodb/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
mongodb:
- versions: ">=3.3 <4"
- versions:
include: ">=3.3 <4"
mode: max-7
commands: npm run test-v3
- versions:
include: ">=4 <5"
@@ -9,9 +11,14 @@ mongodb:
# tests for the wrong version.
# Ref: https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2001#issuecomment-1992202942
exclude: "4.17.2"
mode: max-7
commands: npm run test-v4
- versions: ">=5 <6"
- versions:
include: ">=5 <6"
mode: max-7
commands: npm run test-v5-v6
- versions: ">=6 <7"
- versions:
include: ">=6 <7"
mode: max-7
node: '>=15.0.0'
commands: npm run test-v5-v6
15 changes: 6 additions & 9 deletions plugins/node/opentelemetry-instrumentation-mysql2/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
mysql2:
- versions: <4 >=3.2.0 || 3.1.0 || 3.0.0
commands: npm run test

- versions: <3 >=2.3.2 || 2.3.0 || 2.2.5 || 2.1.0
# Skip 2.3.3 which installs types from git which takes 10m on it's own
commands: npm run test

- versions: 1.4.2 || 1.5.3 || 1.6.4 || 1.6.5 || 1.7.0
versions:
include: ">=1.4.2 <4"
# Skip v1.6.2, which is broken
commands: npm run test
# Skip 2.3.3 which installs types from git which takes 10m on it's own
exclude: "1.6.2 || 2.3.3"
mode: latest-minors
commands: npm run test
35 changes: 26 additions & 9 deletions plugins/node/opentelemetry-instrumentation-nestjs-core/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
"@nestjs/core":
- versions: "^8.2.0 || 8.1.2 || 8.1.1 || 8.0.11 || 8.0.9 || 8.0.6"
- versions:
include: ">=10.0.0 <11"
mode: latest-minors
# NestJS 10 requires Node.js v16 or later.
# https://docs.nestjs.com/migration-guide#dropping-support-for-nodejs-v12
node: ">=16"
peerDependencies:
- "@nestjs/common@^10.0.0"
- "rxjs@^7.1.0"
commands: npm run test

- versions:
include: ">=9.0.0 <10"
mode: latest-minors
peerDependencies:
- "@nestjs/common@^9.0.0"
- "rxjs@^7.1.0"
commands: npm run test

- versions:
include: ">=8.0.0 <9"
mode: latest-minors
peerDependencies:
- "@nestjs/common@^8.0.0"
- "@nestjs/microservices@^8.0.0"
- "@nestjs/platform-express@^8.0.0"
- "@nestjs/websockets@^8.0.0"
- "rxjs@^7.1.0"
commands: npm run test

- versions: "^7.6.17 || 7.6.15 || 7.6.13 || 7.6.12"
- versions:
# We *could* test all 7.x "latest-minors", but the latest 7.x release was
# 2021, so let's just test the latest.
include: "^7.6.18"
peerDependencies:
- "@nestjs/common@^7.0.0"
- "@nestjs/microservices@^7.0.0"
- "@nestjs/platform-express@^7.0.0"
- "@nestjs/websockets@^7.0.0"
- "rxjs@^6.0.0"
commands: npm run test

- versions: "6.11.11"
peerDependencies:
- "@nestjs/common@^6.0.0"
- "@nestjs/microservices@^6.0.0"
- "@nestjs/platform-express@^6.0.0"
- "@nestjs/websockets@^6.0.0"
- "rxjs@^6.0.0"
commands: npm run test
Original file line number Diff line number Diff line change
@@ -47,9 +47,6 @@
"devDependencies": {
"@nestjs/common": "9.4.3",
"@nestjs/core": "9.4.3",
"@nestjs/microservices": "9.4.3",
"@nestjs/platform-express": "9.4.3",
"@nestjs/websockets": "9.4.3",
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/context-async-hooks": "^1.8.0",
"@opentelemetry/sdk-trace-base": "^1.8.0",

This file was deleted.

Original file line number Diff line number Diff line change
@@ -232,7 +232,7 @@ export const setup = async (version: string): Promise<App> => {
);
}

const app = await core.NestFactory.create(AppModule);
const app = await core.NestFactory.create(AppModule, { logger: false });
if (app.listenAsync) {
await app.listenAsync(0, 'localhost');
} else {
9 changes: 5 additions & 4 deletions plugins/node/opentelemetry-instrumentation-pg/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pg:
# a sample from supported versions
- versions: "8.5.1 || 8.6.0 || 8.7.1"
peerDependencies: pg-pool@^3
commands: npm run test
versions:
include: '>=8.0.3 <9'
mode: max-7
peerDependencies: pg-pool@^3
commands: npm run test
2 changes: 1 addition & 1 deletion plugins/node/opentelemetry-instrumentation-pg/README.md
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-pg

### Supported Versions

- [`pg`](https://www.npmjs.com/package/pg) versions `>=8.0.0 <9`
- [`pg`](https://www.npmjs.com/package/pg) versions `>=8.0.3 <9`
- [`pg-pool`](https://www.npmjs.com/package/pg-pool) versions `>=2.0.0 <4`

## Usage
4 changes: 2 additions & 2 deletions plugins/node/opentelemetry-instrumentation-pg/package.json
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@
"prepublishOnly": "npm run compile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"test-all-versions": "cross-env IN_TAV=true tav",
"test-all-versions:local": "cross-env IN_TAV=true RUN_POSTGRES_TESTS_LOCAL=true npm run test-all-versions",
"test-all-versions": "tav",
"test-all-versions:local": "cross-env RUN_POSTGRES_TESTS_LOCAL=true npm run test-all-versions",
"test:debug": "ts-mocha --inspect-brk --no-timeouts -p tsconfig.json 'test/**/*.test.ts'",
"test:local": "cross-env RUN_POSTGRES_TESTS_LOCAL=true npm run test",
"version:update": "node ../../../scripts/version-update.js",
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
protected init() {
const modulePG = new InstrumentationNodeModuleDefinition(
'pg',
['>=8.0.0 <9'],
['>=8.0.3 <9'],
(module: any) => {
const moduleExports: typeof pgTypes =
module[Symbol.toStringTag] === 'Module'
Original file line number Diff line number Diff line change
@@ -277,6 +277,7 @@ describe('pg-pool', () => {
await client.query('SELECT NOW()');
} finally {
client.release();
await newPool.end();
}
const spans = memoryExporter.getFinishedSpans();
assert.strictEqual(spans.length, 0);
11 changes: 6 additions & 5 deletions plugins/node/opentelemetry-instrumentation-pino/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
pino:
- versions: "^9.0.0"
- versions:
include: '>=9.0.0 <10'
mode: latest-minors
node: ">=18"
commands: npm run test
- versions: "^8.21.0 || 8.20.0 || 8.16.2 || 8.12.1 || 8.8.0 || 8.4.0 || 8.0.0 || ^7.11.0 || 7.8.0 || 7.2.0 || ^6.13.3 || 5.17.0 || 5.14.0"
- versions:
include: '>=5.14.0 <9'
mode: max-7
node: ">=14"
commands: npm run test
- versions: "^7.11.0 || 7.8.0 || 7.2.0 || ^6.13.1 || 5.17.0 || 5.14.0"
node: ">=8 <14"
commands: npm run test
12 changes: 6 additions & 6 deletions plugins/node/opentelemetry-instrumentation-redis-4/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
redis:
jobs:
# The latest minor releases in the range "^4.0.0", excluding
# "4.6.9", which was a bad release that accidentally broke
# node v14 support.
- versions: "4.0.0 || 4.0.6 || 4.1.1 || 4.2.0 || 4.3.1 || 4.4.0 || 4.5.1 || ^4.6.11"
commands: npm run test
versions:
include: "^4.0.0"
# "4.6.9" was a bad release that accidentally broke node v14 support.
exclude: "4.6.9"
mode: latest-minors
commands: npm run test
4 changes: 3 additions & 1 deletion plugins/node/opentelemetry-instrumentation-redis/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
redis:
versions: ^2.6.0 || ^3.0.0
versions:
include: '>=2.6.0 <4'
mode: latest-minors
commands: npm run test
8 changes: 6 additions & 2 deletions plugins/node/opentelemetry-instrumentation-restify/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
restify:
- versions: "^10.0.0 || ^11.1.0"
- versions:
include: '>=10.0.0 <12'
mode: latest-minors
node: ">=18"
commands: npm run test

- versions: "4.3.4 || 5.2.0 || 6.4.0 || 7.7.0 || ^8.4.0 || 9.1.0 || ^10.0.0 || ^11.1.0"
- versions:
include: '>=4.1.0 <10'
mode: max-7
node: "<18"
commands: npm run test
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-restify

### Supported Versions

- [`restify`](https://www.npmjs.com/package/restify) versions `>=4.0.0 <12`
- [`restify`](https://www.npmjs.com/package/restify) versions `>=4.1.0 <12`

## Usage

Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ import { isPromise, isAsyncFunction } from './utils';
import { getRPCMetadata, RPCType } from '@opentelemetry/core';
import type { RestifyInstrumentationConfig } from './types';

const supportedVersions = ['>=4.0.0 <12'];
const supportedVersions = ['>=4.1.0 <12'];

export class RestifyInstrumentation extends InstrumentationBase<RestifyInstrumentationConfig> {
constructor(config: RestifyInstrumentationConfig = {}) {
Original file line number Diff line number Diff line change
@@ -241,12 +241,13 @@ describe('Restify Instrumentation', () => {
rootSpan.end();
assert.strictEqual(memoryExporter.getFinishedSpans().length, 4);

if (semver.satisfies(LIB_VERSION, '>=8')) {
if (semver.satisfies(LIB_VERSION, '>=8.2.0')) {
// Error handling changed slightly in v8.2.0 (https://github.com/restify/node-restify/pull/1757).
assert.deepEqual(
result,
'{"code":"Internal","message":"Error: NOK"}'
);
} else if (semver.satisfies(LIB_VERSION, '>=7 <8')) {
} else if (semver.satisfies(LIB_VERSION, '>=7 <8.2.0')) {
assert.deepEqual(
result,
'{"code":"Internal","message":"caused by Error: NOK"}'
7 changes: 4 additions & 3 deletions plugins/node/opentelemetry-instrumentation-winston/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
winston:
# A selection of versions of Winston 2.x and 3.x
- versions: "2.0.0 || 2.4.0 || 2.4.7 || 3.3.1 || 3.6.0 || 3.10.0 || ^3.11.0"
commands: npm run test
versions:
include: '>=2.0.0 <4'
mode: max-7
commands: npm run test

0 comments on commit 0341e89

Please sign in to comment.