Skip to content

Commit 9c01fcc

Browse files
authored
fix(tests): Limit Remix server integration test stacktrace length. (#5711)
Related: #5650 Limited maximum stacktrace length for Remix server-side integration tests. Also updated tests to filter by type and separate consecutive multi-type envelopes, and not to trust the capturing order.
1 parent efd32f0 commit 9c01fcc

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

packages/remix/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"test:integration:clean": "(cd test/integration && rimraf .cache node_modules build)",
6767
"test:integration:client": "yarn playwright install-deps && yarn playwright test test/integration/test/client/",
6868
"test:integration:client:ci": "yarn test:integration:client --browser='all' --reporter='line'",
69-
"test:integration:server": "jest --config=test/integration/jest.config.js test/integration/test/server/",
69+
"test:integration:server": "export NODE_OPTIONS='--stack-trace-limit=25' && jest --config=test/integration/jest.config.js test/integration/test/server/",
7070
"test:unit": "jest",
7171
"test:watch": "jest --watch"
7272
},

packages/remix/test/integration/test/server/action.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ describe.each(['builtin', 'express'])('Remix API Actions with adapter = %s', ada
3737
const env = await RemixTestEnv.init(adapter);
3838
const url = `${env.url}/action-json-response/-1`;
3939

40-
const [transaction, event] = await env.getMultipleEnvelopeRequest({
40+
const envelopes = await env.getMultipleEnvelopeRequest({
4141
url,
4242
count: 2,
4343
method: 'post',
4444
envelopeType: ['transaction', 'event'],
4545
});
4646

47+
const [transaction] = envelopes.filter(envelope => envelope[1].type === 'transaction');
48+
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');
49+
4750
assertSentryTransaction(transaction[2], {
4851
contexts: {
4952
trace: {
@@ -79,13 +82,16 @@ describe.each(['builtin', 'express'])('Remix API Actions with adapter = %s', ada
7982
const env = await RemixTestEnv.init(adapter);
8083
const url = `${env.url}/action-json-response/-2`;
8184

82-
const [transaction_1, event, transaction_2] = await env.getMultipleEnvelopeRequest({
85+
const envelopes = await env.getMultipleEnvelopeRequest({
8386
url,
8487
count: 3,
8588
method: 'post',
8689
envelopeType: ['transaction', 'event'],
8790
});
8891

92+
const [transaction_1, transaction_2] = envelopes.filter(envelope => envelope[1].type === 'transaction');
93+
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');
94+
8995
assertSentryTransaction(transaction_1[2], {
9096
contexts: {
9197
trace: {

packages/remix/test/integration/test/server/loader.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,15 @@ describe.each(['builtin', 'express'])('Remix API Loaders with adapter = %s', ada
7777
const env = await RemixTestEnv.init(adapter);
7878
const url = `${env.url}/loader-json-response/-1`;
7979

80-
const [transaction_1, event, transaction_2] = await env.getMultipleEnvelopeRequest({
80+
const envelopes = await env.getMultipleEnvelopeRequest({
8181
url,
8282
count: 3,
8383
envelopeType: ['transaction', 'event'],
8484
});
8585

86+
const [transaction_1, transaction_2] = envelopes.filter(envelope => envelope[1].type === 'transaction');
87+
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');
88+
8689
assertSentryTransaction(transaction_1[2], {
8790
contexts: {
8891
trace: {

0 commit comments

Comments
 (0)