Loading
Current section: Performance 6 exercises
Problem

Sharding

Split large Vitest suites into shards to run tests across multiple processes or CI jobs, reducing runtime and handling thousands of cases.

Loading exercise

Transcript

00:00 Another way to improve test performance when you have a lot of test files is to split those test files into groups. That approach is called sharding, and those groups, shards. Effectively, that means running multiple VITAS processes where every process focuses on its own shard. And then you can run them in parallel, for example, in different jobs on your CICD pipelines.

00:19 In this exercise, you will explore sharding in more detail because I have another application for you that has a lot of test files. Your task will be to split them into four different groups and then run them in parallel and merge the results. And once you're done, we will talk more about sharding and how you would use it on CI, using GitHub Actions as an example.