Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Sep 27, 2024
1 parent 22124e0 commit 1886c87
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SvelteKit 2 TwP
# Tracing Without Performance E2E test app

E2E test app for testing Tracing Without Performance in a (SvelteKit) meta framework scenario

Add tests to this app that specifically test TwP in meta frameworks.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Sentry.init({
dsn: env.PUBLIC_E2E_TEST_DSN,
release: '1.0.0',
tunnel: `http://localhost:3031/`, // proxy server
beforeSend(event) {
console.log('beforeSend', event.contexts?.trace?.trace_id);
return event;
},
});

const myErrorHandler = ({ error, event }: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: E2E_TEST_DSN,
tunnel: `http://localhost:3031/`, // proxy server
beforeSend(event) {
console.log('beforeSend', event.contexts?.trace?.trace_id);
return event;
},
});

// not logging anything to console to avoid noise in the test output
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
<script lang="ts">
import { onMount } from "svelte";
onMount(() => {
// Indicate that the SvelteKit app was hydrated
document.body.classList.add("hydrated");
});
</script>

<h1>Sveltekit E2E Test app</h1>
<div data-sveltekit-preload-data="off">
<slot></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import * as Sentry from '@sentry/sveltekit';

export const load = async ({ url }) => {
if (!url.search) {
console.log('traceData: ', Sentry.getTraceData());
console.log('spanToTrace', Sentry.spanToTraceHeader(Sentry.getActiveSpan()!));
console.log('activeSpan', Sentry.getActiveSpan());
Sentry.captureException(new Error('No search query provided'));
return {
error: 'No search query provided',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<script lang="ts">
import { onMount } from 'svelte';
import * as Sentry from '@sentry/sveltekit';
export let data;
onMount(() => {
if (data.error) {
console.log(Sentry.getTraceData());
throw new Error('Client Error');
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';

test('errors on frontend and backend are connected by the same trace', async ({ page }) => {
const clientErrorPromise = waitForError('sveltekit-2-twp', evt => {
return evt.exception?.values?.[0].value === 'Client Error';
Expand Down

0 comments on commit 1886c87

Please sign in to comment.