Skip to content

Commit

Permalink
test: Ensure correct scope for main process native crashes (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Jan 8, 2024
1 parent bac2501 commit 3e5a2c0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 17 additions & 1 deletion test/e2e/test-apps/native-sentry/main/event.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,23 @@
},
"event_id": "{{id}}",
"timestamp": 0,
"breadcrumbs": [],
"breadcrumbs": [
{
"category": "console",
"level": "log",
"message": "main process breadcrumb from first crashing run"
},
{
"category": "console",
"level": "log",
"message": "renderer process breadcrumb from first crashing run"
},
{
"category": "console",
"level": "log",
"message": "main process breadcrumb from second run"
}
],
"tags": {
"event.environment": "native",
"event.origin": "electron",
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/test-apps/native-sentry/main/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
init({
debug: true,
});

if (process.env.APP_FIRST_RUN) {
console.log('renderer process breadcrumb from first crashing run');
}
</script>
</body>
</html>
6 changes: 5 additions & 1 deletion test/e2e/test-apps/native-sentry/main/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ app.on('ready', () => {
// We only crash on the first run
// The second run is where the crash is uploaded
if (process.env.APP_FIRST_RUN) {
console.log('main process breadcrumb from first crashing run');

setTimeout(() => {
process.crash();
}, 1000);
}, 2000);
} else {
console.log('main process breadcrumb from second run');
}
});

0 comments on commit 3e5a2c0

Please sign in to comment.