Expand test coverage for Baggage Encoding#6919
Expand test coverage for Baggage Encoding#6919VanshikaNavya wants to merge 6 commits intoopen-telemetry:mainfrom
Conversation
|
@VanshikaNavya I left a comment on the issue just now about whether this component has long term need or not. Irrespective, this additional tests are good. As an extra step, I also wonder if these should be replicated to the Baggage propagator code in the .NET runtime repo itself. @xiang17 might know as he has already fixed some issues in the .NET runtime repo about W3C propagators long ago. |
@cijothomas Thanks for raising that. I’m honestly not sure whether these tests should also be replicated in the .NET runtime repository. My current goal is to align the OpenTelemetry baggage propagator behavior with the W3C spec test cases (https://github.com/w3c/baggage/blob/main/test/test_baggage.py), as mentioned in the issue. Some of these tests are currently failing. For example, cases where values after ; are not being ignored as expected by the spec. Should I include the corresponding fixes in this PR to make the implementation fully spec-compliant, or would you prefer handling that separately? @xiang17 if the Baggage implementation in the .NET runtime is also expected to strictly follow the W3C baggage parsing rules, should similar tests be added there as well? And if so, would that require a separate PR in dotnet/runtime? |
|
@cijothomas @Kielek @martincostello I have added 13 test cases with reference to https://github.com/w3c/baggage/blob/main/test/test_baggage.py as mentioned in the issue. Out of these, 3 tests are currently failing due to differences from the spec behavior. The three failing tests are:
I have marked them as skipped for now. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6919 +/- ##
==========================================
- Coverage 88.54% 88.45% -0.09%
==========================================
Files 263 263
Lines 12383 12383
==========================================
- Hits 10964 10954 -10
- Misses 1419 1429 +10
Flags with carried forward coverage won't be shown. Click here to find out more. |
Contributes to #5500
Changes
Added 7 extraction tests covering multiple = handling, empty value skipping, OWS parsing, semicolon metadata ignoring, percent decoding, invalid format skipping, and complex percent-encoded character decoding, and 6 injection tests covering 64 entry limit, 8192 byte limit, max size enforcement across many entries, round trip preservation, multiple = value preservation, and special character encoding behavior, with current spec mismatches marked as skipped.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes