Skip to content

Commit dfdf4c3

Browse files
david-lunatrentm
andcommitted
test: fix @aws-sdk/client-s3 TAV test failures (#3312)
* fix resolution of docker compose file for CI tests of client-s3 * bump min supported @aws-sdk/client-s3 to v3.15.0 * Fix an issue in the tests sorting APM intake events to be tested. Fixes: #3311 Co-authored-by: Trent Mick <[email protected]>
1 parent 10df79f commit dfdf4c3

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

.ci/scripts/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ elif [[ -n "${TAV_MODULE}" ]]; then
213213
memcached)
214214
DOCKER_COMPOSE_FILE=docker-compose-memcached.yml
215215
;;
216-
aws-sdk)
216+
aws-sdk|@aws-sdk/client-s3)
217217
DOCKER_COMPOSE_FILE=docker-compose-localstack.yml
218218
;;
219219
*)

.tav.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -539,16 +539,16 @@ aws-sdk:
539539

540540
'@aws-sdk/client-s3':
541541
# We want this version range:
542-
# versions: '>=3 <4'
542+
# versions: '>=3.15.0 <4'
543543
# However, @awk-sdk/client-s3 releases *very* frequently (almost every day) and there
544544
# is no need to test *all* those releases. Instead we statically list a subset
545545
# of versions to test.
546546
#
547547
# Maintenance note: This should be updated periodically using:
548548
# ./dev-utils/aws-sdk-s3-client-tav-versions.sh
549549
#
550-
# Test v3.0.0, every N=41 of 210 releases, and current latest
551-
versions: '3.0.0 || 3.36.0 || 3.86.0 || 3.171.0 || 3.245.0 || 3.315.0 || 3.321.1 || >3.321.1 <4'
550+
# Test v3.15.0, every N=37 of 191 releases, and current latest.
551+
versions: '3.15.0 || 3.48.0 || 3.112.0 || 3.188.0 || 3.257.0 || 3.315.0 || 3.325.0 || >3.325.0 <4'
552552
commands:
553553
- node test/instrumentation/modules/@aws-sdk/client-s3.test.js
554554
node: '>=14'

dev-utils/aws-sdk-s3-client-tav-versions.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Calculate and emit the "versions:" block of ".tav.yml" for aws-sdk.
44
# This will include:
5-
# - the first supported release (2.858.0)
5+
# - the first supported release
66
# - the latest current release
77
# - and ~5 releases in between
88

@@ -14,9 +14,9 @@ npm info -j @aws-sdk/client-s3 | node -e '
1414
.on("data", (chunk) => { chunks.push(chunk) })
1515
.on("end", () => {
1616
var input = JSON.parse(chunks.join(""));
17-
var vers = input.versions.filter(v => semver.satisfies(v, ">=3 <4"));
17+
var vers = input.versions.filter(v => semver.satisfies(v, ">=3.15.0 <4"));
1818
var modulus = Math.floor((vers.length - 2) / 5);
19-
console.log(" # Test v3.0.0, every N=%d of %d releases, and current latest.", modulus, vers.length);
19+
console.log(" # Test v3.15.0, every N=%d of %d releases, and current latest.", modulus, vers.length);
2020
vers = vers.filter((v, idx, arr) => idx % modulus === 0 || idx === arr.length - 1);
2121
console.log(" versions: '\''%s || >%s <4'\''", vers.join(" || "), vers[vers.length-1])
2222
})

docs/supported-technologies.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ The Node.js agent will automatically instrument the following modules to give yo
139139
|=======================================================================
140140
|Module |Version |Note
141141
|https://www.npmjs.com/package/aws-sdk[aws-sdk] |>1 <3 |Will instrument SQS send/receive/delete messages, all S3 methods, all DynamoDB methods, and the SNS publish method
142-
|https://www.npmjs.com/package/@aws-sdk/client-s3[@aws-sdk/client-s3] |>=3 <4 |Will instrument all S3 methods
142+
|https://www.npmjs.com/package/@aws-sdk/client-s3[@aws-sdk/client-s3] |>=3.15.0 <4 |Will instrument all S3 methods
143143
|https://www.npmjs.com/package/cassandra-driver[cassandra-driver] |>=3.0.0 <5 |Will instrument all queries
144144
|https://www.npmjs.com/package/elasticsearch[elasticsearch] |>=8.0.0 |Will instrument all queries
145145
|https://www.npmjs.com/package/@elastic/elasticsearch[@elastic/elasticsearch] |>=7.0.0 <9.0.0 |Will instrument all queries

test/instrumentation/modules/@aws-sdk/client-s3.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ tape.test('simple S3 V3 usage scenario', function (t) {
7777
// Sort the events by timestamp, then work through each expected span.
7878
const events = server.events.slice(1)
7979
events.sort((a, b) => {
80-
const aTimestamp = (a.transaction || a.span || {}).timestamp
81-
const bTimestamp = (b.transaction || b.span || {}).timestamp
80+
const aTimestamp = (a.transaction || a.span || a.error || {}).timestamp
81+
const bTimestamp = (b.transaction || b.span || b.error || {}).timestamp
8282
return aTimestamp < bTimestamp ? -1 : 1
8383
})
8484

test/instrumentation/modules/aws-sdk/s3.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ tape.test('simple S3 usage scenario', function (t) {
6868
// Sort the events by timestamp, then work through each expected span.
6969
const events = server.events.slice(1)
7070
events.sort((a, b) => {
71-
const aTimestamp = (a.transaction || a.span || {}).timestamp
72-
const bTimestamp = (b.transaction || b.span || {}).timestamp
71+
const aTimestamp = (a.transaction || a.span || a.error || {}).timestamp
72+
const bTimestamp = (b.transaction || b.span || b.error || {}).timestamp
7373
return aTimestamp < bTimestamp ? -1 : 1
7474
})
7575

0 commit comments

Comments
 (0)