Skip to content

Conversation

alexandear
Copy link
Contributor

This PR replaces context.Background() with t.Context() in tests. T.Context has been available since Go 1.24.

Additionally, it enables the usetesting linter to automatically suggest using t.Context() in future PRs.

The PR also modifies the helper function createRandomTestRepository by adding a *testing.T parameter. This simplifies integration tests that rely on this function.

@alexandear alexandear force-pushed the refactor/use-testing-context branch from 7684f11 to 7f1bc65 Compare October 2, 2025 16:02
@alexandear alexandear force-pushed the refactor/use-testing-context branch from 7f1bc65 to 64801d6 Compare October 2, 2025 16:05
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.11%. Comparing base (b7f068f) to head (64801d6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3750   +/-   ##
=======================================
  Coverage   91.11%   91.11%           
=======================================
  Files         187      187           
  Lines       16702    16702           
=======================================
  Hits        15218    15218           
  Misses       1296     1296           
  Partials      188      188           

☔ 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.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @alexandear!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Oct 2, 2025
Copy link
Contributor

@zyfy29 zyfy29 left a comment

Choose a reason for hiding this comment

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

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 3, 2025
@gmlewis
Copy link
Collaborator

gmlewis commented Oct 3, 2025

Thank you, @zyfy29!
Merging.

@gmlewis gmlewis merged commit 233fe03 into google:master Oct 3, 2025
7 checks passed
@alexandear alexandear deleted the refactor/use-testing-context branch October 3, 2025 14:15
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.

3 participants