-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ref: Migrate internal spanToJSON callers to spanToStreamedSpanJSON
#23237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6f5abc4
e570d21
5a5e29a
3e9e966
f38f841
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import type { SpanJSON } from '@sentry/core'; | ||
| import type { StreamedSpanJSON } from '@sentry/core'; | ||
| import { sentryTest } from '../../../../utils/fixtures'; | ||
| import { shouldSkipTracingTest } from '../../../../utils/helpers'; | ||
|
|
||
|
|
@@ -12,25 +12,26 @@ | |
| await page.goto(url); | ||
|
|
||
| await page.locator('#start-span').click(); | ||
| const spanJsonBefore: SpanJSON = await page.evaluate('window.getSpanJson()'); | ||
| const spanJsonBefore: StreamedSpanJSON = await page.evaluate('window.getSpanJson()'); | ||
|
|
||
| const id_before = spanJsonBefore.span_id; | ||
| const description_before = spanJsonBefore.description; | ||
| const name_before = spanJsonBefore.name; | ||
| const status_before = spanJsonBefore.status; | ||
|
|
||
| expect(description_before).toBe('test-span'); | ||
| expect(name_before).toBe('test-span'); | ||
|
Check failure on line 21 in dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/backgroundtab-custom/test.ts
|
||
| expect(status_before).toBe('ok'); | ||
|
|
||
| await page.locator('#go-background').click(); | ||
| const spanJsonAfter: SpanJSON = await page.evaluate('window.getSpanJson()'); | ||
| const spanJsonAfter: StreamedSpanJSON = await page.evaluate('window.getSpanJson()'); | ||
|
|
||
| const id_after = spanJsonAfter.span_id; | ||
| const description_after = spanJsonAfter.description; | ||
| const status_after = spanJsonAfter.status; | ||
| const data_after = spanJsonAfter.data; | ||
| const name_after = spanJsonAfter.name; | ||
| const attributes_after = spanJsonAfter.attributes; | ||
|
|
||
| expect(id_before).toBe(id_after); | ||
| expect(description_after).toBe(description_before); | ||
| expect(status_after).toBe('cancelled'); | ||
| expect(data_after?.['sentry.cancellation_reason']).toBe('document.hidden'); | ||
| expect(name_after).toBe(name_before); | ||
| // a cancelled span is reported as `ok`, with the raw status kept as an attribute | ||
| expect(spanJsonAfter.status).toBe('ok'); | ||
| expect(attributes_after['sentry.status.message']).toBeUndefined(); | ||
| expect(attributes_after['sentry.cancellation_reason']).toBe('document.hidden'); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Background-tab test fixture mismatchMedium Severity The test types and asserts on Triggered by project rule: PR Review Guidelines for Cursor Bot Reviewed by Cursor Bugbot for commit f38f841. Configure here. |
||
| }); | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Async-spans test reads wrong fields
Medium Severity
The test now reads
.namefrom the waiting spans, butsubject.jsstill storesspanToJSON(...)results that expose.description. Those assertions will getundefinedand fail.Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit f38f841. Configure here.