Skip to content
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

[TEST] Fix failing W3C Trace Context compliance tests #3115

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

psx95
Copy link
Contributor

@psx95 psx95 commented Oct 30, 2024

Fixes #74

Changes

  • Fixes the listed failures in w3c trace-context compliance test suite.
  • Adds a CI check which runs the w3c trace context tests for SPEC_LEVEL=1.
    • Test suites run are TraceContextTest & AdvancedTest.

Details

The following lists shows all the failing tests. Checked box indicates that the changes in this PR have fixed the test.

Currently failing tests from TraceContextTest suite

  • test_traceparent_header_name_valid_casing
  • test_traceparent_included_tracestate_missing
  • test_traceparent_ows_handling
  • test_traceparent_version_0xcc
  • test_tracestate_all_allowed_characters
  • test_tracestate_duplicated_keys
  • test_tracestate_empty_header
  • test_tracestate_header_name_valid_casing
  • test_tracestate_included_traceparent_included
  • test_tracestate_key_length_limit
  • test_tracestate_member_count_limit
  • test_tracestate_multiple_headers_different_keys
  • test_tracestate_ows_handling

Currently failing tests from AdvancedTest suite

  • test_multiple_requests_with_valid_traceparent

NOTE: The tests above were part of test suites TraceContextTest & AdvancedTest. These test suites Trace Context Level 1 support.

Current Status

All tests now passing. Test suites ran - TraceContextTest & AdvancedTest.

Additional Tasks

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

Copy link

netlify bot commented Oct 30, 2024

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit bb5f91a
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/672a96db544adb00085adbcc

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.85%. Comparing base (497eaf4) to head (bb5f91a).
Report is 152 commits behind head on main.

Files with missing lines Patch % Lines
...entelemetry/trace/propagation/http_trace_context.h 62.50% 3 Missing ⚠️
api/include/opentelemetry/trace/trace_state.h 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3115      +/-   ##
==========================================
+ Coverage   87.12%   87.85%   +0.73%     
==========================================
  Files         200      195       -5     
  Lines        6109     6138      +29     
==========================================
+ Hits         5322     5392      +70     
+ Misses        787      746      -41     
Files with missing lines Coverage Δ
api/include/opentelemetry/common/string_util.h 100.00% <100.00%> (ø)
api/include/opentelemetry/trace/trace_state.h 97.60% <0.00%> (ø)
...entelemetry/trace/propagation/http_trace_context.h 92.76% <62.50%> (-2.83%) ⬇️

... and 99 files with indirect coverage changes

@psx95 psx95 force-pushed the w3c-trace-context branch 9 times, most recently from 3759a7c to 39e58f1 Compare November 1, 2024 15:47
Using cin.get() as a means to stop the server listening for requests is
preventing the server from being used in a CI environment. This also allows
the test server to run in background since exit is now controlled by a
http request.
Also explicitly stops the background server serving requests.
@psx95 psx95 changed the title W3c trace context [TEST] Fix failing W3C Trace Context compliance tests Nov 1, 2024
@psx95 psx95 marked this pull request as ready for review November 1, 2024 23:14
@psx95 psx95 requested a review from a team as a code owner November 1, 2024 23:14
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

Nice work.

Please check the PR comments, it seems entry for test_traceparent_header_name_valid_casing is duplicated.

See also minor comments.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fixes.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

LGTM with nit comments. Thanks for working on this.

env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
PROTOBUF_VERSION: 21.12
Copy link
Contributor

Choose a reason for hiding this comment

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

Is PROTOBUF_VERSION needed here?

run: |
./ci/do_ci.sh cmake.w3c.trace-context.build-server
cd $HOME/build/ext/test/w3c_tracecontext_test
./w3c_tracecontext_test &
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the tailing & for running the test in background? If so, is it needed?

Copy link
Member

@lalitb lalitb Nov 5, 2024

Choose a reason for hiding this comment

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

It is starting the test web server, so required in background. But in general good to invoke such services under nohup instead of '&', so that it doesn't corrupt the CI terminal output.

ps - just fyi, not action required for my comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I also just read that in the w3c_tracecontext_test, probably better to imply that is is test server in the file name:)

-DBUILD_W3CTRACECONTEXT_TEST=ON \
-DCMAKE_CXX_STANDARD=${CXX_STANDARD} \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, make -j $(nproc) to utilize all available cores to build.

@@ -15,6 +15,9 @@ Increment the:

## [Unreleased]

* [TEST] Fix failing W3C Trace Context compliance tests [#3115](https://github.com/open-telemetry/opentelemetry-cpp/pull/3115)
Copy link
Contributor

Choose a reason for hiding this comment

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

[TEST] may mean it only affects test code, but this fixes W3C trace context API?

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.

W3C TraceContext compliance
4 participants