Parametrized trace context extraction tests.#456
Conversation
tests/test_tracing.py
Outdated
|
|
||
|
|
||
| _test_extract_dd_trace_context = ( | ||
| ("api-gateway", Context(trace_id=12345, span_id=67890, sampling_priority=2)), |
There was a problem hiding this comment.
Question, is there any difference if we just use the same Context object for all of them? I.e. data is the same, as opposed to changing the trace_id, span_id and sampling_priority all the time?
I see some of them have different sampling priority, but I don't understand why they have different trace_id/span_id, is it important in those cases?
There was a problem hiding this comment.
I suspect the reason why the trace/span ids are different is because these values are pulled from the event json itself from the text fixture file. Bringing these into alignment would mean changing those fixtures and could have impacts on other tests as well.
There was a problem hiding this comment.
Thanks – makes sense, appreciate it
What does this PR do?
Parameterize some of the trace extraction tests.
Motivation
Clearer. Easier. Prettier.
Testing Guidelines
Additional Notes
There are still more trace extraction tests in there, I am thinking to move those others into this single parameterized test soon.
Types of Changes
Check all that apply