Skip to content
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

test(sveltekit): Add e2e build test for sveltekit #7881

Merged
merged 17 commits into from Apr 27, 2023

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Apr 17, 2023

This PR adds e2e build tests for sveltekit.

It does not enable the playwright tests, that needs to be added in a future PR. Given the current time constraints, figured it's best to ship this, and then we can look at enabling the playwright based tests at a later time.

@AbhiPrasad AbhiPrasad force-pushed the abhi-sveltekit-integration-test branch from 57fd26b to 913f680 Compare April 20, 2023 14:48
Comment on lines +78 to +110
const sentryRequest = https.request(
sentryIngestUrl,
{ headers: proxyRequest.headers, method: proxyRequest.method },
sentryResponse => {
sentryResponse.addListener('data', (chunk: Buffer) => {
proxyResponse.write(chunk, 'binary');
sentryResponseChunks.push(chunk);
});

sentryResponse.addListener('end', () => {
eventCallbackListeners.forEach(listener => {
const rawProxyRequestBody = Buffer.concat(proxyRequestChunks).toString();
const rawSentryResponseBody = Buffer.concat(sentryResponseChunks).toString();

const data: SentryRequestCallbackData = {
envelope: parseEnvelope(rawProxyRequestBody, new TextEncoder(), new TextDecoder()),
rawProxyRequestBody,
rawSentryResponseBody,
sentryResponseStatusCode: sentryResponse.statusCode,
};

listener(Buffer.from(JSON.stringify(data)).toString('base64'));
});
proxyResponse.end();
});

sentryResponse.addListener('error', err => {
throw err;
});

proxyResponse.writeHead(sentryResponse.statusCode || 500, sentryResponse.headers);
},
);

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

The
URL
of this request depends on a
user-provided value
.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AbhiPrasad introducing security risks tststs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bruh

@AbhiPrasad AbhiPrasad requested review from lforst and Lms24 April 26, 2023 12:36
@AbhiPrasad AbhiPrasad marked this pull request as ready for review April 26, 2023 12:36
@AbhiPrasad AbhiPrasad changed the title test(sveltekit): Add e2e tests for sveltekit test(sveltekit): Add e2e build test for sveltekit Apr 26, 2023
@AbhiPrasad AbhiPrasad self-assigned this Apr 26, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 27, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.02 KB (-0.02% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 65.66 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.56 KB (-0.01% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 58.12 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 21.17 KB (0%)
@sentry/browser - Webpack (minified) 69.07 KB (0%)
@sentry/react - Webpack (gzipped + minified) 21.19 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 49.03 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.59 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.82 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 46.81 KB (-0.01% 🔽)
@sentry/replay - Webpack (gzipped + minified) 40.59 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 65.62 KB (-0.01% 🔽)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 58.57 KB (-0.01% 🔽)

@AbhiPrasad AbhiPrasad force-pushed the abhi-sveltekit-integration-test branch from d66e8f4 to 76b25f1 Compare April 27, 2023 09:22
@AbhiPrasad
Copy link
Member Author

hmm @lforst any idea why the e2e tests are failing?

@lforst
Copy link
Member

lforst commented Apr 27, 2023

hmm @lforst any idea why the e2e tests are failing?

@AbhiPrasad this usually happens when something on the sentry side of things is messed up. Did you commit any tokens or configuration related to the tests?

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Build tests are a good start. Let's try to change to the Node adapter and ensure we upload source maps but as I wrote in a comment, we can def tackle this is a separate PR.

fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* `next dev` is incredibly buggy with the app dir */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l:

Suggested change
/* `next dev` is incredibly buggy with the app dir */
/* `next dev` is incredibly buggy with the app dir */

Should we just change the comment or does this not apply to Kit in general?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this, applies to kit as well.

@@ -0,0 +1,18 @@
import adapter from '@sveltejs/adapter-auto';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: So, I think we should be testing against the node adapter rather than the default one, since it is the one we support. Especially, because we want to make sure our source maps upload configuration doesn't break the adapter build. I saw that currently source maps upload is deactivated anyway so I'm find with changing/revisiting this in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make the switch!

@AbhiPrasad AbhiPrasad merged commit cc61369 into develop Apr 27, 2023
32 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-sveltekit-integration-test branch April 27, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants