Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jan 14, 2021

Speeds up our CircleCI Cypress tests with a few optimizations.

  • Turn on CircleCI parallelization and change scripts/run_e2e_tests.py to accommodate this
  • Fix venv previously not caching
  • Start caching the node_modules folder and stop running yarn install if node_modules is already found
  • Change scripts/run_e2e_tests.py to spawn its own React app server
  • Swapped out mochawesome for cypress-circleci-reporter, which automatically handles all the reporting needed by CircleCI's circleci tests split --split-by=timings

Results

  • Cypress tests went from 40 minutes to 10-15
  • Test setup time (installing virtualenv, node_modules, everything except actually running the test) now takes 1-2 mins total
  • Removed dependency on start-server-and-test and removed cy:serve-and-run* Yarn tasks

Fixes #90

@ghost ghost changed the title Cypress speedup Speed up Cypress tests Jan 15, 2021
@ghost ghost marked this pull request as ready for review January 15, 2021 20:13
@ghost ghost self-requested a review January 15, 2021 20:13
@ghost ghost requested a review from AnOctopus January 15, 2021 21:22
Copy link
Contributor

@AnOctopus AnOctopus left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall. I have a few small changes/additions that I think would be good but that I'm not entirely sure about.

There's a bunch of added functions that don't have types on them that would be trivial to add, but it doesn't seem like we hard require them so that isn't a blocker.

@ghost
Copy link
Author

ghost commented Jan 15, 2021

@AnOctopus Thanks for the review, made requested changes.

Copy link
Contributor

@tconkling tconkling left a comment

Choose a reason for hiding this comment

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

This is wonderful!

@ghost
Copy link
Author

ghost commented Jan 20, 2021

@tconkling Made requested changes.

Great, so looks like tests are passing and I've got two approvals. Since it affects everyone, I'll just bring it up one more time at next standup, then merge.

@ghost ghost merged commit a2815a4 into streamlit:develop Jan 21, 2021
@ghost ghost deleted the massive-cypress-speedup branch January 21, 2021 19:12
tconkling added a commit to tconkling/streamlit that referenced this pull request Jan 25, 2021
* develop:
  ✨ Support "auto" as the new default for st.image's `use_column_width` (streamlit#2635)
  fix branch name in pr-preview (streamlit#2644)
  ♻️ Remove "_proto" from "exception_proto.py" (streamlit#2638)
  ♻️ Remove "_proto" from "media_proto.py" and "iframe_proto.py" (streamlit#2639)
  Refactor: remove "_proto" from "image_proto.py" (streamlit#2626)
  correct info on url shortening behavior (streamlit#2576)
  Set "overflow:visible" on st.expander (streamlit#2611)
  Revert "Revert "Add anchors to Markdown headers (streamlit#2513)""
  Fix file uploader docs + change to getvalue (streamlit#2628)
  Update change log
  Update notices
  Up version to 0.75.0
  Revert "Add anchors to Markdown headers (streamlit#2513)"
  Speed up Cypress tests (streamlit#2600)
  Remove "beta feature" notice on st.color_picker (streamlit#2625)
  Deflake multiselect snapshot test by waiting for stale-element (streamlit#2624)
  Rerender Maybe components when they're first disabled (streamlit#2617)
  Increase side padding to 5rem when app is in wide mode (streamlit#2613)
This pull request was closed.
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.

Run Cypress tests in parallel using node module api

2 participants