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: build Cypress for darwin-arm64 #20686

Merged
merged 63 commits into from
Jun 15, 2022
Merged

feat: build Cypress for darwin-arm64 #20686

merged 63 commits into from
Jun 15, 2022

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented Mar 18, 2022

User facing changelog

  • Cypress is now available natively on Apple Silicon/M1.

Additional details

  • Adds build process utilizing the MacStadium runner.
  • Updates CLI to detect arm64 arch properly.
  • Removes add-install-comment automation that didn't work on Monterey and replaces it with a local octokit implementation.
  • Services PR: https://github.com/cypress-io/cypress-services/pull/4585

How has the user experience changed?

People can now use a native build which should provide superior performance to running via Rosetta.

Benchmarking highlights:

  • Running tests in Electron (cypress run ...) is roughly 2.5x faster
  • Running tests in Chrome is improved, but not very much - only ~1.1x faster
  • Time between cypress open and when the Launchpad is fully rendered has decreased 3.5x - median dropped from 9.73s to 2.8s
  • Time between cypress open --testingType --browser electron and when the Project GUI/App view is fully rendered decreased 3.2x - from 14s to 4.3s

Full benchmark data: https://docs.google.com/spreadsheets/d/1SHA2KgTywB6rNgPx8GfdlwoG9JDyWioo4QGo2QPK93M/edit#gid=0

Steps to test

  • Use the latest pre-release comment on this PR and attempt to install via npm i inside of an M1 machine with or without Rosetta.

PR Tasks

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 18, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Mar 18, 2022



Test summary

37553 0 454 0Flakiness 6


Run details

Project cypress
Status Passed
Commit ff55e6c
Started Jun 14, 2022 4:10 PM
Ended Jun 14, 2022 4:28 PM
Duration 18:29 💡
OS Linux Debian - 10.11
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

commands/actions/click.cy.js Flakiness
1 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth
e2e/origin/navigation.cy.ts Flakiness
1 errors > fails in cy.origin when a command is run after we return to localhost
next.cy.ts Flakiness
1 Working with next-12.1.6 > should live-reload on src changes
e2e/origin/basic_login.cy.ts Flakiness
1 basic login > visit primary first > logs in with idp redirect
e2e/origin/commands/assertions.cy.ts Flakiness
1 cy.origin assertions > #consoleProps > .should() and .and()
This comment includes only the first 5 flaky tests. See all 6 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@flotwig flotwig marked this pull request as ready for review June 11, 2022 03:47
@flotwig flotwig requested review from a team as code owners June 11, 2022 03:47
@flotwig flotwig requested review from jennifer-shehane and removed request for a team June 11, 2022 03:47
@tbiethman tbiethman requested review from ryanthemanuel and rockhold and removed request for jennifer-shehane June 13, 2022 15:35
cli/lib/util.js Outdated Show resolved Hide resolved
@lmiller1990
Copy link
Contributor

Wow, even on a toy project with just 2 specs (both failing, but that's not the point):

# m1
yarn cypress run --component --project ~/code/dump/basic-cypress  7.50s user 2.32s system 138% cpu 7.097 total

# x64
yarn cypress run --component --project ~/code/dump/basic-cypress  36.86s user 4.51s system 197% cpu 20.970 total

Around 5x speedup!

Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Looking over the code, it's mostly just configuration - basically the kind of thing I was expect.

I tried the pre-release and it's really quick. I posted some numbers in another comment, but I'm seeing about a 5x speedup on a few toy projects! ⚡

Copy link
Contributor

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

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

Tried it out on my M1 and it works like a charm ✨

@astone123
Copy link
Contributor

Works great on my M1 🎉

@flotwig flotwig merged commit e18b0d5 into develop Jun 15, 2022
@flotwig flotwig deleted the use-m1-runners branch June 15, 2022 15:24
@alavkx
Copy link

alavkx commented Jun 15, 2022

image

@maikdiepenbroek
Copy link

The pre-release works like a charm! thanks!

@Kocal
Copy link
Contributor

Kocal commented Jun 22, 2022

I've just updated to 10.2.0 and everything is SO MUCH FASTER. Before, I had to wait ~15 sec to open cypress, open the browser, listing specs... now it's literally instantaneous!

Thanks @flotwig for your work! :)

BeijiYang pushed a commit to BeijiYang/cypress that referenced this pull request Jun 23, 2022
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.

Native support for Apple Silicon (M1 / arm64 architecture)
10 participants