-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(astro-5): Add test for current parametrized routes #17054
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
Conversation
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.
Thanks for adding this test, solid base for further work!
expect(serverRequestHTTPClientSpan).toMatchObject({ | ||
op: 'http.client', | ||
origin: 'auto.http.otel.node_fetch', | ||
description: 'GET http://localhost:3030/api/user/myUsername123.json', // todo: parametrize (this is just a span though - no transaction) |
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.
l: the http.client
span doesn't need to be parameterized -- no need for the todo :)
|
||
// Client pageload transaction - actual URL with pageload operation | ||
expect(clientPageloadTxn).toMatchObject({ | ||
transaction: '/user-page/myUsername123', // todo: parametrize to '/user-page/[userId]' |
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.
not sure if you already thought of a way how to achieve this (if so, ignore me :D) but: We could inject the parameterized route we identify on the server into a tag just like we do with the trace data.
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.
I already found something :D
working on this in another PR. The parametrized route is in the context of the astro request so this is fairly easy.
Adds a test case with a client, server and server API request which checks: - that everything is correctly connected - that everything has parametrized routes (the current state of it - some are not yet parametrized) This is a visual representation of the test case (with a different param): <img width="502" height="197" alt="image" src="https://github.com/user-attachments/assets/e1a14c2b-2547-427b-964b-5c8fb6db49a2" /> Part of #16686
Adds a test case with a client, server and server API request which checks:
This is a visual representation of the test case (with a different param):

Part of #16686