itwinjs-core icon indicating copy to clipboard operation
itwinjs-core copied to clipboard

Consider sharding unit tests to speed up builds

Open ben-polinsky opened this issue 9 months ago • 2 comments

Our CI builds take 16-20 mins with the bulk of that time spent running unit tests (> 10 mins). Any significant decrease in this time would be welcome. Vitest allows you to shard tests across multiple machines.

AppUI added this and dropped build times from 11mins to 7mins.

We would have to move our remaining tests to vitest and consider the additional VM usage this would require.

@hl662 thoughts?

ben-polinsky avatar Jun 16 '25 12:06 ben-polinsky

it would be great to do this yes, we would have to do some experimenting in context of rush, see how to invoke sharding there and if it messes up with the parallelism that rush does on default across the monorepo. The number of machines involved too - we test against 3 OS platforms, so sharding 3 times would mean 9 VMs needed?

hl662 avatar Jun 16 '25 22:06 hl662

sharding 3 times would mean 9 VMs needed?

Yes. If they were only reserved for the time of the tests would be nice.

ben-polinsky avatar Jun 17 '25 00:06 ben-polinsky