-
Notifications
You must be signed in to change notification settings - Fork 347
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
workflow failing with EACCES: permission denied #446
Comments
* feat: node 16 + dep upgrades * feat: cypress github action * fix: line endings on windows * fix: encountered cypress-io/github-action#446 guessing bug with docker image * feat: up default timeout * fix: catch if vitals namespace not setup * feat: make the vitals reported timeout configurable as 10s is quite long
I am encountering the exact same error, started after updating to node 16 |
Adding this after
Cypress |
Also running into this issue.. Does not seem to be fixed for me with @realies
|
I ran into this issue using a Cypress browser docker image with Node v16. I fixed the problem by running job as a non-root user according to the instructions in the action readme. (The instructions in the readme tell you to do this to make Firefox work, but the same fix seems to solve this permissions issue.) It looks like the home directory in the Cypress images is owned by user ID 1001, so I configured my job to run with the same ID. Here is my setup job: setup-for-frontend-integration-tests:
name: Set up for frontend tests
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.5.0-chrome94-ff93
options: --user 1001 # ← THIS IS THE IMPORTANT LINE!
steps:
- uses: actions/checkout@v2
- name: Persist Next.js build cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-
- name: Install and cache Cypress and npm dependencies, and build frontend server
uses: cypress-io/github-action@v2
with:
# Don't run tests; we're only using the install and build steps here
runTests: false
build: yarn build
- name: Save built frontend server
uses: actions/upload-artifact@v2
with:
name: frontend-server
path: .next
if-no-files-found: error |
Documentation in README.md actually mentions similar issue under Firefox:
Even though I'm running Chrome image the permission issue was still happening during the build step and adding |
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml index 3accbd4..83002c4 100644 --- a/.github/workflows/cypress-test.yaml +++ b/.github/workflows/cypress-test.yaml @@ -10,6 +10,8 @@ jobs: image: cypress/browsers:node16.5.0-chrome97-ff96 # @see cypress-io/github-action#446 (comment) options: --user 1001 + volumes: + - /tmp/videos:/__w/chikamichi/chikamichi/cypress/videos steps: - uses: actions/checkout@v2 - name: Cache pnpm modules @@ -50,4 +52,4 @@ jobs: if: failure() with: name: cypress-videos - path: cypress/videos \ No newline at end of file + path: /tmp/videos \ No newline at end of file
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml index 4bac268..c7b937b 100644 --- a/.github/workflows/cypress-test.yaml +++ b/.github/workflows/cypress-test.yaml @@ -11,7 +11,7 @@ jobs: # @see cypress-io/github-action#446 (comment) options: --user 1001 volumes: - - /tmp/videos:/__w/chikamichi/chikamichi/cypress/videos + - cypress/videos:/__w/chikamichi/chikamichi/cypress/videos steps: - uses: actions/checkout@v2 - name: Cache pnpm modules @@ -51,4 +51,4 @@ jobs: - uses: actions/upload-artifact@v2 with: name: cypress-videos - path: /tmp/videos \ No newline at end of file + path: cypress/videos \ No newline at end of file
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml index c7b937b..67891b0 100644 --- a/.github/workflows/cypress-test.yaml +++ b/.github/workflows/cypress-test.yaml @@ -11,7 +11,7 @@ jobs: # @see cypress-io/github-action#446 (comment) options: --user 1001 volumes: - - cypress/videos:/__w/chikamichi/chikamichi/cypress/videos + - /home/runner/work/cypress:/__w/chikamichi/chikamichi/cypress steps: - uses: actions/checkout@v2 - name: Cache pnpm modules
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml index 67891b0..dc9dddf 100644 --- a/.github/workflows/cypress-test.yaml +++ b/.github/workflows/cypress-test.yaml @@ -11,7 +11,7 @@ jobs: # @see cypress-io/github-action#446 (comment) options: --user 1001 volumes: - - /home/runner/work/cypress:/__w/chikamichi/chikamichi/cypress + - /home/runner/work/cypress:/__w/cypress steps: - uses: actions/checkout@v2 - name: Cache pnpm modules @@ -40,6 +40,7 @@ jobs: start: pnpm run serve wait-on: 'http://localhost:3000' browser: chrome + config: videosFolder=/__w/cypress/videos - name: Cypress run on Firefox uses: cypress-io/github-action@v2 with: @@ -47,8 +48,9 @@ jobs: start: pnpm run serve wait-on: 'http://localhost:3000' browser: firefox + config: videosFolder=/__w/cypress/videos # upload artifact - uses: actions/upload-artifact@v2 with: name: cypress-videos - path: cypress/videos \ No newline at end of file + path: /home/runner/work/cypress/videos \ No newline at end of file
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml index dc9dddf..155577a 100644 --- a/.github/workflows/cypress-test.yaml +++ b/.github/workflows/cypress-test.yaml @@ -11,7 +11,7 @@ jobs: # @see cypress-io/github-action#446 (comment) options: --user 1001 volumes: - - /home/runner/work/cypress:/__w/cypress + - /home/runner/work/cypress/videos:/__w/cypress/videos steps: - uses: actions/checkout@v2 - name: Cache pnpm modules
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml index 155577a..d9d9dbd 100644 --- a/.github/workflows/cypress-test.yaml +++ b/.github/workflows/cypress-test.yaml @@ -10,8 +10,6 @@ jobs: image: cypress/browsers:node16.5.0-chrome97-ff96 # @see cypress-io/github-action#446 (comment) options: --user 1001 - volumes: - - /home/runner/work/cypress/videos:/__w/cypress/videos steps: - uses: actions/checkout@v2 - name: Cache pnpm modules @@ -53,4 +51,4 @@ jobs: - uses: actions/upload-artifact@v2 with: name: cypress-videos - path: /home/runner/work/cypress/videos \ No newline at end of file + path: chikamichi/chikamichi/cypress/videos \ No newline at end of file
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml index c80ac37..8626403 100644 --- a/.github/workflows/cypress-test.yaml +++ b/.github/workflows/cypress-test.yaml @@ -6,10 +6,6 @@ on: jobs: cypress-run: runs-on: ubuntu-latest - container: - image: cypress/browsers:node16.5.0-chrome97-ff96 - # @see cypress-io/github-action#446 (comment) - options: --user 1001 steps: - uses: actions/checkout@v2 - name: Cache pnpm modules @@ -30,18 +26,20 @@ jobs: cache: "pnpm" - name: Build extension run: pnpm build - # tests multiple browser - name: Cypress run on Chrome uses: cypress-io/github-action@v2 with: install: false start: pnpm run serve wait-on: 'http://localhost:3000' - browser: chrome - - name: Cypress run on Firefox - uses: cypress-io/github-action@v2 + - uses: actions/upload-artifact@v2 + if: failure() with: - install: false - start: pnpm run serve - wait-on: 'http://localhost:3000' - browser: firefox \ No newline at end of file + name: cypress-screenshots + path: cypress/screenshots + # Test run video was always captured, so this action uses "always()" condition + - uses: actions/upload-artifact@v2 + if: always() + with: + name: cypress-videos + path: cypress/videos \ No newline at end of file diff --git a/cypress/integration/e2e.ts b/cypress/integration/e2e.ts index bceba02..e396346 100644 --- a/cypress/integration/e2e.ts +++ b/cypress/integration/e2e.ts @@ -113,7 +113,7 @@ describe("App", () => { cy.window().its("close").should("be.called"); }); - it.skip("TODO: on Enter key", () => { + it.only("TODO: on Enter key", () => { cy.get("[data-cy=search-input]").type("history-item"); cy.get("[data-cy=search-result-0]").should("have.class", "selected-item"); cy.get("[data-cy=search-input]").type("{enter}"); diff --git a/cypress/support/support.ts b/cypress/support/support.ts index 5af019e..f518131 100644 --- a/cypress/support/support.ts +++ b/cypress/support/support.ts @@ -21,8 +21,9 @@ export const setupExtensionEnvironment = ({ addListener: cy.stub(), } as any, onConnect: { - addListener: cy.stub(), + addListener: cy.stub().as("onConnect"), } as any, + connect: cy.stub().as("connect").returns(cy.stub()) }; (win.chrome.history as Partial<typeof chrome.history>) = { search: ((_: any, callback: (data: any[]) => void) => {
263: Add option to cypress container r=mdubus a=mdubus Workflow were failing. See: https://github.com/meilisearch/demo-movies/runs/6792136755?check_suite_focus=true Fix suggestion here: cypress-io/github-action#446 Co-authored-by: Morgane Dubus <[email protected]>
Unfortunately the fix doesnt handle creation of directories, for example for storing screenshots and videos of test recordings. |
Had the same issue. This fixed it |
Thanks for your feedback! It's no longer necessary to run cypress-io/github-action in a container to get access to the regular browsers if you are using GitHub-hosted runners, since they already have browsers installed. See for instance ubuntu-22.04 browsers. |
Closing, since this is an old issue using versions which are no longer supported. If this issue is still occurring with current versions, then please open a new issue. |
263: Add option to cypress container r=mdubus a=mdubus Workflow were failing. See: https://github.com/meilisearch/demo-movies/runs/6792136755?check_suite_focus=true Fix suggestion here: cypress-io/github-action#446 Co-authored-by: Morgane Dubus <[email protected]>
This is the workflow that is run
It used to work till evening today. started failing from then. Am I missing something?
This is the error on workflow fail
The text was updated successfully, but these errors were encountered: