Skip to content

Commit e28d491

Browse files
author
Luca Forstner
authored
ci(e2e-test): Switch to https://example.com` from http equivalent for Next.js e2e tests (#15052)
1 parent aeedf31 commit e28d491

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

dev-packages/e2e-tests/test-applications/nextjs-13/pages/fetch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useEffect } from 'react';
33
export default function FetchPage() {
44
useEffect(() => {
55
// test that a span is created in the pageload transaction for this fetch request
6-
fetch('http://example.com').catch(() => {
6+
fetch('https://example.com').catch(() => {
77
// no-empty
88
});
99
}, []);

dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/fetch.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
22
import { waitForTransaction } from '@sentry-internal/test-utils';
33

44
test('should correctly instrument `fetch` for performance tracing', async ({ page }) => {
5-
await page.route('http://example.com/**/*', route => {
5+
await page.route('https://example.com/**/*', route => {
66
return route.fulfill({
77
status: 200,
88
body: JSON.stringify({
@@ -34,16 +34,16 @@ test('should correctly instrument `fetch` for performance tracing', async ({ pag
3434
expect.objectContaining({
3535
data: {
3636
'http.method': 'GET',
37-
url: 'http://example.com',
38-
'http.url': 'http://example.com/',
37+
url: 'https://example.com',
38+
'http.url': 'https://example.com/',
3939
'server.address': 'example.com',
4040
type: 'fetch',
4141
'http.response_content_length': expect.any(Number),
4242
'http.response.status_code': 200,
4343
'sentry.op': 'http.client',
4444
'sentry.origin': 'auto.http.browser',
4545
},
46-
description: 'GET http://example.com',
46+
description: 'GET https://example.com',
4747
op: 'http.client',
4848
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
4949
span_id: expect.stringMatching(/[a-f0-9]{16}/),

dev-packages/e2e-tests/test-applications/nextjs-14/app/request-instrumentation/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import http from 'http';
1+
import https from 'https';
22

33
export const dynamic = 'force-dynamic';
44

55
export default async function Page() {
6-
await fetch('http://example.com/', { cache: 'no-cache' }).then(res => res.text());
6+
await fetch('https://example.com/', { cache: 'no-cache' }).then(res => res.text());
77
await new Promise<void>(resolve => {
8-
http.get('http://example.com/', res => {
8+
https.get('https://example.com/', res => {
99
res.on('data', () => {
1010
// Noop consuming some data so that request can close :)
1111
});

dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test('Should send a transaction with a fetch span', async ({ page }) => {
1919
'sentry.op': 'http.client',
2020
'sentry.origin': 'auto.http.otel.node_fetch',
2121
}),
22-
description: 'GET http://example.com/',
22+
description: 'GET https://example.com/',
2323
}),
2424
);
2525

@@ -30,7 +30,7 @@ test('Should send a transaction with a fetch span', async ({ page }) => {
3030
'sentry.op': 'http.client',
3131
'sentry.origin': 'auto.http.otel.http',
3232
}),
33-
description: 'GET http://example.com/',
33+
description: 'GET https://example.com/',
3434
}),
3535
);
3636
});

dev-packages/e2e-tests/test-applications/nextjs-15/app/pageload-tracing/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default async function Page() {
66
}
77

88
export async function generateMetadata() {
9-
(await fetch('http://example.com/', { cache: 'no-store' })).text();
9+
(await fetch('https://example.com/', { cache: 'no-store' })).text();
1010

1111
return {
1212
title: 'my title',

dev-packages/e2e-tests/test-applications/nextjs-15/app/suspense-error/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const dynamic = 'force-dynamic';
44

55
export default async function Page() {
66
try {
7-
use(fetch('http://example.com/'));
7+
use(fetch('https://example.com/'));
88
} catch (e) {
99
Sentry.captureException(e); // This error should not be reported
1010
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for any async event processors to run

dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/server-action/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function ServerComponent() {
99
'myServerAction',
1010
{ formData, headers: headers(), recordResponse: true },
1111
async () => {
12-
await fetch('http://example.com/');
12+
await fetch('https://example.com/');
1313
return { city: 'Vienna' };
1414
},
1515
);

dev-packages/e2e-tests/test-applications/nextjs-app-dir/pages/api/request-instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NextApiRequest, NextApiResponse } from 'next';
33

44
export default (_req: NextApiRequest, res: NextApiResponse) => {
55
// make an outgoing request in order to test that the `Http` integration creates a span
6-
get('http://example.com/', message => {
6+
get('https://example.com/', message => {
77
message.on('data', () => {
88
// Noop consuming some data so that request can close :)
99
});

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/request-instrumentation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test.skip('Should send a transaction with a http span', async ({ request }) => {
1818
'sentry.op': 'http.client',
1919
'sentry.origin': 'auto.http.otel.http',
2020
}),
21-
description: 'GET http://example.com/',
21+
description: 'GET https://example.com/',
2222
}),
2323
);
2424
});

0 commit comments

Comments
 (0)