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

Skip ahead to re-run only Cypress #1885

Merged
merged 4 commits into from
Aug 24, 2023
Merged

Skip ahead to re-run only Cypress #1885

merged 4 commits into from
Aug 24, 2023

Conversation

mojotalantikite
Copy link
Contributor

@mojotalantikite mojotalantikite commented Aug 21, 2023

Summary

There is a bug -- or really, a lack of functionality -- with cypress re-runs when using the GHA re-run failed jobs option, which is a known issue. If you're using a parallelized container build in GHA CI (as we do) and a container or two has a failed spec, choosing to use the GHA re-run failed jobs feature will load all of the Cypress tests onto that container that has failed and try to re-run everything there. This is unexpected, as I think people assume only the failed specs and other tests that were allocated to the failed container will re-run. Since we have a 25 minute timeout on Cypress runs, and we're running the entire test suite on a fraction of the containers in this scenario, we'll always hit that timeout and get a failed run.

I've added a bit of a hack-y workaround here until a re-run feature is taken on by the Cypress team. Basically, if the CI skipping script sees a commit message with cypress re-run in it, it'll skip past all the infra and app deploy stages and bring us right to the Cypress run stage. It's not as good as re-running only the failed test specs, but I guess it's better than having to wait for an entire CI deploy due to a flaky test.

This also changes the ID for cypress runs to help us correlate the run in Cypress dashboard to the GHA run a little easier.

Related issues

https://qmacbis.atlassian.net/browse/MR-3225

@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite temporarily deployed to dev August 21, 2023 19:36 — with GitHub Actions Inactive
@mojotalantikite mojotalantikite changed the title Use the run_id and run_attempt as the Cypress ID Skip ahead to re-run only Cypress Aug 21, 2023
Copy link
Contributor

@macrael macrael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

straightforward workaround

if (commitMessage.includes('ci-force-run')) {
core.setOutput('changed-services', deployAllServices)
return
}

// force just a cypress re-run
if (commitMessage.includes('cypress re-run')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about ci-force-run, where would be a good place to document these CI incantations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The force-ci-run is in the main Readme, but it looks like it's a little buried and hard to pick out. I just pushed up a change that documents the new cypress re-run and breaks those docs out into a section so it's easier to run across!

@mojotalantikite mojotalantikite merged commit 8d77257 into main Aug 24, 2023
27 checks passed
@mojotalantikite mojotalantikite deleted the mt-cypress-rerun branch August 24, 2023 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants