Testing via Github Actions -- Cypress runner takes 20x longer to run than local and Videos aren't watchable
See original GitHub issueCurrent behavior
Description: We are trying to run Cypress and Percy together via Github actions to test our app during development for (Sketchy)
The test runs are taking a really long time (~20 mins) when our expectations are that they should be done in less than 4 and perhaps 1 if we ran in parallel. We are also noticing that the video recordings are not watchable (they don’t show the recorded flow of the test they just show a couple snapshot states). We have experimented with changing the compression levels of the videos to no avail.
Here is a link to one of the test runs where it was slow: https://dashboard.cypress.io/projects/pfwmze/runs/111/specs
I also commented here: and here
The major issue, outside of build time, is that Github actions only offers a certain amount of mins per month in non-enterprise scenarios and these tests are massively eating into those mins and our build times even though they finish locally in under a min.
I’ve attached a photo showing how the specs themselves are running quickly but the total test run is very long.
Desired behavior
The tests run as fast in CI (headless) as they do locally and perhaps even faster if we run them in parallel.
Test code to reproduce
Link to part of my config is here:
This shows what my memory/cpu looks like during test run: https://github.com/cypress-io/cypress/issues/16884#issuecomment-1045937281
Here is my config file setting:
{
"projectId": "xxxxx",
"defaultCommandTimeout": 10000,
"chromeWebSecurity": false,
"videoCompression": false,
"viewportWidth": 1440,
"viewportHeight": 900,
"baseUrl": "http://dashboard.sketchy-premerge.com",
"supportFile": "cypress/support/index.js",
"experimentalSessionSupport": true
}
Here is how it’s being run in CI:
- name: Cypress run
uses: cypress-io/github-action@v2
with:
browser: chrome
install: false
config-file: 'cypress/cypress.${{ needs.deploy.outputs.env_check_env_name }}.json'
wait-on: 'https://${{ needs.deploy.outputs.env_check_sanitized_url }}.sketchy-${{ needs.deploy.outputs.env_check_env_name }}.com'
record: true
headless: true
parallel: false
command-prefix: 'percy exec -- npx'
tag: ${{ github.event_name }}
Cypress Version
9.5.1
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:9 (1 by maintainers)
Top GitHub Comments
I agree @liambutler and it’s extremely frustrating not being able to use it. Just FYI: I was able to get this working again by using self-hosted runners and switching to the amazon linux 2022 image, although that is likely not an option for most.
Cypress’ recommendation for minimum CPUs is 2, but then if you want video recording you should add in a third CPU.
Unfortunately, that exceeds the default GitHub Action runners’ specs: (source)
Given how much documentation there is regarding Cypress running on GitHub Actions, I’d hope Cypress would be able to run smoothly in its default state (ie with video enabled). I don’t think there’s much appetite to go self-hosted on my team as no one wants the additional overhead. Tradeoffs everywhere I look 😃