-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix unit test banned path check to allow access to project folder #749
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #749 +/- ##
=======================================
Coverage 87.01% 87.01%
=======================================
Files 101 101
Lines 6968 6968
=======================================
Hits 6063 6063
Misses 905 905
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but as a suggestion how about we make it a whitelist instead? It looks like the only places the tests are writing to are:
- The package folder (which we're now checking)
/tmp
So we could just check for one of those rather than check against the banned?
I tried this, however it seems to run into problems, somehow running the test some packages using However I think in any case to handle this properly we ought to whitelist files from every conceivable folder that python might resolve packages from, esp if 3rd party code ever loads any resources. Unfortunately this might be difficult to cover not only CI but also dev machines what with system packages, virtual environments etc. |
Sure, happy to keep as is |
This reverts commit a31db5b.
f349d53
to
2f5b629
Compare
Fixes
This change adjusts the check for unit tests trying to open files so that files in the project folder are allowed