Skip to content

Commit 14fb01b

Browse files
authored
Merge branch 'master' into chore/add_internal_20_18_1_image
2 parents d38cd6e + c07fb74 commit 14fb01b

File tree

19 files changed

+786
-628
lines changed

19 files changed

+786
-628
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Example Tests
2+
# This workflow tests examples from the examples directory of this repo.
3+
4+
on:
5+
push:
6+
paths:
7+
- examples/**
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
example:
13+
runs-on: ubuntu-24.04
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
directory: [
18+
basic-mini,
19+
basic,
20+
chromium,
21+
firefox-esr,
22+
included-as-non-root
23+
]
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Run test script
27+
working-directory: examples/${{ matrix.directory }}
28+
run: ./scripts/test.sh

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,34 @@ container:
157157
158158
See [Tag Selection](#tag-selection) above for advice on selecting a non-default image tag.
159159
160+
## EACCES permission denied binary_state.json
161+
162+
### Problem
163+
164+
If a custom Docker image is built from a `cypress/base` or `cypress/browsers` Cypress Docker image, using a `Dockerfile` to install the Cypress binary (for instance with `npx cypress install`), and the custom image is then run as a container with a non-root user, Cypress will fail to run with an error message:
165+
166+
> Error: EACCES: permission denied, open '/root/.cache/Cypress/`<Cypress version>`/binary_state.json'
167+
168+
This is due to an open Cypress issue [#30684](https://github.com/cypress-io/cypress/issues/30684) where Cypress fails to verify the installed Cypress binary if it does not have write access to the Cypress binary directory.
169+
170+
### Workaround
171+
172+
To workaround this issue, either make the Cypress binary directory writable, or skip the Cypress binary verification.
173+
174+
To make the complete Cypress binary directory writable, add the following to the `Dockerfile` after the step to install the Cypress binary:
175+
176+
```Dockerfile
177+
RUN chmod -R 777 /root/.cache/Cypress
178+
```
179+
180+
To skip Cypress binary verification using the environment variable `CYPRESS_SKIP_VERIFY`, described in the Cypress documentation [Advanced Installation](https://docs.cypress.io/app/references/advanced-installation#Environment-variables), either add the following to the `Dockerfile`:
181+
182+
```Dockerfile
183+
ENV CYPRESS_SKIP_VERIFY=true
184+
```
185+
186+
or pass the environment variable as an additional CLI option `--env CYPRESS_SKIP_VERIFY=true` to the [docker run](https://docs.docker.com/reference/cli/docker/container/run/) command.
187+
160188
## Contributing
161189

162190
See [CONTRIBUTING.md](CONTRIBUTING.md)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -e # fail on error
3+
#
4+
# Run in examples/basic-mini directory
5+
# (amd64 only)
6+
#
7+
echo Test base-mini with cypress/included in Chrome
8+
docker run --rm -v .:/app -w /app --entrypoint cypress cypress/included run -b chrome

0 commit comments

Comments
 (0)