-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Read-only warning given even when screenshots and videos folders writable #30810
Comments
Source code inspection confirms that Cypress indeed is only checking the cypress/packages/errors/src/errors.ts Lines 1236 to 1245 in 0ddb119
cypress/packages/server/lib/modes/run.ts Lines 167 to 181 in 0ddb119
|
Current behavior
If the root directory of a Cypress project is read-only, then Cypress outputs a warning that the folder is not writeable, even when the screenshots and videos folders are located outside of the project and are writable. The warning is:
Alternatively, if the root directory of the Cypress project is writeable, the
cypress
directory is read-only, thescreenshotsFolder
and thevideosFolder
use default locations andvideo
is enabled, then there is no warning message, onlyEACCES
failure messages when trying to capture video and save screenshots.So, in summary, the check produces warnings when it shouldn't (false positive), and neglects to warn when it should do (false negative).
The issue is also relevant for Docker usage when Docker is run as a non-root user.
Desired behavior
There should be no warning requiring that the root directory of a Cypress project should be writable if Cypress is configured so that screenshots and videos can be written.
Cypress should check the locations of the
screenshotsFolder
and thevideosFolder
(ifvideo
is enabled) and only output a warning if these locations are read-only. It should not be a requirement for the root of the Cypress project to be writeable.Test code to reproduce
GitHub Actions
Run the following example from https://github.com/cypress-io/cypress-docker-images in a GitHub Actions workflow:
In this situation the
test
directory is mounted using GitHub Actions'1001
runner
user. The Cypress Docker image however needs the built-innode
user in order to run, and it has no write access to the files of therunner
user.Standalone
mkdir cy-read-only cd cy-read-only git init npm init -y npm install cypress npx cypress open
Scaffold a single default E2E test spec. Change
spec.cy.js
to add a screenshot capture:Replace
cypress.config.js
with the following to move volatile directories to/tmp
and to enablevideo
:Cypress Version
13.17.0
Node version
v22.12.0
LTSOperating System
Ubuntu
24.04.1
LTSDebug Logs
The logs show Cypress first warning that it can't capture screenshots and videos, and then contradicting this information by capturing both screenshots and videos to
/tmp
.Other
No response
The text was updated successfully, but these errors were encountered: