jenkinsci / jenkinsci/junit-plugin

check result is not reported if no tests are found

Open
#499 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
87
Forks
351
Avg merge
1d 19h
Merged PRs (30d)
2

Description

### Jenkins and plugins versions report

Environment


```text
Jenkins 2.3xx
junit xxx
```

### What Operating System are you using (both controller, and any agents involved in the problem)?

linux - but not OS specific

### Reproduction steps

setup junit to report checks to github in a pipeline

e.g. `junit checksName: "myUnitTests", testResults: "**/target/surefire-reports/TEST-*.xml`

run the pipeline with no test results

### Expected Results

there is a failing statuc in github for `myUnitTests`

### Actual Results

the build fails

### Anything else?

by code inspection - the check for zero tests [happens](https://github.com/jenkinsci/junit-plugin/blob/727c8120a7f873a96cd86ee8c9cf66f9b2208e80/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java#L279-L285) before the check is [published](https://github.com/jenkinsci/junit-plugin/blob/727c8120a7f873a96cd86ee8c9cf66f9b2208e80/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java#L302-L321)

Contributor guide

Open the contributing guide

Research direction

Read src/main/java/hudson/tasks/junit/JUnitResultArchiver.java around lines 279-285 and 302-321, following how zero test results are handled before GitHub checks are published. Reproduce the pipeline with checksName "myUnitTests" and no matching test results; done means GitHub receives a failing check instead of only the build failing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.