Skip to content

Commit

Permalink
test(client): enable all relevant tracing tests with mini-proxy (#18444)
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Mar 23, 2023
1 parent 2195de1 commit 1758ff0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 10 additions & 13 deletions packages/client/tests/functional/tracing-no-sampling/tests.ts
Expand Up @@ -74,19 +74,16 @@ testMatrix.setupTestSuite(
expect(checkQueriesHaveNotTraceparent()).toBe(true)
})

testIf(!process.env.TEST_DATA_PROXY)(
'should perform a query and assert that no spans were generated via itx',
async () => {
await prisma.$transaction(async (prisma) => {
await prisma.user.findMany()
})

const spans = inMemorySpanExporter.getFinishedSpans()

expect(spans).toHaveLength(0)
expect(checkQueriesHaveNotTraceparent()).toBe(true)
},
)
test('should perform a query and assert that no spans were generated via itx', async () => {
await prisma.$transaction(async (prisma) => {
await prisma.user.findMany()
})

const spans = inMemorySpanExporter.getFinishedSpans()

expect(spans).toHaveLength(0)
expect(checkQueriesHaveNotTraceparent()).toBe(true)
})
},
{
skipDefaultClientInstance: true,
Expand Down
4 changes: 3 additions & 1 deletion packages/client/tests/functional/tracing/tests.ts
Expand Up @@ -417,7 +417,7 @@ testMatrix.setupTestSuite(({ provider }, suiteMeta, clientMeta) => {
})
})

describeIf(!clientMeta.dataProxy)('tracing on transactions', () => {
describe('tracing on transactions', () => {
test('$transaction', async () => {
const email = faker.internet.email()

Expand Down Expand Up @@ -756,6 +756,7 @@ testMatrix.setupTestSuite(({ provider }, suiteMeta, clientMeta) => {
})
})

// $connect is a no-op with Data Proxy
describeIf(!clientMeta.dataProxy)('tracing connect', () => {
let _prisma: PrismaClient

Expand Down Expand Up @@ -835,6 +836,7 @@ testMatrix.setupTestSuite(({ provider }, suiteMeta, clientMeta) => {
})
})

// $disconnect is a no-op with Data Proxy
describeIf(!clientMeta.dataProxy)('tracing disconnect', () => {
let _prisma: PrismaClient

Expand Down

0 comments on commit 1758ff0

Please sign in to comment.