8000 Replace context.WithCancel in unit tests by mariomac · Pull Request #1837 · grafana/beyla · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace context.WithCancel in unit tests #1837

New 8000 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

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

mariomac
Copy link
Contributor

Go 1.24 adds the Context() method to the testing.T struct, which is automatically cancelled when the unit tests end.

This PR replaces the previously used context.WithCancel by the new function in most of the unit test.

@mariomac mariomac requested a review from a team as a code owner April 16, 2025 09:10
Copy link
codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.36%. Comparing base (ef50447) to head (e046a06).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1837      +/-   ##
==========================================
+ Coverage   74.33%   74.36%   +0.03%     
==========================================
  Files         177      177              
  Lines       19128    19128              
==========================================
+ Hits        14218    14224       +6     
+ Misses       4188     4184       -4     
+ Partials      722      720       -2     
Flag Coverage Δ
integration-test 57.21% <ø> (-0.57%) ⬇️
k8s-integration-test 56.61% <ø> (+1.03%) ⬆️
oats-test 35.82% <ø> (-0.03%) ⬇️
unittests 46.03% <ø> (+0.03%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mariomac mariomac merged commit 8f11289 into grafana:main Apr 16, 2025
13 checks passed
@mariomac mariomac deleted the repl-ctx-withcancel branch April 16, 2025 12:38
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.

2 participants
0