Skip to content

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
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
@mydea mydea requested a review from andreiborza November 28, 2024 11:51
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