jestjs / jestjs/jest

[Bug]: shard option and global coverageThreshold config

Open
#12,751 29 comments 49 reactions 0 assignees View on GitHub
:bug: Bug Help Wanted Pinned
Dominant language
TypeScript
Stars
45.5k
Forks
6.7k
Avg merge
17h 22m
Merged PRs (30d)
24

Description

### Version

28.0.1

### Steps to reproduce

Run tests with the `shard` option and have `coverageThreshold` defined in the config with some `global` values.

### Expected behavior

The `global` values should only be tested against tests who ran in the given shard

### Actual behavior

the `global` values are used for all tests, even those who don't run in the same shard

### Additional context

I'm actually not 100% sure about the right behavior to have here. But if we set some global coverage threshold, those won't be met because only a subset of tests run on each shard. All others are considered 0

### Environment

```shell
System:
OS: macOS 11.6.4
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 16.14.1 - ~/.volta/tools/image/node/16.14.1/bin/node
npm: 8.5.0 - ~/.volta/tools/image/node/16.14.1/bin/npm
npmPackages:
jest: ^28.0.1 => 28.0.1
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in Jest 28.0.1 with the shard option and a global coverageThreshold configuration. Compare coverage evaluation for tests in the selected shard with tests outside it; done means the global thresholds are evaluated consistently with the agreed shard behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.