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

Reduce Cypress Mock Test Execution Time #3579

Draft
wants to merge 132 commits into
base: main
Choose a base branch
from

Conversation

antowaddle
Copy link
Contributor

@antowaddle antowaddle commented Dec 16, 2024

Description

image

Job Separation:

  • The new workflow separates tasks into distinct jobs: Setup, Lint, Unit-Tests, Get-Test-Groups, Cypress-Mock-Tests, and Combine-Results-and-Upload.
  • This separation allows for better parallelization and clearer organization of tasks.
  • Significantly, there is a time execution reduction of ~30-35 mins for the Mock tests to execute, this will increase efficiency and enhance productivity of the team.

Caching Strategy:

  • The new workflow consolidates caching into a single step in the Setup job, caching all node modules at once.

Linting:

  • A dedicated Lint job has been added, improving code quality checks.

Unit Testing:

  • Unit tests now have their own job, with improved handling of coverage reports.
  • The new workflow explicitly copies coverage results to a specific directory and uploads them as an artifact.

Cypress Testing:

  • The new workflow introduces dynamic test group generation with the Get-Test-Groups job.
  • Cypress tests are now run in parallel for different test groups, this greatly redused the execution time by around 80%.

Results Combination:

  • A new Combine-Results-and-Upload job has been added to merge results from unit tests and Cypress tests.

Artifact Handling:

  • The new workflow uploads multiple artifacts at different stages (unit tests, Cypress tests, combined results).

Codecov Integration:

  • The Codecov upload is now part of the Combine-Results-and-Upload job, ensuring it receives the complete test coverage data.

How Has This Been Tested?

I've executed the PR on a number of builds and checked the results accordingly.

How Can This Been Tested?

Pull the code locally, then make a mock commit/push and the Github action will trigger the pipeline.

Test Impact

N/A.

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

antowaddle and others added 30 commits November 20, 2024 17:07
increase card timeout and delete active wait
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 23.80%. Comparing base (ed014b8) to head (937d747).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #3579       +/-   ##
===========================================
- Coverage   85.00%   23.80%   -61.20%     
===========================================
  Files        1404     1380       -24     
  Lines       32244    27705     -4539     
  Branches     9042     8199      -843     
===========================================
- Hits        27408     6596    -20812     
- Misses       4836    21109    +16273     

see 1262 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed014b8...937d747. Read the comment docs.

@antowaddle antowaddle changed the title Reduce Cypress Execution Time with Github Actions Parallel Jobs Reduce Cypress Mock Test Execution Time Dec 30, 2024
Copy link
Contributor

openshift-ci bot commented Jan 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign emilys314 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress This PR is in WIP state
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants