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

all: fix test lint issues detecte by tenv and thelper linters #3441

Merged

Conversation

peczenyj
Copy link
Contributor

@peczenyj peczenyj commented Jun 3, 2024

here I try to handle two kinds of issues with tests

  1. the usage of os.Setenv in tests that need specific env vars and we need to revert the changes in the end. This usually is done via defer + some cleanup function BUT it may not run in many cases (like in a t.Fatal) and t.Setenv already do this and it is battle tested. for this I used the linter tenv via gitlabci-lint.
  2. the miss of t.Helper() in many test helpers. This was done by using the linter thelper via gitlabci-lint. The motivation is here: https://github.com/kulti/thelper?tab=readme-ov-file#why

this should have no impact in existing code or tests, but may help identify an issue from unit tests or benchmarks

Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.40%. Comparing base (e0e5901) to head (0657092).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3441      +/-   ##
==========================================
- Coverage   73.41%   73.40%   -0.02%     
==========================================
  Files         113      113              
  Lines       14947    14947              
==========================================
- Hits        10974    10972       -2     
- Misses       3199     3201       +2     
  Partials      774      774              

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

@peczenyj peczenyj changed the title all: fix test lint issues tenv and thelper all: fix test lint issues detecte by tenv and thelper linters Jun 3, 2024
@vangent
Copy link
Contributor

vangent commented Jun 3, 2024

Thanks!

@vangent vangent merged commit 19db7d5 into google:master Jun 3, 2024
7 checks passed
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