Skip to content

Commit

Permalink
test: Removed t.diagnostic as they are better suited as code commen…
Browse files Browse the repository at this point in the history
…ts (#2786)
  • Loading branch information
bizob2828 authored Nov 25, 2024
1 parent 963fb30 commit ee24027
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions test/unit/collector/facts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ test('display_host facts', async (t) => {
const { agent, facts } = t.nr
if (!agent.config.getIPAddresses().ipv6) {
t.diagnostic('this machine does not have an ipv6 address, skipping')
return end()
end()
}

agent.config.process_host.ipv_preference = '6'
Expand All @@ -754,7 +754,7 @@ test('display_host facts', async (t) => {
const { agent, facts } = t.nr
if (!agent.config.getIPAddresses().ipv6) {
t.diagnostic('this machine does not have an ipv6 address, skipping')
return end()
end()
}

const mockedNI = {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/spans/batch-span-streamer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ test('BatchSpanStreamer', async (t) => {

await t.test('should send in appropriate batch sizes', (t) => {
const { fakeConnection, spanStreamer } = t.nr
t.diagnostic('this will simulate n full batches and the last batch being 1/3 full')
// this will simulate n full batches and the last batch being 1/3 full
const SPANS = 10000
const BATCH = 750
const metrics = spanStreamer._metrics
Expand Down
4 changes: 1 addition & 3 deletions test/unit/util/code-level-metrics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ test('CLM Meta', async (t) => {
await t.test('should not add CLM attrs when filePath is null', (t) => {
const { segmentStub } = t.nr
function fn() {}
t.diagnostic(
'This is testing Express router.route which binds a function thus breaking any function metadata'
)
// This is testing Express router.route which binds a function thus breaking any function metadata
const boundFn = fn.bind(null)
boundFn[symbols.clm] = true
addCLMAttributes(boundFn, segmentStub)
Expand Down
8 changes: 3 additions & 5 deletions test/versioned/grpc/server-client-streaming.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ test('should add DT headers when `distributed_tracing` is enabled', async (t) =>
tx.end()
})

payload.forEach(({ name }) => {
// TODO: gotta instrument and test event listeners on client streaming
// t.test(`adding '${name}' should create a server trace segment`)
t.diagnostic(`adding '${name}' should create a server trace segment`)
})
// TODO: gotta instrument and test event listeners on client streaming
// payload.forEach(({ name }) => {})

assertDistributedTracing({ clientTransaction, serverTransaction })
})

Expand Down
4 changes: 2 additions & 2 deletions test/versioned/mongodb-esm/db.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test('addUser, authenticate, removeUser', async (t) => {
if (typeof db.authenticate === 'function') {
db.authenticate(username, password, authed)
} else {
t.diagnostic('skipping authentication test, not supported on db')
// skipping authentication test, not supported on db
db.removeUser(username, removedNoAuth)
}
}
Expand Down Expand Up @@ -476,7 +476,7 @@ function verifyMongoSegments({ t, tx, expectedSegments }) {
// datastore instance attributes.
if (/^Datastore\/.*?\/MongoDB/.test(current.name) === true) {
if (isBadSegment(current) === true) {
t.diagnostic(`skipping attributes check for ${current.name}`)
// skipping attributes check for ${current.name}
continue
}

Expand Down

0 comments on commit ee24027

Please sign in to comment.