Skip to content

Commit 9995960

Browse files
committed
Disable integration test on Node 10.
1 parent 836a6dd commit 9995960

File tree

1 file changed

+28
-24
lines changed
  • packages/node-integration-tests/suites/tracing/apollo-graphql

1 file changed

+28
-24
lines changed
Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
1-
import { assertSentryTransaction, getEnvelopeRequest, runServer } from '../../../utils';
1+
import { assertSentryTransaction, conditionalTest, getEnvelopeRequest, runServer } from '../../../utils';
22

3-
test('should instrument GraphQL and Apollo Server.', async () => {
4-
const url = await runServer(__dirname);
5-
const envelope = await getEnvelopeRequest(url);
3+
// Node 10 is not supported by `graphql-js`
4+
// Ref: https://github.com/graphql/graphql-js/blob/main/package.json
5+
conditionalTest({ min: 12 })('GraphQL/Apollo Tests', () => {
6+
test('should instrument GraphQL and Apollo Server.', async () => {
7+
const url = await runServer(__dirname);
8+
const envelope = await getEnvelopeRequest(url);
69

7-
expect(envelope).toHaveLength(3);
10+
expect(envelope).toHaveLength(3);
811

9-
const transaction = envelope[2];
10-
const parentSpanId = (transaction as any)?.contexts?.trace?.span_id;
11-
const graphqlSpanId = (transaction as any)?.spans?.[0].span_id;
12+
const transaction = envelope[2];
13+
const parentSpanId = (transaction as any)?.contexts?.trace?.span_id;
14+
const graphqlSpanId = (transaction as any)?.spans?.[0].span_id;
1215

13-
expect(parentSpanId).toBeDefined();
14-
expect(graphqlSpanId).toBeDefined();
16+
expect(parentSpanId).toBeDefined();
17+
expect(graphqlSpanId).toBeDefined();
1518

16-
assertSentryTransaction(transaction, {
17-
transaction: 'test_transaction',
18-
spans: [
19-
{
20-
description: 'execute',
21-
op: 'db.graphql',
22-
parent_span_id: parentSpanId,
23-
},
24-
{
25-
description: 'Query.hello',
26-
op: 'db.graphql.apollo',
27-
parent_span_id: graphqlSpanId,
28-
},
29-
],
19+
assertSentryTransaction(transaction, {
20+
transaction: 'test_transaction',
21+
spans: [
22+
{
23+
description: 'execute',
24+
op: 'db.graphql',
25+
parent_span_id: parentSpanId,
26+
},
27+
{
28+
description: 'Query.hello',
29+
op: 'db.graphql.apollo',
30+
parent_span_id: graphqlSpanId,
31+
},
32+
],
33+
});
3034
});
3135
});

0 commit comments

Comments
 (0)