Skip to content

Commit

Permalink
skip testing with Node <18 with the latest aws-sdk clients
Browse files Browse the repository at this point in the history
Also fix a bug in runTestFixtures that would never resolve a promise
if versionRanges was used to skip a test.
  • Loading branch information
trentm committed Jan 14, 2025
1 parent 96a48f2 commit 23cd64e
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/instrumentation-openai/test/testutils.js
Original file line number Diff line number Diff line change
@@ -525,6 +525,7 @@ function runTestFixtures(suite, testFixtures) {
)})`
);
t.end();
outerResolve();
return;
}
}
8 changes: 8 additions & 0 deletions packages/opentelemetry-node/test/instr-aws-sdk.test.js
Original file line number Diff line number Diff line change
@@ -31,10 +31,15 @@ const TEST_REGION = 'us-east-2';
const server = createServer();
const endpoint = `http://127.0.0.1:${server.address().port}`;

// `@aws-sdk/client-*` >=3.723.0 switched to `@smithy/smithy-client@4`
// which supports only Node.js v18 and later now.
const AWS_SDK_SUPPORTED_NODE_RANGE = '>=18.0.0';

/** @type {import('./testutils').TestFixture[]} */
const testFixtures = [
{
name: 'use-aws-client-s3',
versionRanges: {node: AWS_SDK_SUPPORTED_NODE_RANGE},
args: ['./fixtures/use-aws-client-s3.js'],
cwd: __dirname,
env: {
@@ -70,6 +75,7 @@ const testFixtures = [
},
{
name: 'use-aws-client-sns',
versionRanges: {node: AWS_SDK_SUPPORTED_NODE_RANGE},
args: ['./fixtures/use-aws-client-sns.js'],
cwd: __dirname,
env: {
@@ -106,6 +112,7 @@ const testFixtures = [
},
{
name: 'use-aws-client-sqs',
versionRanges: {node: AWS_SDK_SUPPORTED_NODE_RANGE},
args: ['./fixtures/use-aws-client-sqs.js'],
cwd: __dirname,
env: {
@@ -143,6 +150,7 @@ const testFixtures = [
},
{
name: 'use-aws-client-dynamodb',
versionRanges: {node: AWS_SDK_SUPPORTED_NODE_RANGE},
args: ['./fixtures/use-aws-client-dynamodb.js'],
cwd: __dirname,
env: {
1 change: 1 addition & 0 deletions packages/opentelemetry-node/test/testutils.js
Original file line number Diff line number Diff line change
@@ -569,6 +569,7 @@ function runTestFixtures(suite, testFixtures) {
)})`
);
t.end();
outerResolve();
return;
}
}

0 comments on commit 23cd64e

Please sign in to comment.