cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.49k stars 3.15k forks source link

GitHub Actions ( Cypress Runs) || Getting "Run finished" immediately when "Run Starts" #29811

Open janavi-p opened 2 weeks ago

janavi-p commented 2 weeks ago

Current behavior

image

Desired behavior

GitHub action should initiate test execution and run it completely without any deviations

Test code to reproduce

jobs:
  cypress-run:
    name: 'Cypress Test on Ubuntu'
    runs-on: ubuntu-latest
    timeout-minutes: 25
    strategy:
      fail-fast: false # https://github.com/cypress-io/github-action/issues/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 }}

Cypress Version

13.13.0

Node version

v20.13.1

Operating System

macOS 14.5

Debug Logs

No response

Other

Found an existing bug With Cypress : https://github.com/cypress-io/github-action/issues/147 This seems to have been fixed in v2.2 I am already using v6

janavi-p commented 2 weeks ago

Note: The spec files run seamlessly when I re-run the same job. It fails via manual run, scheduled job and via automatically.

MikeMcC399 commented 2 weeks ago
jennifer-shehane commented 2 weeks ago

Typically there will be output of the 'Run finished' prematurely without running the tests if Cypress detects a ciBuildId that has already completed running - this means it's associated with another older run.

Ensure that the ciBuildId is unique for the run in order to trigger a new run in Cypress. https://docs.cypress.io/guides/cloud/smart-orchestration/parallelization#Linking-CI-machines-for-parallelization-or-grouping

MikeMcC399 commented 1 day ago