Skip to content
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

test: Ensure we properly test trace & span IDs #14520

Merged
merged 2 commits into from
Nov 29, 2024
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Nov 28, 2024

This updates all our tests to properly test for trace ID & span ID shape, instead of just any(String). This should show/avoid having e.g. trace_id: '' or similar somewhere, which would be invalid.

@mydea mydea self-assigned this Nov 28, 2024
@@ -29,7 +29,7 @@ declare var global: any;
const clientEventFromException = jest.spyOn(TestClient.prototype, 'eventFromException');
const clientProcess = jest.spyOn(TestClient.prototype as any, '_process');

jest.spyOn(miscModule, 'uuid4').mockImplementation(() => '42');
jest.spyOn(miscModule, 'uuid4').mockImplementation(() => '12312012123120121231201212312012');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this was too short, the span ID generation, which is uuid4().substring(16) would generate the string ''.

@mydea mydea marked this pull request as ready for review November 28, 2024 11:50
@mydea mydea requested review from a team as code owners November 28, 2024 11:50
@mydea mydea requested review from lforst and removed request for a team November 28, 2024 11:50
@mydea mydea assigned andreiborza and unassigned andreiborza Nov 28, 2024
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thx!

@mydea mydea merged commit 1f08b3b into develop Nov 29, 2024
161 checks passed
@mydea mydea deleted the fn/better-trace-tests branch November 29, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants