-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2414 lines (2359 loc) · 104 KB
/
Copy pathindex.html
File metadata and controls
2414 lines (2359 loc) · 104 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- BEGIN Info -->
<meta
name="description"
content="Conifer - An open-source framework that allows developers to easily deploy an infrastructure that runs Cypress tests in parallel which reduces the total time it takes to execute a full test suite for local development."
/>
<meta name="title" property="og:title" content="Conifer" />
<meta property="og:type" content="Website" />
<meta name="image" property="og:image" content="images/thumb.png" />
<meta
name="description"
property="og:description"
content="Conifer - An open-source framework that allows developers to easily deploy an infrastructure that runs Cypress tests in parallel which reduces the total time it takes to execute a full test suite for local development."
/>
<meta name="author" content="Conifer" />
<!-- END Info -->
<script
defer
data-domain="conifer-test.github.io"
src="https://plausible.io/js/plausible.js"
></script>
<!-- BEGIN favicon -->
<link
rel="apple-touch-icon"
sizes="180x180"
href="images/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="images/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="images/favicon/favicon-16x16.png"
/>
<link rel="manifest" href="images/favicon/site.webmanifest" />
<link
rel="mask-icon"
href="images/favicon/safari-pinned-tab.svg"
color="#5bbad5"
/>
<link rel="shortcut icon" href="images/favicon/favicon.ico" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta
name="msapplication-config"
content="images/favicon/browserconfig.xml"
/>
<meta name="theme-color" content="#ffffff" />
<!-- END favicon -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Conifer</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/@tailwindcss/[email protected]/dist/typography.min.css"
/>
<link rel="stylesheet" href="stylesheets/reset.css" />
<link rel="stylesheet" href="stylesheets/style.css" />
<link rel="stylesheet" href="stylesheets/responsive.css" />
</head>
<body>
<header class="mobile-menu-closed">
<div id="header">
<a href="/">
<img src="images/logo/logo-name.svg" />
</a>
<nav>
<a href="#start-here" class="selected">Start Here</a>
<a href="#case-study">Case Study</a>
<a href="#presentation">Presentation</a>
<a href="#our-team">Our Team</a>
<a
href="https://github.com/conifer-test/conifer/blob/main/README.md"
target="_blank"
>Docs</a
>
<a href="https://github.com/conifer-test" target="_blank" class="icon"
><i class="fab fa-github"></i
></a>
</nav>
<div id="menu">
<button type="button">
<svg
id="mobile-open"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
<svg
id="mobile-close"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
</div>
</div>
<div id="header-buffer"></div>
<div id="mobile-menu">
<a href="#start-here" class="selected">Start Here</a>
<a href="#case-study">Case Study</a>
<a href="#presentation">Presentation</a>
<a href="#our-team">Our Team</a>
<a
href="https://github.com/conifer-test/conifer/blob/main/README.md"
target="_blank"
>Docs</a
>
<a href="https://github.com/conifer-test" target="_blank"
><i class="fab fa-github"></i>GitHub</a
>
</div>
</header>
<div id="start-here" class="main-section">
<div class="h-full">
<div class="static-logo-color"></div>
<div class="bg-gray">
<img
class="conifer sm-screen"
src="images/logo/conifer_white_graphic_color.png"
/>
<img
class="conifer lg-screen"
src="images/logo/conifer-name-white.png"
/>
<p class="light-text">
An open-source framework that<br />
simplifies <span class="text-green">parallelizing</span> Cypress
tests <br />on AWS infrastructure.
</p>
</div>
</div>
<div class="h-full">
<div class="bg-green static-logo-white">
<h2>Easy to Manage & Deploy</h2>
</div>
<div class="bg-green">
<h2 class="sm-header">Easy to Manage & Deploy</h2>
<p>
Conifer abstracts away the complexity <br />
of working with cloud infrastructure <br />
by automating the deployment process
</p>
<img class="lazy" data-src="images/diagrams/conifer_init.gif" />
</div>
</div>
<!-- <div class="h-full">
<div class="bg-pink static-logo-pink-light">
<h2>Text and Text2</h2>
</div>
<div class="bg-pink">
<h2 class="sm-header">Text and Text2</h2>
<p>
Some other text
</p>
<video autoplay loop muted playsinline class="pad">
<source
src="images/diagrams/infrastructure-3.mp4"
type="video/mp4"
/>
</video>
</div>
</div> -->
</div>
<aside id="toc">
<ul>
<!-- Section 1 -->
<li data-section="section-1" class="selected">
<a href="#section-1">
<div>
<div class="bullet"><div></div></div>
<p>Introduction</p>
</div>
</a>
</li>
<li data-section="section-1" class="subitem">
<a href="#section-1-1">
<div>
<div class="bullet"><div></div></div>
<p>What is Conifer?</p>
</div>
</a>
</li>
<li data-section="section-1" class="subitem">
<a href="#section-1-2">
<div>
<div class="bullet"><div></div></div>
<p>What is Testing?</p>
</div>
</a>
</li>
<!-- Section 2 -->
<li data-section="section-2">
<a href="#section-2">
<div>
<div class="bullet"><div></div></div>
<p>What Problem Does Conifer Solve?</p>
</div>
</a>
</li>
<li data-section="section-2" class="subitem">
<a href="#section-2-1">
<div>
<div class="bullet"><div></div></div>
<p>Hypothetical Use Case</p>
</div>
</a>
</li>
<!-- Section 3 -->
<li data-section="section-3">
<a href="#section-3">
<div>
<div class="bullet"><div></div></div>
<p>How to Speed Up E2E Testing</p>
</div>
</a>
</li>
<li data-section="section-3" class="subitem">
<a href="#section-3-1">
<div>
<div class="bullet"><div></div></div>
<p>Executing Tests in Parallel</p>
</div>
</a>
</li>
<!-- Section 4 -->
<li data-section="section-4">
<a href="#section-4">
<div>
<div class="bullet"><div></div></div>
<p>Existing Solutions</p>
</div>
</a>
</li>
<li data-section="section-4" class="subitem">
<a href="#section-4-1">
<div>
<div class="bullet"><div></div></div>
<p>Software as a Service (SaaS)</p>
</div>
</a>
</li>
<li data-section="section-4" class="subitem">
<a href="#section-4-2">
<div>
<div class="bullet"><div></div></div>
<p>DIY Solution</p>
</div>
</a>
</li>
<!-- Section 5 -->
<li data-section="section-5">
<a href="#section-5">
<div>
<div class="bullet"><div></div></div>
<p>Introducing Conifer</p>
</div>
</a>
</li>
<!-- Section 6 -->
<li data-section="section-6">
<a href="#section-6">
<div>
<div class="bullet"><div></div></div>
<p>Benchmarking Conifer</p>
</div>
</a>
</li>
<!-- Section 7 -->
<li data-section="section-7">
<a href="#section-7">
<div>
<div class="bullet"><div></div></div>
<p>Algorithm</p>
</div>
</a>
</li>
<li data-section="section-7" class="subitem">
<a href="#section-7-1">
<div>
<div class="bullet"><div></div></div>
<p>Stage 1: Allocate by File Count</p>
</div>
</a>
</li>
<li data-section="section-7" class="subitem">
<a href="#section-7-2">
<div>
<div class="bullet"><div></div></div>
<p>Stage 2: Allocate by Timing Data</p>
</div>
</a>
</li>
<!-- Section 8 -->
<li data-section="section-8">
<a href="#section-8">
<div>
<div class="bullet"><div></div></div>
<p>Behind the Scenes: How Conifer Works</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-1">
<div>
<div class="bullet"><div></div></div>
<p>Overview of Responsibilities</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-2">
<div>
<div class="bullet"><div></div></div>
<p>Preparing Infrastructure Components</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-3">
<div>
<div class="bullet"><div></div></div>
<p>Blueprint for a Single Node: Docker Image</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-4">
<div>
<div class="bullet"><div></div></div>
<p>Provisioning the Infrastructure</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-5">
<div>
<div class="bullet"><div></div></div>
<p>Managing the Test Orchestration Process</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-6">
<div>
<div class="bullet"><div></div></div>
<p>Executing the Test Suite: A Single Node</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-7">
<div>
<div class="bullet"><div></div></div>
<p>Persisting Test Results</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-8">
<div>
<div class="bullet"><div></div></div>
<p>Communicating Test Results to the User</p>
</div>
</a>
</li>
<li data-section="section-8" class="subitem">
<a href="#section-8-9">
<div>
<div class="bullet"><div></div></div>
<p>Final Architecture</p>
</div>
</a>
</li>
<!-- Section 9 -->
<li data-section="section-9">
<a href="#section-9">
<div>
<div class="bullet"><div></div></div>
<p>Implementation Challenges</p>
</div>
</a>
</li>
<li data-section="section-9" class="subitem">
<a href="#section-9-1">
<div>
<div class="bullet"><div></div></div>
<p>Running Cypress Tests on the Cloud</p>
</div>
</a>
</li>
<li data-section="section-9" class="subitem">
<a href="#section-9-2">
<div>
<div class="bullet"><div></div></div>
<p>Sending Test Results to the User</p>
</div>
</a>
</li>
<!-- Section 10 -->
<li data-section="section-10">
<a href="#section-10">
<div>
<div class="bullet"><div></div></div>
<p>Future Work</p>
</div>
</a>
</li>
<li data-section="section-10" class="subitem">
<a href="#section-10-1">
<div>
<div class="bullet"><div></div></div>
<p>Dynamic Allocation of Tests</p>
</div>
</a>
</li>
<li data-section="section-10" class="subitem">
<a href="#section-10-2">
<div>
<div class="bullet"><div></div></div>
<p>Go Serverless</p>
</div>
</a>
</li>
<li data-section="section-10" class="subitem">
<a href="#section-10-3">
<div>
<div class="bullet"><div></div></div>
<p>Improve Efficiency and User Experience</p>
</div>
</a>
</li>
</ul>
</aside>
<div id="case-study" class="main-section">
<div id="case-study-content">
<div class="prose">
<h1>Case Study</h1>
<!-- Section 1 -->
<h2 id="section-1">1. Introduction</h2>
<!-- <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida
neque convallis a cras semper auctor neque vitae tempus. At auctor
urna nunc id cursus metus aliquam. Ut tellus elementum sagittis
vitae et leo duis. Sit amet purus gravida quis blandit turpis cursus
in. Sollicitudin nibh sit amet commodo.
</p>
<ul>
<li><strong>Strong</strong>: List item.</li>
<li><strong>Strong</strong>: List item.</li>
<li><strong>Strong</strong>: List item.</li>
</ul>
<ol>
<li>List item.</li>
<li>List item.</li>
<li>List item.</li>
<li>List item</li>
</ol>
<blockquote>"Sample quote”</blockquote>
<img class="lazy" data-src="images/diagrams/example-image.png" />
<a href="https://link/" target="_blank">link words</a> -->
<h3 id="section-1-1">1.1 What is Conifer?</h3>
<p>
Conifer is an open-source test parallelization solution for Cypress.
Conifer automates the provisioning of a parallelized testing
infrastructure and the deployment of the user's application onto
this infrastructure. The user can then execute their test suite
across the multiple nodes of the parallelized infrastructure to
dramatically reduce the amount of time it takes to test their
application.
</p>
<p>
In this case study, we discuss the background of testing, the
problems faced by developers testing their applications, and
existing approaches to solving those problems. We then introduce
Conifer and compare it to existing solutions. Finally, we explore
how we built Conifer and discuss the key design decisions that we
made and challenges we faced.
</p>
<h3 id="section-1-2">1.2 What is Testing?</h3>
<img
class="lazy"
data-src="images/diagrams/what_is_testing.png"
alt="what is testing"
/>
<p>
In software development, testing is the process of evaluating
whether an application is functioning as intended and ensuring that
it fulfills its design requirements. Testing allows developers to
catch bugs in an application that can then be fixed.
</p>
<p>
Testing has always been an essential element of the software
development process, but it is one that has taken many forms over
the years. Below, we briefly review the history and modern landscape
of testing to explain how Conifer fits in.
</p>
<h4 id="section-1-2-1">
A Brief History of Testing in Software Development
</h4>
<p>
In the past, QA testers performed testing manually-employees tasked
explicitly with detecting bugs in a program. A QA tester would
manually look for bugs and defects in an application, requiring the
tester to use the application, analyze its behavior, and verify any
discrepancies or inconsistent behavior. The QA tester would then
relay these defects to the development team, who would then
implement the necessary fixes to address them.
</p>
<p>
Manual testing was a complex, time-consuming, and error-prone
process. Automated testing was developed to address these
shortcomings. With automated testing, routine tests are formalized
into files/code that describe the testing procedure. Once
formalized, the testing procedure can be carried out by simply
executing these test files, usually with the help of a testing
framework. Compared to manual testing, automatic testing
dramatically reduces the effort required to test; once defined, a
test can be run repeatedly with little effort from the tester, in
shorter amounts of time.
</p>
<p>
Reducing the time and effort required to test an application yielded
many benefits. It increased the frequency that an application could
be tested and made extensive testing coverage less burdensome.
Furthermore, automated tests made it such that the same test could
be run in the exact same manner every time, increasing the
consistency of the testing process. Finally, automating the testing
process into an executable test suite enabled testing to be carried
out by anyone- including the development team.
</p>
<p>
These benefits have made automated testing a central component in
modern-day testing workflows.
</p>
<h4 id="section-1-2-1">Testing in the Modern Day</h4>
<p>
Modern software engineering relies on automated testing to catch
bugs throughout development. Applications are tested early on, and
testing is integrated into every stage of the software development
lifecycle. Developers play a central role in the testing process:
developers run tests themselves rather than entirely outsourcing the
responsibility to the QA team. This new paradigm of pushing testing
towards the early stages of development, known as
<a
href="https://learn.cypress.io/testing-foundations/manual-vs-automated-testing"
>“shift left”</a
>, is being adopted throughout the software development industry.
</p>
<p>
The most thorough form of automated testing is called End-to-End
(E2E) testing: the process of testing an application by interacting
with it from an end-user's perspective.
</p>
<h4 id="section-1-2-2">End-to-End Testing</h4>
<p>
End-to-End tests attempt to ensure that an application behaves as
intended in a real-world scenario. Testing is carried out via the
application's User Interface (UI) by mimicking an end-user's
behavior- clicks, gestures, keyboard inputs, etc. The actual results
of each interaction are compared to the expected results in
real-time to ensure that the application is functioning as designed.
</p>
<p>
E2E tests subject an application to real-world scenarios, enabling
the detection of bugs that may otherwise only be detected by the
application's end-users. Because E2E tests simulate actual user
behavior, passing E2E tests gives a higher level of confidence that
all of the subcomponents of an application function together
correctly.
</p>
<p>
However, this thoroughness and high confidence come at a cost. E2E
tests aim to simulate complex real-world scenarios. This requires a
production-like environment, which means that E2E tests will
generally take more time to set up and write and more effort to
maintain relative to other types of tests. Furthermore, running E2E
tests is often slower and more resource-intensive than other types
of tests due to the complexity associated with simulating real-world
scenarios.
</p>
<p>
Modern E2E testing frameworks, such as Cypress, were designed to
address some of the limitations of E2E testing. These frameworks
simplify writing and maintaining E2E tests by providing a structured
syntax for performing common tasks such as navigating to URLs,
simulating end-user input, and inspecting the page content. By
simplifying the writing and maintenance of E2E tests, these testing
frameworks have enabled more widespread adoption of E2E testing.
</p>
<p>
Cypress, in particular, is a popular and fast-growing E2E testing
framework. It is open-source and JavaScript-based, and its design
makes writing E2E tests easy and improves the developer's testing
experience. However, even with Cypress, E2E tests can have
excruciatingly long test run times. This is due to their
resource-intensive nature, meaning that developers encounter
increasing test run times as test suites grow in size. This can
limit the utility or feasibility of E2E testing with Cypress- a
problem that Conifer is designed to solve.
</p>
<!-- Section 2 -->
<h2 id="section-2">2. What Problem Does Conifer Solve?</h2>
<p>
As an application grows in size and complexity, the time it takes to
test all of its components and features increases proportionally.
Each new feature may require new tests to be added to the test
suite, and the features themselves rely on an increasing number of
components whose functionality must also be tested. The underlying
components that support the application may also become more complex
and interconnected, opening up new avenues of potential failure.
This issue is even more pronounced with comprehensive testing
approaches like End-to-End (E2E) testing.
</p>
<p>
The resource-intensive nature of E2E testing makes E2E tests
particularly prone to being slow. Simulating real-world interactions
with the application requires all of the application's components to
be started, the application state to be loaded, and a browser to
interact with the test. Additional time requirements can result from
testing being carried out through the UI rather than
programmatically. As a result, as an application grows in size and
complexity, E2E testing can take an increasingly long time.
</p>
<img
class="lazy"
data-src="images/diagrams/problem_too_long.png"
alt="testing too long"
width="650"
/>
<p>
Long test-suite execution times can pose a serious problem for
developer productivity and morale. A developer's productivity is
disturbed while they wait for a lengthy test suite to finish
execution. If the test suite is long enough, developers may resort
to context-switching to another task to fill up their time. This
type of environment, where developers' focus is disrupted by
excessive idle time and/or context-switching, poses a hidden cost to
the organization in the form of developer time, stress, and overall
development team productivity.
</p>
<p>
The long time it takes to run a large E2E test suite may lead
developers not to run a test suite as often as they otherwise would.
While skipping additional test suite runs may alleviate some of the
aforementioned issues related to morale and productivity, it can
increase the likelihood of a more severe problem: bugs going
undetected.
</p>
<img
class="lazy"
data-src="images/diagrams/bug_cost_graph.png"
alt="bug cost graph"
width="650"
/>
<p>
The cost of software bug removal tends to vary depending on when the
bug is found. A bug that is discovered early on in the development
process may be trivial to fix. However, this cost increases
dramatically for bugs that make it past the coding phase. Bugs that
make it to the production environment may have catastrophic costs.
In addition to being highly complex and costly to remove, they may
damage the business by disrupting the availability of the service
and affecting end-users.
</p>
<p>
The importance of detecting bugs early has led many engineering
organizations to adopt what has become known as the “fail-fast,
fail-often” approach to software development. This approach
prioritizes detecting and addressing bugs as early as possible in
the development process. Any detected problems are quickly patched
before they have the chance to become embedded in later stages of
development or production where they have the potential to cause
financial, operational, and reputational damage to the organization.
</p>
<p>
Implementation of the “fail-fast, fail-often” strategy relies on the
early detection of bugs and thus relies on the frequent testing of
the application. Problems with the testing process, such as tests
taking a long time to execute, can disrupt the successful execution
of this strategy. This is the situation faced by Drone-On, a
hypothetical company that will be used as an example to better
illustrate Conifer's use case.
</p>
<h3 id="section-2-1">2.1 Hypothetical Use Case</h3>
<img
class="lazy"
data-src="images/diagrams/drone_on.png"
alt="drone on"
width="500"
/>
<p>
Drone-On is an autonomous delivery platform on the long and winding
path to success in Silicon Valley. Drone-On's innovative product and
viral marketing strategy have captivated investors and secured
funding for expansion. However, things didn't always look so good
for the young company-it had faced significant quality control
challenges early on in its development process. A lack of robust
test coverage had resulted in bugs making it to production. These
bugs caused an outage and almost scuttled an investment round that
had been occurring at the time.
</p>
<p>
To address these issues, Drone-On's engineering team adopted the
“fail-fast, fail-often” approach. They integrated testing into every
stage of their development process. For E2E testing, they chose to
use Cypress because it is written in JavaScript, which is familiar
to all Drone-On's developers, and due to it being easy to learn how
to use the framework. Adopting these strategies resulted in the
early detection of bugs and greatly improved the reliability of
Drone-On's products, preventing damage to their growing reputation.
</p>
<p>
As Drone-On continues to expand, so has its test suite. This has
meant that E2E test suites that historically took minutes to run are
now taking half an hour. Drone-On realizes its developers do not
want to wait for all the tests to complete. While the developers are
still running their tests, Drone-On is worried the current situation
will impact morale and eventually lead to testing being performed
less often. If all developers in a company like Drone-On test less
and less during the coding phase, the chance of bugs or errors
escaping into production will increase, risking financial and
reputational damage to the company and harming its growth prospects.
</p>
<p>
Drone-On wants to mitigate these risks to continue enjoying the
benefits of implementing the “fail-fast, fail often” approach. In
order to do so, the company begins investigating how to speed up E2E
testing.
</p>
<!-- Section 3 -->
<h2 id="section-3">3. How to Speed Up E2E Testing</h2>
<p>
A common approach for speeding up computational tasks is
parallelization.
</p>
<h3 id="section-3-1">3.1 Executing Tests in Parallel</h3>
<p>
Like many other applications, testing can be sped up by running a
test suite in parallel. At its core, this involves running multiple
instances of the testing framework/runner simultaneously, each of
which will execute a portion of the test suite. In theory, splitting
up the work of executing the entire test suite across multiple
processes will reduce the total time necessary to run the test
suite.
</p>
<p>
Running tests in parallel has become the standard approach for
speeding up test execution. There are two high-level approaches for
parallelizing test suites: parallelization on a local machine and
parallelization over a network of multiple machines.
</p>
<h4 id="section-3-1-1">Local Parallelization</h4>
<p>
One option is parallelization on the developer's local machine. This
type of parallelization takes advantage of the multi-threaded
processors found in modern computers, which allow them to run
multiple programs in-parallel. The idea in Drone-On's case is to
utilize this capability to run multiple instances of the test runner
on the same machine in order to get through the test suite faster.
</p>
<img
class="lazy"
data-src="images/diagrams/sequential_execution.png"
alt="sequential tests"
width="600"
/>
<p>
Local parallelization would be simple to achieve in certain testing
frameworks that support local parallelization out of the box (e.g.,
Jest, Playwright), although Drone-On's preferred testing framework,
Cypress,
<a href="https://docs.cypress.io/guides/guides/parallelization"
>explicitly cautions developers against doing so</a
>. However, testing framework-compatibility is far from the only
consideration. Another important consideration has to do with
computational resources. When locally parallelizing a task, each
instance of the parallelized task requires a multiple of the
computational resources (CPU, RAM, etc.) in order to run. If the
machine lacks these resources, bottlenecks will occur, leading to
tests executing even slower than they would sequentially and/or
potentially crashing the machine.
</p>
<p>
The issue of computational resources becomes especially significant
in the context of scaling. Drone-On has a large E2E test suite that
is growing by the day. Single-node locally parallelized systems must
be scaled <em>vertically</em>-by adding more resources to the
system. The company already supplies their development team with
top-of-the-line Mac and Linux machines, but the resource-intensive
nature of E2E testing makes it likely that even a modest amount of
scaling can overwhelm the resources of even the best development
computers. In most cases, vertical scaling is only possible to a
certain extent, after which even marginal increases in performance
become cost prohibitive. Drone-On cannot vertically scale further
without purchasing expensive, specially made development machines.
For Drone-On's purposes, E2E test suite execution time can only be
modestly improved via local parallelization.
</p>
<p>
These requirements and limitations make the local parallelization
approach a non-starter for Drone-On. What Drone-On needs is a
parallelization solution that can be more easily scaled.
</p>
<h4 id="section-3-1-2">Multi-Node Parallelization</h4>
<p>
Next, Drone-On investigates multi-node parallelization, where a test
suite is executed simultaneously across multiple machines. Each of
these machines is responsible for running a subset of the complete
test suite so that together, they run the entire test suite.
</p>
<img
class="lazy"
data-src="images/diagrams/parallel_execution.png"
alt="parallel tests"
width="575"
/>
<p>
The primary advantage of multi-node parallelization is its capacity
for scaling. In contrast to locally parallelized systems which must
be scaled vertically, a system that is parallelized over multiple
nodes can be scaled <em>horizontally</em>-by simply adding more
nodes to the system. Horizontally scaling a system in this manner is
much more cost-effective when an abundance of computing resources is
required; it is much cheaper to purchase another unit of a modest
system than to continue adding more resources to a single system.
</p>
<p>
Multi-node parallelization requires physical infrastructure on which
subsets of a complete test suite can be run on. In the past, this
would have required Drone-On to purchase a dedicated network of
computers that would function as the parallelization infrastructure.
In the modern day, we can take advantage of cloud computing to gain
access to the necessary computing infrastructure on an as-needed
basis.
</p>
<p>
By using infrastructure provided by the cloud, we alleviate some of
the issues traditionally associated with horizontal scaling. Cloud
infrastructure removes the barrier to entry to horizontal scaling by
eliminating the upfront cost of purchasing expensive physical
infrastructure Drone-On would not have to pay fixed costs for
systems and would not need to hire in-house maintenance.
Furthermore, systems that rely on cloud-based infrastructure are
typically more flexible because they can easily be scaled up and
down as needed.
</p>
<p>
Drone-On decides to pursue a multi-node parallelization approach
using infrastructure provided by the cloud. It begins investigating
options for implementing such a solution.
</p>
<!-- Section 4 -->
<h2 id="section-4">4. Existing Solutions</h2>
<p>
Solutions for multi-node parallelization of E2E testing can be
divided into two main categories: Software as a Service (SaaS) and
in-house DIY implementations. Each of these solutions represents a
unique set of trade-offs. Drone-On must analyze the pros and cons of
each of these solutions and decide what combination of trade-offs
best suits their particular use case.
</p>
<img
class="lazy"
data-src="images/diagrams/existing_solutions.png"
alt="comparison table"
/>
<h3 id="section-4-1">4.1 Software as a Service (SaaS)</h3>
<p>
SaaS testing solutions, such as LambdaTest, BrowserStack, and Sauce
Labs, are enterprise solutions that offer cloud-based automated
testing services for a price. They are fully-managed solutions that
provide plug-and-play test parallelization on servers provisioned by
the service. These feature-rich solutions support various testing
frameworks and provide comprehensive test-overview and monitoring
solutions. The flexibility, ease of use, and feature-richness of
these services make them a convenient solution for companies that
want a no-hassle solution for speeding up E2E testing.
</p>
<p>
For all of their benefits, SaaS solutions have two significant
drawbacks: high cost and lack of data ownership. The functionality
and ease of use of SaaS solutions come with a direct financial cost,
usually in the form of a high subscription fee plus overage charges.
Second, the fully-managed nature of these services means giving up
some control of data ownership. Having application/test code and
analytics in the hands of a third-party service means trusting that
service to keep your intellectual property safe. And, depending on
the industry, this can also pose compliance issues over how and
where data is shared and hosted.
</p>
<p>
For Drone-On, the benefits of a SaaS solution outweigh the
drawbacks. Drone-On is a small company with only modest funding;
committing to an enterprise solution with a monthly subscription fee
is beyond what it can afford. Additionally, Drone-On has valuable
IP, which, if leaked, would risk the company's entire business
model.
</p>
<h3 id="section-4-2">4.2 DIY Solution</h3>
<p>
Drone-On's team could opt to build their own in-house DIY solution.
At a minimum, this would involve two components: the multi-node test
parallelization infrastructure and a test-orchestrator. The
test-orchestrator would be responsible for allocating the tests
amongst the nodes of the parallel execution infrastructure,
triggering their execution, and returning results.
</p>
<p>
Drone-On could simplify the DIY process by using existing
open-source tools as their test-orchestrator. Cypress Dashboard,
Currents Dashboard, and Sorry Cypress Dashboard are
test-parallelization tools that are intended to speed up Cypress
test suites. These tools are designed to be integrated with a
Continuous Integration (CI) tool, where they are configured to run
tests in response to specific events. When paired with a
purpose-built in-house test parallelization infrastructure, they can
function as the test orchestration service component of a DIY
solution.
</p>
<p>
Building a DIY solution from scratch would give Drone-On complete
control over the feature set and allow them to customize a solution
that meets their specific needs. Depending on the test orchestration
tool, they would also retain ownership of their data, easing
concerns about loss of IP and regulatory compliance. However,
designing such a solution from scratch would require Drone-On to
invest significant time and resources. Additional resources would
need to be allocated for the maintenance of the system. For a small
company like Drone-On, this additional work would eat up a large
portion of their development team, who would otherwise be working on
building-up their core business logic.
</p>
<p>
What Drone-On needs is an open-source, easy-to-use solution that
allows it to speed up the execution of its Cypress end-to-end tests
without compromising control of its data. We designed Conifer to
fill this niche.
</p>
<!-- Section 5-->
<h2 id="section-5">5. Introducing Conifer</h2>
<img
class="lazy"
data-src="images/diagrams/introducing_conifer.png"
alt="conifer solution table"
/>
<p>
Conifer is an open-source test-parallelization solution that was
created for companies or developers who want a simple way to run
Cypress tests in parallel using a multi-node infrastructure. Conifer
positions itself midway between a paid SaaS service and a in-house