-
-
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.
Merge branch 'develop' into sig/nuxt-server
- Loading branch information
Showing
68 changed files
with
510 additions
and
327 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
138 changes: 2 additions & 136 deletions
138
dev-packages/browser-integration-tests/fixtures/loader.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...ages/browser-integration-tests/suites/integrations/moduleMetadata/appliesMetadata/init.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,28 @@ | ||
import * as Sentry from '@sentry/browser'; | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
integrations: [Sentry.moduleMetadataIntegration()], | ||
beforeSend(event) { | ||
const moduleMetadataEntries = []; | ||
|
||
if (event.type === undefined) { | ||
try { | ||
event.exception.values.forEach(value => { | ||
value.stacktrace.frames.forEach(frame => { | ||
moduleMetadataEntries.push(frame.module_metadata); | ||
}); | ||
}); | ||
} catch (e) { | ||
// noop | ||
} | ||
} | ||
|
||
event.extra = { | ||
...event.extra, | ||
module_metadata_entries: moduleMetadataEntries, | ||
}; | ||
|
||
return event; | ||
}, | ||
}); |
22 changes: 22 additions & 0 deletions
22
...s/browser-integration-tests/suites/integrations/moduleMetadata/appliesMetadata/subject.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,22 @@ | ||
var _sentryModuleMetadataGlobal = | ||
typeof window !== 'undefined' | ||
? window | ||
: typeof global !== 'undefined' | ||
? global | ||
: typeof self !== 'undefined' | ||
? self | ||
: {}; | ||
|
||
_sentryModuleMetadataGlobal._sentryModuleMetadata = _sentryModuleMetadataGlobal._sentryModuleMetadata || {}; | ||
|
||
_sentryModuleMetadataGlobal._sentryModuleMetadata[new Error().stack] = Object.assign( | ||
{}, | ||
_sentryModuleMetadataGlobal._sentryModuleMetadata[new Error().stack], | ||
{ | ||
foo: 'bar', | ||
}, | ||
); | ||
|
||
setTimeout(() => { | ||
throw new Error('I am a module metadata Error'); | ||
}, 0); |
17 changes: 17 additions & 0 deletions
17
...ages/browser-integration-tests/suites/integrations/moduleMetadata/appliesMetadata/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,17 @@ | ||
import { expect } from '@playwright/test'; | ||
import type { Event } from '@sentry/types'; | ||
|
||
import { sentryTest } from '../../../../utils/fixtures'; | ||
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; | ||
|
||
sentryTest('should provide module_metadata on stack frames in beforeSend', async ({ getLocalTestPath, page }) => { | ||
// moduleMetadataIntegration is not included in any CDN bundles | ||
if (process.env.PW_BUNDLE?.startsWith('bundle')) { | ||
sentryTest.skip(); | ||
} | ||
|
||
const url = await getLocalTestPath({ testDir: __dirname }); | ||
|
||
const errorEvent = await getFirstSentryEnvelopeRequest<Event>(page, url); | ||
expect(errorEvent.extra?.['module_metadata_entries']).toEqual([{ foo: 'bar' }]); | ||
}); |
38 changes: 38 additions & 0 deletions
38
...gration-tests/suites/integrations/moduleMetadata/appliesMetadataWithRewriteFrames/init.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,38 @@ | ||
import * as Sentry from '@sentry/browser'; | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
integrations: [ | ||
Sentry.moduleMetadataIntegration(), | ||
Sentry.rewriteFramesIntegration({ | ||
iteratee: frame => { | ||
return { | ||
...frame, | ||
filename: 'bloop', // something that should completely mess with module metadata association | ||
}; | ||
}, | ||
}), | ||
], | ||
beforeSend(event) { | ||
const moduleMetadataEntries = []; | ||
|
||
if (event.type === undefined) { | ||
try { | ||
event.exception.values.forEach(value => { | ||
value.stacktrace.frames.forEach(frame => { | ||
moduleMetadataEntries.push(frame.module_metadata); | ||
}); | ||
}); | ||
} catch (e) { | ||
// noop | ||
} | ||
} | ||
|
||
event.extra = { | ||
...event.extra, | ||
module_metadata_entries: moduleMetadataEntries, | ||
}; | ||
|
||
return event; | ||
}, | ||
}); |
22 changes: 22 additions & 0 deletions
22
...tion-tests/suites/integrations/moduleMetadata/appliesMetadataWithRewriteFrames/subject.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,22 @@ | ||
var _sentryModuleMetadataGlobal = | ||
typeof window !== 'undefined' | ||
? window | ||
: typeof global !== 'undefined' | ||
? global | ||
: typeof self !== 'undefined' | ||
? self | ||
: {}; | ||
|
||
_sentryModuleMetadataGlobal._sentryModuleMetadata = _sentryModuleMetadataGlobal._sentryModuleMetadata || {}; | ||
|
||
_sentryModuleMetadataGlobal._sentryModuleMetadata[new Error().stack] = Object.assign( | ||
{}, | ||
_sentryModuleMetadataGlobal._sentryModuleMetadata[new Error().stack], | ||
{ | ||
foo: 'baz', | ||
}, | ||
); | ||
|
||
setTimeout(() => { | ||
throw new Error('I am a module metadata Error'); | ||
}, 0); |
20 changes: 20 additions & 0 deletions
20
...gration-tests/suites/integrations/moduleMetadata/appliesMetadataWithRewriteFrames/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,20 @@ | ||
import { expect } from '@playwright/test'; | ||
import type { Event } from '@sentry/types'; | ||
|
||
import { sentryTest } from '../../../../utils/fixtures'; | ||
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; | ||
|
||
sentryTest( | ||
'should provide module_metadata on stack frames in beforeSend even though an event processor (rewriteFramesIntegration) modified the filename', | ||
async ({ getLocalTestPath, page }) => { | ||
// moduleMetadataIntegration is not included in any CDN bundles | ||
if (process.env.PW_BUNDLE?.startsWith('bundle')) { | ||
sentryTest.skip(); | ||
} | ||
|
||
const url = await getLocalTestPath({ testDir: __dirname }); | ||
|
||
const errorEvent = await getFirstSentryEnvelopeRequest<Event>(page, url); | ||
expect(errorEvent?.extra?.['module_metadata_entries']).toEqual([{ foo: 'baz' }]); | ||
}, | ||
); |
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
3 changes: 2 additions & 1 deletion
3
dev-packages/e2e-tests/test-applications/nestjs/src/app.module.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
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
Oops, something went wrong.