test(sveltekit): Add e2e build test for sveltekit#7881
Conversation
57fd26b to
913f680
Compare
| 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
size-limit report 📦
|
d66e8f4 to
76b25f1
Compare
|
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? |
Lms24
left a comment
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
l:
| /* `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?
There was a problem hiding this comment.
I'll update this, applies to kit as well.
packages/e2e-tests/test-applications/sveltekit/src/hooks.server.ts
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,18 @@ | |||
| import adapter from '@sveltejs/adapter-auto'; | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I'll make the switch!
…r.ts Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
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.