Skip to content
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

Not able to run the tests on Cypress Cloud viaGithub actions #29722

Closed
janavi-p opened this issue Jun 21, 2024 · 10 comments
Closed

Not able to run the tests on Cypress Cloud viaGithub actions #29722

janavi-p opened this issue Jun 21, 2024 · 10 comments
Labels
stage: awaiting response Potential fix was proposed; awaiting response

Comments

@janavi-p
Copy link

Current behavior

I am currently able to run the tests manually via cypress cloud. But if I trigger via github actions it does not. I tried reaching out to support@cypress.io, but did not get prompt help.
image
image

Desired behavior

Whenever the PR push happens to staging my repo should be triggered via Github actions in the Cypress cloud.
Even scheduled cron job do not run via cypress cloud

Test code to reproduce

Whenever the PR push happens to staging my repo should be triggered via Github actions in the Cypress cloud.
Even scheduled cron job do not run via cypress cloud
In addition to this, in my local runs I cannot use chrome browser.
image

Cypress Version

13.12.0

Node version

9.5.1

Operating System

macOS 14.5

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

I would recommend updating to the latest Cypress version, we may have resolved the Chrome opening issue since then.

What is the output you're seeing when running Cypress? It's not clear to me the exact error you're encountering.

@MikeMcC399
Copy link
Contributor

@janavi-p

You write that you are using Node.js version 9.5.1. Perhaps that was a typo? Check with

node --version

and make sure that you are using a minimum version of 18.x and preferably the 20.x LTS version.

Please post also your GitHub Actions workflow.

@jennifer-shehane jennifer-shehane added the stage: awaiting response Potential fix was proposed; awaiting response label Jun 24, 2024
@janavi-p
Copy link
Author

janavi-p commented Jul 8, 2024

v20.13.1. this is the node version.
image
GitHub Actions ( Cypress Runs) || Getting "Run finished" immediately when "Run Starts" @MikeMcC399

Workflow:
jobs:
cypress-run:
name: 'Cypress Test on Ubuntu'
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false # cypress-io/github-action#48
matrix:
containers: [1] # Uses 1 parallel instance

steps:

  • name: 'Checkout the repository'
    uses: actions/checkout@v4
    with:
    ref: main

  • name: 'git branch info'
    run: |
    git branch

  • name: 'Building web application to be tested'
    run: yarn

  • name: Cypress run
    uses: cypress-io/github-action@v6
    with:
    browser: electron
    config-file: cypress.config.js
    spec: "cypress/e2e/specs/regression-specs/staging/**/*.cy.js"
    group: 'UI-Electron'
    record: true
    parallel: true

    env:
    CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

@MikeMcC399
Copy link
Contributor

@janavi-p

You may be able to get more information about why your workflow is failing if you enable debugging

  env:
    DEBUG: '@cypress/github-action'

You do not need the line

run: yarn

if your repo has a yarn.lock in it. cypress-io/github-action takes care of installing dependencies.

Please edit the posting of your workflow and use backticks, otherwise your code is displayed as markdown instead of as yaml, for example:

```yml
name: example-basic
# This workflow represents a set of basic End-to-End tests
on:
  push:
    branches:
      - 'master'
and so on
```

This issue could also be transferred to https://github.com/cypress-io/github-action, although at this time there has not been any root cause identified.

@MikeMcC399
Copy link
Contributor

The workflow is missing

        env:
          # pass GitHub token to allow accurately detecting a build vs a re-run build
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@janavi-p
Copy link
Author

janavi-p commented Jul 9, 2024

@MikeMcC399 Added the Debug line suggested by you. After which the specs are running.
In addition, I see Bad credential error whenever I add the following code. With this code, even manual triggers fail with bad credential error. I have set the right token.
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

Attaching the logs for your reference. Please guide.
5_Cypress run.txt

@MikeMcC399
Copy link
Contributor

@janavi-p

You write that you have added

env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

This is not the same as:

        env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

See

I suggest again for you to follow the documentation to avoid your errors.

@janavi-p
Copy link
Author

janavi-p commented Jul 9, 2024

As per your suggestion, I made the necessary changes. @MikeMcC399

Any particular reason why the run time has increased ( 25 mins to run 2 specs ) which leads to cancellation of operation ( triggered via scheduled job and via ci/cd)
image

However, it runs 18 specs in 25 mins via triggered manually.

@jennifer-shehane
Copy link
Member

@janavi-p If you run Cypress in debug mode mode and print the entire set of logs here, that might reveal where the test is sitting for so long.

@MikeMcC399
Copy link
Contributor

This issue is stale since there has been no reply for one month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: awaiting response Potential fix was proposed; awaiting response
Projects
None yet
Development

No branches or pull requests

3 participants