-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Coverage api not saving files inside of docker #1581
Comments
Hmm, you say:
Are you using |
Im pretty sure I do because while testing I also wrote to a file and the coverage folder also gets created. Which means I do have write permissions right? |
I had a go at reproducing this (after thinking it was related to another issue, which it turned out not to be), and I cannot reproduce with the exact setup described above.
I wonder if it could be something to do with the filesystem type that you're mounting in from the host... What does |
Hey, sorry it me so long to respond, I was on vacation for a few days. Anyways, after a little bit of investigating it seems that I may have been a little stupid. First of all for some reason the files actually don't appear when running this on windows, but when using debian as described in the reproduction they are actually there. I just didn't know about the -A option. That's my bad and im honestly a little embarrassed about it. I don't know why exactly it's not showing on windows, im guessing it's because of docker using wsl or something. I don't know and honestly I also don't really care since it doesn't matter in my use case. Im really sorry for bothering everyone, but also thankful to you for pointing that out to me. I wish you all a great day. |
Describe the bug
When using the coverage api inside of docker its not saving the files. It works perfectly fine outside of docker though.
To Reproduce
The issue occurs on python 3.11 and coverage 7.2.1, didnt test older versions.
I have written a small reproduction of the problem that I hope anyone can follow. In the following steps I will be showing how to run that.
pip3 install coverage
.reproduction
main.py
.Dockerfile
.docker build .
and run it with this commanddocker run -v /root/tests/data:/data [image id]
. Replace the [image id] with the actual image id.Expected behavior
Normally it should just stop and save the files when running inside of docker. Like it does when running outside of docker.
Edit
Added docker.io and docker-compose to requirements for reproduction. Second edit now writing to a file called t.txt to show that I do indeed have write permissions.
The text was updated successfully, but these errors were encountered: