Skip to content

fix(tests): Limit Remix server integration test stacktrace length. #5711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"test:integration:clean": "(cd test/integration && rimraf .cache node_modules build)",
"test:integration:client": "yarn playwright install-deps && yarn playwright test test/integration/test/client/",
"test:integration:client:ci": "yarn test:integration:client --browser='all' --reporter='line'",
"test:integration:server": "jest --config=test/integration/jest.config.js test/integration/test/server/",
"test:integration:server": "export NODE_OPTIONS='--stack-trace-limit=25' && jest --config=test/integration/jest.config.js test/integration/test/server/",
"test:unit": "jest",
"test:watch": "jest --watch"
},
Expand Down
10 changes: 8 additions & 2 deletions packages/remix/test/integration/test/server/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ describe.each(['builtin', 'express'])('Remix API Actions with adapter = %s', ada
const env = await RemixTestEnv.init(adapter);
const url = `${env.url}/action-json-response/-1`;

const [transaction, event] = await env.getMultipleEnvelopeRequest({
const envelopes = await env.getMultipleEnvelopeRequest({
url,
count: 2,
method: 'post',
envelopeType: ['transaction', 'event'],
});

const [transaction] = envelopes.filter(envelope => envelope[1].type === 'transaction');
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');

assertSentryTransaction(transaction[2], {
contexts: {
trace: {
Expand Down Expand Up @@ -79,13 +82,16 @@ describe.each(['builtin', 'express'])('Remix API Actions with adapter = %s', ada
const env = await RemixTestEnv.init(adapter);
const url = `${env.url}/action-json-response/-2`;

const [transaction_1, event, transaction_2] = await env.getMultipleEnvelopeRequest({
const envelopes = await env.getMultipleEnvelopeRequest({
url,
count: 3,
method: 'post',
envelopeType: ['transaction', 'event'],
});

const [transaction_1, transaction_2] = envelopes.filter(envelope => envelope[1].type === 'transaction');
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');

assertSentryTransaction(transaction_1[2], {
contexts: {
trace: {
Expand Down
5 changes: 4 additions & 1 deletion packages/remix/test/integration/test/server/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ describe.each(['builtin', 'express'])('Remix API Loaders with adapter = %s', ada
const env = await RemixTestEnv.init(adapter);
const url = `${env.url}/loader-json-response/-1`;

const [transaction_1, event, transaction_2] = await env.getMultipleEnvelopeRequest({
const envelopes = await env.getMultipleEnvelopeRequest({
url,
count: 3,
envelopeType: ['transaction', 'event'],
});

const [transaction_1, transaction_2] = envelopes.filter(envelope => envelope[1].type === 'transaction');
const [event] = envelopes.filter(envelope => envelope[1].type === 'event');

assertSentryTransaction(transaction_1[2], {
contexts: {
trace: {
Expand Down