-
Notifications
You must be signed in to change notification settings - Fork 81
Update tests to not use fixed paths in /tmp/
#2208
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
Open
asnare
wants to merge
7
commits into
main
Choose a base branch
from
fix-proper-tmp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tests shouldn't use fixed paths inside /tmp: - leads to flakiness during concurrent runs; - access isn't guaranteed; - it's not available on Windows. The tmp_path fixture should be used instead.
|
✅ 51/51 passed, 4 flaky, 4m28s total Flaky tests:
Running from acceptance #3269 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2208 +/- ##
==========================================
- Coverage 64.11% 64.05% -0.06%
==========================================
Files 101 101
Lines 8675 8675
Branches 902 902
==========================================
- Hits 5562 5557 -5
- Misses 2941 2946 +5
Partials 172 172 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
What does this PR do?
This PR updates our tests so that none of them use
/tmp/directly:/tmp/will be flaky in the face of concurrent tests: both will attempt to modify the same path./tmp/as a work area; access may be denied./tmp/does not existInstead tests should use the
tmp_pathpytest fixture to obtain a clean (and safe) temporary directory to use; it will be cleaned up when the test finishes.To avoid confusion, unit tests that were using
/tmp/as an arbitrary path (but didn't actually access it) have been modified to use something else.Caveats/things to watch out for when reviewing:
Some incidental changes include:
Pathinstead ofstr.profiler_extract_utilsmodule is only needed during integration tests, so it was moved to location of the integration tests.Tests