Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Cypress deletes screenshotsFolder and videosFolder, loosing their original permissions #1943
When Cypress is launched using
See "Steps to reproduce" for details and why it's an issue.
I realize it's an exotic issue, and I can work around it fairly easily without fixing Cypress. So feel free to close if you don't consider this to be a bug.
Cypress deletes the contents of
Cypress has an option to permanently delete those files, not only move them to trash (to avoid similar issue with the
Steps to reproduce:
Running in Docker, on Linux. Custom setup, not based on Cypress' docker images.
I'm seeing something similar when using volumes in Docker (so that I can access the screenshots/videos after a test run inside the container is complete). My Docker Compose setup looks something like (mine are based on Cypress' docker images):
In this setup, because those volumes are mountpoints, deleting them fails with an
The workaround is, of course, to change the
Slightly different scenario and error. But this, too, would be fixed if Cypress was deleting the contents of those directories, instead of the directories themselves.
Here is the method that runs to trash the folders which could be updated:
There's likely tests that would need to be updated also.
Likely want to glob inside of each folder and remove the folders / files in there as opposed to the direct parent.
I'm not sure if this would even fix the problem though because where does it end? It would just remove the permissions on those folders.
Will it work deleting children out of a folder that is mounted? Has anyone tried that?
Yeah, I kind of see this as an integration issue between Cypress and our CI process (which is arguably complicated). But at the end of the day, it is Cypress who is pointed to an existing directory and it's changing that directorie's permissions / ownership. So I believe it should be fixed within Cypress.
Philosophy aside, disabling trashing assets before runs wouldn't solve it for us, because the issue is that our scripts running on an agent (not in a docker container) break because
We tried using TRAP's in a shell script running in an agent to ensure we
If anything, we could just leave those assets on an agent and let the container in the next build clean it up before (so keep trashing assets before runs enabled). That'd mean we'd have stale artifacts laying around on agents, which I dislike, but it's an option if we can't fix that in Cypress.
Yes, but assuming we'll delete files permanently (as in
Hi everyone, I stumbled upon some very similar scenario and I was wondering: why trash the complete directory? Why not
I know it's safer/cleaner to
To be specific: I want to keep the folders (videos & screenshots) so I don't have to worry about not existing/permissions/etc. So I keep a
I think I'm suggesting the same as @brian-mann which, in the end, points to not messing with directory structure of the project
Besides personal or coding strategies, I think trashing the folders will continue to raise problems on different scenarios.
referenced this issue
Sep 14, 2018
@kamituel I've got the globbing fix PR'd but sounds like that'll still cause issues for you with
From digging around in the Trash spec, seems like a work around could be creating