Skip to content

Commit f4a33a9

Browse files
committed
Add speeding up stage 3
1 parent 1819f56 commit f4a33a9

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

‎tutorial/stage-3-endform-integration/speeding-up-with-endform.mdx‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar:
66
---
77

88
import { Aside } from '@astrojs/starlight/components';
9+
import { Image } from "astro:assets";
10+
import TestTimeChart from "../../../assets/test-time-chart.png";
911

1012
In this guide, we will use endform to speed up your test suite.
1113

@@ -16,3 +18,66 @@ For more information about getting started with the tutorial repository, go [her
1618

1719
At this point in time, we have a pretty decent Playwriht end to end testing suite that can test most of the dummy features in this application.
1820
We can test complex multi user flows like inviting, and we have the ability to create new users on demand when the user data conflicts with other tests.
21+
22+
Since this a very simple application, our tests are thankfully very fast to run. Let's explore their performance.
23+
24+
## Running the tests
25+
26+
We are familiar with running the tests with Playwright:
27+
28+
```bash
29+
pnpm playwright test
30+
```
31+
32+
Let's try running the tests with Endform also to get a benchmark:
33+
34+
```bash
35+
pnpm endform test
36+
```
37+
38+
On my machine (M2 Macbook Pro), the tests ran in 20 seconds with Playwright, and 25 seconds with Endform.
39+
40+
With these very fast, very small, and few tests - uploading and running the tests on Endform's remote runners aren't giving us much of a speedup.
41+
42+
## Cranking up the heat
43+
44+
Let's see what happens when we run more tests.
45+
46+
```bash
47+
pnpm playwright test --repeat-each 2
48+
```
49+
50+
```bash
51+
pnpm endform test --repeat-each 2
52+
```
53+
54+
Here, Playwright took 30 seconds, and Endform took 25 seconds.
55+
56+
```bash
57+
pnpm playwright test --repeat-each 5
58+
```
59+
60+
```bash
61+
pnpm endform test --repeat-each 5
62+
```
63+
64+
Here, Playwright took 30 seconds, and Endform took 25 seconds.
65+
66+
If we plot the results of different repeat counts, we get:
67+
68+
<Image src={TestTimeChart} alt="A chart of the test time for different repeat counts" width={600} />
69+
70+
Once we start to add more tests (or if the tests had taken longer to run), Playwright will keep slowing your suite down,
71+
while Endform will keep the speed constant.
72+
73+
### Other influential factors
74+
75+
This is one case of the speed of this particular suite, but lots of things have an impact on the speed of a suite.
76+
Like:
77+
78+
- How reliable or flaky the tests are
79+
- How long the tests take to run
80+
- How slow the slowest test is
81+
- How performant the app the tests are run against is
82+
83+
We think that we have the fastest Playwright test runner on the market, but we're really curious to hear what your experience in running Endform versus Playwright in your test suite is like.
21.5 KB
Loading

0 commit comments

Comments
 (0)