stryker-mutator / stryker-js

Mutation testing for JavaScript and friends
https://stryker-mutator.io
Apache License 2.0
2.58k stars 248 forks source link

Does stryker.js have a feature to take advantage of Jest sharding? #4806

Closed JasonShin closed 1 month ago

JasonShin commented 6 months ago

Question

Hello, I am trying out stryker-js in my project. The project is quite large and stryker.js can create up to 20k mutants to test.

I'm wondering, in this scenario, is there any feature provided in stryker.js that can work together with Jest sharding?. Jest sharding can take the current CI worker index of the parallel workers, and evenly split up tests based on the current worker index.

Please let me know if there's anything in Stryker.js to

Stryker environment

"@stryker-mutator/core": "^8.2.6",
"@stryker-mutator/jest-runner": "^8.2.6",
"@stryker-mutator/typescript": "^4.0.0",
"@stryker-mutator/typescript-checker": "^8.2.6",
jest: ^29.4.1

Additional context

nicojs commented 1 month ago

We currently don't have a feature like jest sharding. How would such a feature work together with Jest Sharding? As I see it, mutants should be sharded, not tests. So we should implement our own sharding, right?

Have you looked at implementing --incremental mode in CI? As explained in this blog article: https://stryker-mutator.io/blog/announcing-incremental-mode/#-continuous-integration-ci. Would that also solve your problem?

JasonShin commented 1 month ago

@nicojs thanks for the reply. I think you are right, Jest sharding wouldn't bring much value as you've highlighted stryker.js already supports the incremental mode (thanks).

It has been a while since I tried to integrate styker.js with the project that I am working on. The project has a lot of integration tests, mostly needs a lot of database calls. It was quite hard to simply pass the initial text matrix calculation phase due to timing out.

I might try stryker.js again soon