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

editoast: force 'otel::tracing=info' for some tests #10531

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

woshilapin
Copy link
Contributor

The STDCM log feature depends on Opentelemetry span being created in the Axum middleware. If RUST_LOG=warn, tests will fail because no span is created and therefore no trace ID is created and tests depends on this trace ID.

The added directives are applied after reading RUST_LOG.

This is an alternative solution to what was proposed in #10526.

@woshilapin woshilapin requested a review from a team as a code owner January 27, 2025 14:41
@github-actions github-actions bot added the area:editoast Work on Editoast Service label Jan 27, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.90%. Comparing base (14fa21b) to head (4eeec9f).
Report is 7 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10531   +/-   ##
=======================================
  Coverage   81.90%   81.90%           
=======================================
  Files        1079     1079           
  Lines      107473   107487   +14     
  Branches      734      734           
=======================================
+ Hits        88024    88037   +13     
- Misses      19409    19410    +1     
  Partials       40       40           
Flag Coverage Δ
editoast 74.29% <100.00%> (+<0.01%) ⬆️
front 89.41% <ø> (ø)
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 88.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

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

✅ works for me a bit better (less logs) than the alternative.

It looks a bit more elegant, but again, not sharp enough on the matter.

Copy link
Contributor

@leovalais leovalais left a comment

Choose a reason for hiding this comment

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

I think I like this proposition better.

  1. Keeping the ability to configure RUST_LOG for running tests is useful (to me at least).
  2. Tests that require a specific log directives will be emphasized and show explicitly which directives affects the behavior of the tested feature.

@woshilapin woshilapin changed the title editoast: force 'otel::tracing=info' for tests editoast: force 'otel::tracing=info' for some tests Feb 4, 2025
@woshilapin woshilapin force-pushed the wsl/editoast/force-otel-span-for-tests branch from fa48f4c to ff2acc0 Compare February 4, 2025 08:11
@woshilapin
Copy link
Contributor Author

Since #10526 has been abandoned in favor of the current PR, let's merge it?

The STDCM log feature depends on Opentelemetry span being created in the Axum middleware.
If `RUST_LOG=warn`, tests will fail because no span is created
and therefore no trace ID is created and tests depends on this trace ID.

The added directives are applied after reading `RUST_LOG`.

Signed-off-by: Jean SIMARD <[email protected]>
@woshilapin woshilapin force-pushed the wsl/editoast/force-otel-span-for-tests branch from ff2acc0 to 9d7bcfc Compare February 7, 2025 09:23
@woshilapin woshilapin enabled auto-merge February 7, 2025 09:23
@woshilapin woshilapin force-pushed the wsl/editoast/force-otel-span-for-tests branch from 9d7bcfc to 4eeec9f Compare February 7, 2025 10:33
@woshilapin woshilapin added this pull request to the merge queue Feb 7, 2025
Merged via the queue into dev with commit 8f8c572 Feb 7, 2025
27 checks passed
@woshilapin woshilapin deleted the wsl/editoast/force-otel-span-for-tests branch February 7, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editoast Work on Editoast Service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants