Gleb Bahmutov PRO
JavaScript ninja, image processing expert, software quality fanatic
The latest updates from
Brian Mann
Gleb Bahmutov
Founder & Creator
VP Engineering
Oct 16, 2018 Webinar
I want my tests to finish quickly
If my CI can allocate 10 machines for me - why can't the tests run 10x faster?
And I want zero config
$ cypress run --record --parallel
Cypress v3.1.0
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
Dashboard
specs
specs
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
a.spec.js
b.spec.js
c.spec.js
...
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
Dashboard
a.spec.js (2s)
b.spec.js (10s)
c.spec.js (5s)
...
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
b.spec.js (10s)
c.spec.js (5s)
a.spec.js (2s)
...
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
🔄 b.spec.js (10s)
c.spec.js (5s)
a.spec.js (2s)
...
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
🔄 b.spec.js (10s)
🔄 c.spec.js (5s)
a.spec.js (2s)
...
c.spec.js
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
c.spec.js
🔄 b.spec.js (10s)
🔄 c.spec.js (5s)
a.spec.js (2s)
...
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
pass / fail
🔄 b.spec.js (10s)
🔄 c.spec.js (5s)
a.spec.js (2s)
...
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
🔄 b.spec.js (10s)
✅ c.spec.js (5s)
a.spec.js (2s)
...
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
🔄 b.spec.js (10s)
✅ c.spec.js (5s)
🔄 a.spec.js (2s)
...
a.spec.js
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
a.spec.js
🔄 b.spec.js (10s)
✅ c.spec.js (5s)
🔄 a.spec.js (2s)
...
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
pass / fail
🔄 b.spec.js (10s)
✅ c.spec.js (5s)
🔄 a.spec.js (2s)
...
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
🔄 b.spec.js (10s)
✅ c.spec.js (5s)
✅ a.spec.js (2s)
...
and the process repeats until all specs have completed ...
b.spec.js
Dashboard
Machine #1
$ cypress run --record --parallel
$ cypress run --record --parallel
Machine #2
2x-electron:
# tell CircleCI to execute this job on 2 machines simultaneously
parallelism: 2
steps:
- run: npm run e2e:record -- --parallel
2x-electron:
# tell CircleCI to execute this job on 5 machines simultaneously
parallelism: 5
steps:
- run: npm run e2e:record -- --parallel
🤖🤖🤖
🤖🤖🤖
🤖🤖🤖
Text
# machines | run duration | time savings |
---|---|---|
1 | 22:50 | ~ |
2 | 11:47 | 48% |
3 | 7:51 | 65% |
4 | 5:56 | 74% |
6 | 3:50 | 83% |
8 | 3:00 | 87% |
10 | 2:19 | 90% |
10 machines = 10x speed up
# machines | run duration | time savings |
---|---|---|
1 | 22:50 | ~ |
2 | 11:47 | 48% |
3 | 7:51 | 65% |
4 | 5:56 | 74% |
6 | 3:50 | 83% |
8 | 3:00 | 87% |
10 | 2:19 | 90% |
10 machines = 10x speed up
I want to run a few smoke tests then all tests
I want to run tests, deploy, then run tests against the deployed server
I want to run tests using Electron, then again using Chrome / X
$ cypress run --record --group 1x-electron
$ cypress run --record --group 2x-electron --parallel
companion to cypress-io/cypress/issues/1313
switching slides to Brian Mann ...
Remember to ask a question, we will answer them at the end of the webinar
By Gleb Bahmutov
Intro to end-to-end test parallelization and grouping with Cypress Dashboard service. Part of Cypress webinar on October 16 2018. Video at https://www.youtube.com/watch?v=FfqD1ExUGlw
JavaScript ninja, image processing expert, software quality fanatic