Skip to content

Commit d24554d

Browse files
committed
Apply auto-fixes
1 parent d9e77c6 commit d24554d

64 files changed

Lines changed: 176 additions & 137 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

integration-tests/aiguard/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { executeRequest } = require('./util')
1212

1313
function assertHasGuardSpan (payload, predicate) {
1414
const spans = payload[0].filter(span => span.name === 'ai_guard')
15-
assert.ok(spans.length > 0)
15+
assert.ok(spans.length > 0, `Expected ${spans.length} > 0`)
1616
const matching = spans.find(predicate)
1717
assert.notStrictEqual(matching, undefined)
1818
}

integration-tests/appsec/iast-esbuild.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('esbuild support for IAST', () => {
5656

5757
const ddStack = msgpack.decode(span.meta_struct['_dd.stack'])
5858
assert.ok(Object.hasOwn(ddStack.vulnerability[0], 'frames'))
59-
assert.ok(ddStack.vulnerability[0].frames.length > 0)
59+
assert.ok(ddStack.vulnerability[0].frames.length > 0, `Expected ${ddStack.vulnerability[0].frames.length} > 0`)
6060
})
6161
}, null, 1, true)
6262
}

integration-tests/cucumber/cucumber.spec.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ describe(`cucumber@${version} commonJS`, () => {
12291229

12301230
// Only tests from the non-skipped suite ran
12311231
const tests = events.filter(event => event.type === 'test').map(event => event.content)
1232-
assert.ok(tests.length > 0)
1232+
assert.ok(tests.length > 0, `Expected ${tests.length} > 0`)
12331233
tests.forEach(test => {
12341234
assert.ok(!test.meta[TEST_SUITE].includes('farewell'))
12351235
})
@@ -2563,7 +2563,10 @@ describe(`cucumber@${version} commonJS`, () => {
25632563
'nyc output does not match the reported coverage (no --all flag)')
25642564

25652565
eventsPromise.then(() => {
2566-
assert.ok(codeCoverageWithoutUntestedFiles > codeCoverageWithUntestedFiles)
2566+
assert.ok(
2567+
codeCoverageWithoutUntestedFiles > codeCoverageWithUntestedFiles,
2568+
`Expected ${codeCoverageWithoutUntestedFiles} > ${codeCoverageWithUntestedFiles}`
2569+
)
25672570
done()
25682571
}).catch(done)
25692572
})
@@ -2904,7 +2907,7 @@ describe(`cucumber@${version} commonJS`, () => {
29042907
const atfTests = tests.filter(
29052908
t => t.meta[TEST_MANAGEMENT_IS_ATTEMPT_TO_FIX] === 'true'
29062909
)
2907-
assert.ok(atfTests.length > 0)
2910+
assert.ok(atfTests.length > 0, `Expected ${atfTests.length} > 0`)
29082911
for (const test of atfTests) {
29092912
assert.ok(
29102913
!(TEST_IS_NEW in test.meta),
@@ -3434,7 +3437,7 @@ describe(`cucumber@${version} commonJS`, () => {
34343437
.gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), payloads => {
34353438
const metadataDicts = payloads.flatMap(({ payload }) => payload.metadata)
34363439

3437-
assert.ok(metadataDicts.length > 0)
3440+
assert.ok(metadataDicts.length > 0, `Expected ${metadataDicts.length} > 0`)
34383441
metadataDicts.forEach(metadata => {
34393442
assert.strictEqual(metadata.test[DD_CAPABILITIES_TEST_IMPACT_ANALYSIS], '1')
34403443
assert.strictEqual(metadata.test[DD_CAPABILITIES_EARLY_FLAKE_DETECTION], '1')

integration-tests/cypress/cypress-impacted-tests.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ moduleTypes.forEach(({
159159
.filter(({ payload }) => payload.metadata?.test)
160160
.flatMap(({ payload }) => payload.metadata)
161161

162-
assert.ok(metadataDicts.length > 0)
162+
assert.ok(metadataDicts.length > 0, `Expected ${metadataDicts.length} > 0`)
163163
metadataDicts.forEach(metadata => {
164164
assert.strictEqual(metadata.test[DD_CAPABILITIES_TEST_IMPACT_ANALYSIS], '1')
165165
assert.strictEqual(metadata.test[DD_CAPABILITIES_EARLY_FLAKE_DETECTION], '1')

integration-tests/cypress/cypress-itr.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ moduleTypes.forEach(({
538538
const eventsPromise = gatherCypressPayloads(receiver, childProcess, '/api/v2/citestcycle', payloads => {
539539
const events = payloads.flatMap(({ payload }) => payload.events)
540540
const tests = events.filter(event => event.type === 'test').map(event => event.content)
541-
assert.ok(tests.length > 0)
541+
assert.ok(tests.length > 0, `Expected ${tests.length} > 0`)
542542
tests.forEach(test => {
543543
assert.strictEqual(test.itr_correlation_id, itrCorrelationId)
544544
})
@@ -621,7 +621,7 @@ moduleTypes.forEach(({
621621

622622
const testEvents = events.filter(event => event.type === 'test')
623623
const testModuleEvent = events.find(event => event.type === 'test_module_end')
624-
assert.ok(testEvents.length > 0)
624+
assert.ok(testEvents.length > 0, `Expected ${testEvents.length} > 0`)
625625
assert.ok(testModuleEvent)
626626

627627
testEvents.forEach(testEvent => {

integration-tests/cypress/cypress-reporting.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ moduleTypes.forEach(({
11111111
const testSessionEvent = events.find(event => event.type === 'test_session_end')
11121112
assert.ok(testSessionEvent)
11131113
const testEvents = events.filter(event => event.type === 'test')
1114-
assert.ok(testEvents.length > 0)
1114+
assert.ok(testEvents.length > 0, `Expected ${testEvents.length} > 0`)
11151115
}, { hardTimeout: 30000 })
11161116

11171117
await Promise.all([

integration-tests/cypress/cypress-test-management.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ moduleTypes.forEach(({
589589
const atfTests = tests.filter(
590590
t => t.meta[TEST_MANAGEMENT_IS_ATTEMPT_TO_FIX] === 'true'
591591
)
592-
assert.ok(atfTests.length > 0)
592+
assert.ok(atfTests.length > 0, `Expected ${atfTests.length} > 0`)
593593
for (const test of atfTests) {
594594
assert.ok(
595595
!(TEST_IS_NEW in test.meta),

integration-tests/debugger/snapshot-global-sample-rate.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ describe('Dynamic Instrumentation', function () {
6161
const timeSincePrevTimestamp = timestamp - prevTimestamp
6262

6363
// Allow for a time variance (time will tell if this is enough). Timeouts can vary.
64-
assert.ok(duration >= 925)
65-
assert.ok(duration < 1050)
64+
assert.ok(duration >= 925, `Expected ${duration} >= 925`)
65+
assert.ok(duration < 1050, `Expected ${duration} < 1050`)
6666

6767
// A sanity check to make sure we're not saturating the event loop. We expect a lot of snapshots to be
6868
// sampled in the beginning of the sample window and then once the threshold is hit, we expect a "quiet"
6969
// period until the end of the window. If there's no "quiet" period, then we're saturating the event loop
7070
// and this test isn't really testing anything.
71-
assert.ok(timeSincePrevTimestamp >= 250)
71+
assert.ok(timeSincePrevTimestamp >= 250, `Expected ${timeSincePrevTimestamp} >= 250`)
7272

7373
clearTimeout(state[rcConfig1.config.id].timer)
7474
clearTimeout(state[rcConfig2.config.id].timer)

integration-tests/debugger/snapshot-pruning.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Dynamic Instrumentation', function () {
1414
it('should prune snapshot if payload is too large', function (done) {
1515
t.agent.on('debugger-input', ({ payload: [payload] }) => {
1616
const payloadSize = Buffer.byteLength(JSON.stringify(payload))
17-
assert.ok(payloadSize < 1024 * 1024) // 1MB
17+
assert.ok(payloadSize < 1024 * 1024, `Expected ${payloadSize} < ${1024 * 1024}`) // 1MB
1818

1919
const capturesJson = JSON.stringify(payload.debugger.snapshot.captures)
2020
assert.match(capturesJson, /"pruned":true/)

integration-tests/debugger/snapshot.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe('Dynamic Instrumentation', function () {
204204
if ('fields' in prop) {
205205
if (prop.notCapturedReason === 'fieldCount') {
206206
assert.strictEqual(Object.keys(prop.fields).length, maxFieldCount)
207-
assert.ok(prop.size > maxFieldCount)
207+
assert.ok(prop.size > maxFieldCount, `Expected ${prop.size} > ${maxFieldCount}`)
208208
} else {
209209
assert.ok(Object.keys(prop.fields).length < maxFieldCount)
210210
}
@@ -228,12 +228,12 @@ describe('Dynamic Instrumentation', function () {
228228
assert.strictEqual(locals.request.type, 'Request')
229229
assert.strictEqual(Object.keys(locals.request.fields).length, maxFieldCount)
230230
assert.strictEqual(locals.request.notCapturedReason, 'fieldCount')
231-
assert.ok(locals.request.size > maxFieldCount)
231+
assert.ok(locals.request.size > maxFieldCount, `Expected ${locals.request.size} > ${maxFieldCount}`)
232232

233233
assert.strictEqual(locals.fastify.type, 'Object')
234234
assert.strictEqual(Object.keys(locals.fastify.fields).length, maxFieldCount)
235235
assert.strictEqual(locals.fastify.notCapturedReason, 'fieldCount')
236-
assert.ok(locals.fastify.size > maxFieldCount)
236+
assert.ok(locals.fastify.size > maxFieldCount, `Expected ${locals.fastify.size} > ${maxFieldCount}`)
237237

238238
for (const value of Object.values(locals)) {
239239
assertMaxFieldCount(value)
@@ -300,7 +300,7 @@ describe('Dynamic Instrumentation', function () {
300300
const { raw } = captures.lines[t.breakpoint.line].locals.request.fields
301301
assert.strictEqual(raw.notCapturedReason, 'fieldCount')
302302
assert.strictEqual(Object.keys(raw.fields).length, 20)
303-
assert.ok(raw.size > 20)
303+
assert.ok(raw.size > 20, `Expected ${raw.size} > 20`)
304304
done()
305305
})
306306

0 commit comments

Comments
 (0)