Fix cypress test failures/flakiness #837
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Closes: #838
To fix cypress test failures, eliminate test flakiness, restructure github actions to reuse common code. Ex. test failures in cypress/e2e/organization_admin/prefixes.test.ts, contacts.test.ts, dois.test.ts. It seems that cypress test flakiness has increased over time. Additionally, now it seems that cypress tests that often pass in the local dev environment, may fail pretty consistently in github actions.
A secondary goal was to restructure the github actions to share code that was used in more than one place.
Last, certain qunit tests were subject to failure because of a hardcoded year in 'expect'. This has been fixed.
Approach
After researching what might be causing these failures in github actions and trying various strategies, I found that the test failures, and some of the flakiness, was caused by trying to distribute the tests over several containers, and run those containers in parallel on the same machine in a github action. I read somewhere that this has been found not to work so well, so I removed it, and now the tests seem to run well both locally and in github actions.
The cypress-io/github-action offers the ability to run tests in parallel in order to shorten the the time it takes to run test suites. This is implemented in gihub actions by specifying a container matrix and using the 'parallel: true' flag, as can be seen here.
I hope to be able to take advantage of the parallelization feature with future upgrades. Also it should be noted that even though the test performance has improved, there is still some flakiness inherent in the Cypress test suite.
Some resources: Cypress Cloud - Parallelization, GitHub Actions - Run Tests in Parallel, Cypress Documentation - GitHub Actions
Open Questions and Pre-Merge TODOs
Learning
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Reviewer, please remember our guidelines: