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

feat(testing): distribute cypress tests for ci #20188

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented Nov 10, 2023

Current Behavior

Cypress projects are run as a suite in CI.

Expected Behavior

Cypress tasks are configured for each each spec file and then linked by a parent task. The task to run is the parent task, called e2e-ci by default.
graph (12)

What this allows Nx to do is run these tasks in parallel distributed across multiple machines via DTE.

Ultimately, this means that cypress suites are run across multiple machines in less time AND each spec file is cached independently.

This PR also contains other changes too

Cypress changes

  1. A cache is added to the node construction so that it doesn't need to run unless something in the project changes. This isn't bullet proof but should help a lot for the performance issues. This might need to be tweaked further after testing.

Devkit

  1. There is a new internal function in devkit which allows other plugins to easily hash a project's files so that they too can cache their target construction.

Related Issue(s)

Fixes #

Copy link

vercel bot commented Nov 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Nov 15, 2023 8:07pm

@FrozenPandaz FrozenPandaz force-pushed the cypress-experiment branch 10 times, most recently from 2f791a3 to 9d3bf06 Compare November 14, 2023 16:26
@FrozenPandaz FrozenPandaz changed the title chore(repo): wip feat(testing): distribute cypress tests for ci Nov 14, 2023
@FrozenPandaz FrozenPandaz marked this pull request as ready for review November 14, 2023 18:10
@FrozenPandaz FrozenPandaz requested review from a team as code owners November 14, 2023 18:10
@FrozenPandaz FrozenPandaz force-pushed the cypress-experiment branch 2 times, most recently from ab73d59 to 827fcc8 Compare November 14, 2023 18:54
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner November 14, 2023 18:54
@FrozenPandaz FrozenPandaz merged commit 8a0707d into nrwl:master Nov 15, 2023
6 checks passed
@jogelin
Copy link
Contributor

jogelin commented Nov 16, 2023

@FrozenPandaz do you plan to do the same for playwright as it was done here https://github.com/nrwl/tic-tac-toe-playwright/tree/e2e-sharding ?

I am curious because I wrote about it and I want to stay up to date ;) https://jgelin.medium.com/nx-distribute-e2e-task-execution-for-playwright-and-cypress-e3aa8811842a

Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants