Skip to content

Update unit tests for traceflags 02,03#766

Merged
tammy-baylis-swi merged 1 commit into
mainfrom
update-traceflags-tests
May 5, 2026
Merged

Update unit tests for traceflags 02,03#766
tammy-baylis-swi merged 1 commit into
mainfrom
update-traceflags-tests

Conversation

@tammy-baylis-swi
Copy link
Copy Markdown
Contributor

@tammy-baylis-swi tammy-baylis-swi commented May 4, 2026

Updates unit test coverage as evidence that traceflags 02, 03 are valid for existing APM Python custom sampling and propagation logic.

See ticket for more background information.

Copilot AI review requested due to automatic review settings May 4, 2026 19:40
@tammy-baylis-swi tammy-baylis-swi requested review from a team as code owners May 4, 2026 19:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates unit tests to explicitly demonstrate that trace flags 0x02 and 0x03 are treated as valid inputs by the existing SolarWinds APM W3C formatting, propagation injection, and custom sampling override behavior.

Changes:

  • Expanded W3CTransformer.trace_flags_from_int unit test to cover additional flag values including 0x02 and 0x03.
  • Updated propagator test helpers and added injection tests to verify -02 / -03 are preserved in newly created tracestate.
  • Added sampler tests to verify sw tracestate decisions -02/-03 override contradictory W3C trace_flags sampled/default state.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/unit/test_w3c_transformer.py Parametrizes trace-flags formatting assertions to cover 0003 (and a non-trivial hex value).
tests/unit/test_propagator.py Allows mocking non-0x01 trace flags and adds injection tests ensuring -02/-03 are preserved in generated tracestate.
tests/unit/test_oboe/test_oboe_sampler.py Adds sampling tests proving sw tracestate -02/-03 overrides opposing W3C sampled/default flags.

Copy link
Copy Markdown
Contributor

@cheempz cheempz left a comment

Choose a reason for hiding this comment

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

LGTM

@tammy-baylis-swi tammy-baylis-swi merged commit 435fcca into main May 5, 2026
73 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants