-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
pytest2.8 invariantly writes to working directory + fails on readonly filesystem #1029
Comments
Thanks for the report! 😄 Hmmm I see two possibilities:
I think 1 is too error prone, and 3 will remove much of the usefulness of the |
2 is how it should work, since we already made the warning recording a historic hook call, we can propperly issue a config.warn in such cases |
The fix only addresses half of the problem. How do I get pytest to stop writing to my working directory and why did this change happen? |
The standard place to put this is |
I think the only way to prevent that currently is by passing [pytest]
addopts = -p no:cacheprovider (In fact I will add this to the docs) This change happened because in One of the drawbacks is that now This will be fixed in |
That's an excellent suggestion I think. Would you mind opening a new issue with it? Thanks! 😄 |
we could probably use a hash + use a symlink back - using full paths is a huge error source due to path length limits on various platforms |
That's a good point! I know I've had my problems with this on Windows. 😅 But I fear adding another layer of complexity to the system might bring more trouble than it is worth, to be honest. 😬 |
i feel the need to make basetmp as well as cache locations configurable plus XDG_CONFIG_DIRS is the absolutely wrong thing to use in many non-containered ci situations |
@RonnyPfannschmidt That's wrongheaded on several counts. a) A very convenient, and standard, way to configure tools' cache location is to set $XDG_CACHE_DIR. Many of my project's fixtures do this for other reasons already. Similarly, the most convenient, and standard, way to set "basetmp" would be $TMPDIR. b) "something a CI system can easily pick up" is exactly these environment variables. Many systems will already support this, and those that don't will support injecting environment variables. c) "non-containered ci" will either support ~/.cache correctly, or set $XDG_CACHE_DIR, because this is necessary for other tools that use the standard. Again, this is already handled in many of my projects because of other tools. |
moved to #1089 |
This has regressed (2.8.2):
|
@asottile I don't think this is a regression - it seems like @nicoddemus' fix handles I found it odd that you get that during the |
@asottile can you provided more information on the invocation into docker? |
Here's a oneliner that reproduces:
The trace above can be reproduced by:
You'll probably have a faster debug loop with a dockerfile that looks something like (not tested):
|
i created a super-seeding issue for that particular issue to keep track of the exact detail thanks for the debugging instructions |
Is this still an issue with |
Yes, pasting either oneliner above still triggers a stacktrace under 2.8.3 |
PS. Maybe I should file a new issue for this because although related to this issue it's not limited to read-only filesystems. |
please a new issue |
The other day I tried to run our test suite in a bubblewrap sandbox, to make sure our tests don't require network connectivity, and don't write to disk unnecessarily:
To my surprise py.test did not show me the tracebacks of the failed tests, but instead crashed trying to write the last-failed cache. Anyway, just wanted to confirm that this issue is still present in py.test 3.2.3, and mention my use-case. |
nobody actually went to fix it |
@mgedmin thanks. Just want to mention a workaround: |
Taking the oneliners above (and adapting them for time changes), I get the following:
works fine!
also works fine! it appears this was fixed at some point, closing. |
I believe these to be the same issue so I'm only making a single report.
And the error from our CI server (which is running a repo inside docker)
The text was updated successfully, but these errors were encountered: