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(flags): ensure temp files are cleaned up #1727

Merged
merged 2 commits into from
Aug 12, 2023
Merged

Conversation

piksel
Copy link
Member

@piksel piksel commented Aug 12, 2023

Before, the tests actually left temporary files on windows due to floating file handles. This fix will fix warnings in flags and flags_test and ensures that the temporary files are removed (or it will fail the tests).

@codecov
Copy link

codecov bot commented Aug 12, 2023

Codecov Report

Patch coverage: 52.94% and project coverage change: -0.12% ⚠️

Comparison is base (32204a7) 67.70% compared to head (abeed88) 67.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1727      +/-   ##
==========================================
- Coverage   67.70%   67.59%   -0.12%     
==========================================
  Files          26       26              
  Lines        2378     2379       +1     
==========================================
- Hits         1610     1608       -2     
- Misses        670      672       +2     
- Partials       98       99       +1     
Files Changed Coverage Δ
internal/flags/flags.go 85.17% <52.94%> (-0.54%) ⬇️

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

@piksel
Copy link
Member Author

piksel commented Aug 12, 2023

Unfortunately, this PR lowers the test coverage, but not really. The same paths were just as untested before (they just logged the error and panicked or ignored the them). Additionally, the untested lines are pretty hard to simulate (I/O errors), or could never happen unless the actual code is incorrect (a flag that has secret file lookup enabled, but doesn't exist in the flags).

@piksel piksel merged commit 139f672 into main Aug 12, 2023
10 of 12 checks passed
@piksel piksel deleted the fix/flag-test-cleanup branch August 12, 2023 16:49
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.

1 participant