-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge branch 'develop' into bo-amqplib
- Loading branch information
Showing
47 changed files
with
842 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...s/e2e-tests/test-applications/nextjs-app-dir/app/navigation/[param]/browser-back/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Link from 'next/link'; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export default function Page() { | ||
return <Link href="/navigation">Go back home</Link>; | ||
} |
7 changes: 7 additions & 0 deletions
7
...s/e2e-tests/test-applications/nextjs-app-dir/app/navigation/[param]/link-replace/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Link from 'next/link'; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export default function Page() { | ||
return <Link href="/navigation">Go back home</Link>; | ||
} |
7 changes: 7 additions & 0 deletions
7
dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/navigation/[param]/link/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Link from 'next/link'; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export default function Page() { | ||
return <Link href="/navigation">Go back home</Link>; | ||
} |
7 changes: 7 additions & 0 deletions
7
...es/e2e-tests/test-applications/nextjs-app-dir/app/navigation/[param]/router-back/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Link from 'next/link'; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export default function Page() { | ||
return <Link href="/navigation">Go back home</Link>; | ||
} |
5 changes: 5 additions & 0 deletions
5
...es/e2e-tests/test-applications/nextjs-app-dir/app/navigation/[param]/router-push/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const dynamic = 'force-dynamic'; | ||
|
||
export default function Page() { | ||
return <p>hello world</p>; | ||
} |
5 changes: 5 additions & 0 deletions
5
...e2e-tests/test-applications/nextjs-app-dir/app/navigation/[param]/router-replace/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const dynamic = 'force-dynamic'; | ||
|
||
export default function Page() { | ||
return <p>hello world</p>; | ||
} |
57 changes: 57 additions & 0 deletions
57
dev-packages/e2e-tests/test-applications/nextjs-app-dir/app/navigation/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
import { useRouter } from 'next/navigation'; | ||
|
||
export default function Page() { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<ul> | ||
<li> | ||
<button | ||
onClick={() => { | ||
router.push('/navigation/42/router-push'); | ||
}} | ||
> | ||
router.push() | ||
</button> | ||
</li> | ||
<li> | ||
<button | ||
onClick={() => { | ||
router.replace('/navigation/42/router-replace'); | ||
}} | ||
> | ||
router.replace() | ||
</button> | ||
</li> | ||
<li> | ||
<button | ||
onClick={() => { | ||
router.forward(); | ||
}} | ||
> | ||
router.forward() | ||
</button> | ||
</li> | ||
<li> | ||
<button | ||
onClick={() => { | ||
router.back(); | ||
}} | ||
> | ||
router.back() | ||
</button> | ||
</li> | ||
<li> | ||
<Link href="/navigation/42/link">Normal Link</Link> | ||
</li> | ||
<li> | ||
<Link href="/navigation/42/link-replace" replace> | ||
Link Replace | ||
</Link> | ||
</li> | ||
</ul> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
dev-packages/node-integration-tests/suites/tracing/dataloader/scenario.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { loggingTransport, startExpressServerAndSendPortToRunner } = require('@sentry-internal/node-integration-tests'); | ||
const Sentry = require('@sentry/node'); | ||
|
||
Sentry.init({ | ||
dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
release: '1.0', | ||
tracesSampleRate: 1.0, | ||
transport: loggingTransport, | ||
}); | ||
|
||
const PORT = 8008; | ||
|
||
// Stop the process from exiting before the transaction is sent | ||
setInterval(() => {}, 1000); | ||
|
||
const run = async () => { | ||
const express = require('express'); | ||
const Dataloader = require('dataloader'); | ||
|
||
const app = express(); | ||
const dataloader = new Dataloader(async keys => keys.map((_, idx) => idx), { | ||
cache: false, | ||
}); | ||
|
||
app.get('/', (req, res) => { | ||
const user = dataloader.load('user-1'); | ||
res.send(user); | ||
}); | ||
|
||
startExpressServerAndSendPortToRunner(app, PORT); | ||
}; | ||
|
||
run(); |
40 changes: 40 additions & 0 deletions
40
dev-packages/node-integration-tests/suites/tracing/dataloader/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { cleanupChildProcesses, createRunner } from '../../../utils/runner'; | ||
|
||
describe('dataloader auto-instrumentation', () => { | ||
afterAll(async () => { | ||
cleanupChildProcesses(); | ||
}); | ||
|
||
const EXPECTED_TRANSACTION = { | ||
transaction: 'GET /', | ||
spans: expect.arrayContaining([ | ||
expect.objectContaining({ | ||
data: expect.objectContaining({ | ||
'sentry.origin': 'auto.db.otel.dataloader', | ||
'sentry.op': 'cache.get', | ||
}), | ||
description: 'dataloader.load', | ||
origin: 'auto.db.otel.dataloader', | ||
op: 'cache.get', | ||
status: 'ok', | ||
}), | ||
expect.objectContaining({ | ||
data: expect.objectContaining({ | ||
'sentry.origin': 'auto.db.otel.dataloader', | ||
'sentry.op': 'cache.get', | ||
}), | ||
description: 'dataloader.batch', | ||
origin: 'auto.db.otel.dataloader', | ||
op: 'cache.get', | ||
status: 'ok', | ||
}), | ||
]), | ||
}; | ||
|
||
test('should auto-instrument `dataloader` package.', done => { | ||
createRunner(__dirname, 'scenario.js') | ||
.expect({ transaction: EXPECTED_TRANSACTION }) | ||
.start(done) | ||
.makeRequest('get', '/'); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
dev-packages/node-integration-tests/suites/tracing/meta-tags-twp-errors/no-server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { loggingTransport } = require('@sentry-internal/node-integration-tests'); | ||
const Sentry = require('@sentry/node'); | ||
|
||
Sentry.init({ | ||
dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
release: '1.0', | ||
transport: loggingTransport, | ||
beforeSend(event) { | ||
event.contexts = { | ||
...event.contexts, | ||
traceData: { | ||
...Sentry.getTraceData(), | ||
metaTags: Sentry.getTraceMetaTags(), | ||
}, | ||
}; | ||
return event; | ||
}, | ||
}); | ||
|
||
Sentry.captureException(new Error('test error')); |
Oops, something went wrong.