jenkinsci / jenkinsci/junit-plugin
In Permalinks, "Latest Test Result" field is not even shown for builds not completed in "lastCompletedBuild/testReport/"
- Dominant language
- Java
- Stars
- 87
- Forks
- 351
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 2
Description
### Jenkins and plugins versions report
In Permalinks, "Latest Test Result" field is not even shown for builds not completed in "lastCompletedBuild/testReport/"
```text
Jenkins 2.375.4
junit 1189.v1b_e593637fa_e
os.arch aarch64
os.name Linux
os.version 5.10.192-183.736.amzn2.aarch64
java.class.version 55.0
java.runtime.version 11.0.18+10
java.version 11.0.18
java.version.date 2023-01-17
```
As suggested in https://issues.jenkins.io/browse/JENKINS-72124 , we are raising the issue here.
In Permalinks, "Latest Test Result" field is not even shown for builds not completed in "lastCompletedBuild/testReport/"
This is because "lastCompletedBuild" can indicate passed or failed build. When build is failed, obviously, test report does not get generated.
Ideally, "Latest Test Result" field in Permalinks must instead point to "lastSuccessfulBuild/testReport/"
This is about the hyperlink under "Latest Test Result (no failures)" in your screenshot.
When build is successfully completed, it shows this field along with test results.
When build is failed completed, it does NOT show this field.
This brings inconsistency in the view. It would be good to continue to see the last test report.
it is not optimized way of executing tests, even when build is failed. So, it is requested to change this.
Solution is to show hyperlink for "Latest Test Report" from "lastSuccessfulBuild/testReport/" , instead of "lastCompletedBuild/testReport/" .
### What Operating System are you using (both controller, and any agents involved in the problem)?
Jenkins 2.375.4
junit 1189.v1b_e593637fa_e
os.arch aarch64
os.name Linux
os.version 5.10.192-183.736.amzn2.aarch64
java.class.version 55.0
java.runtime.version 11.0.18+10
java.version 11.0.18
java.version.date 2023-01-17
### Reproduction steps
When build is successfully completed, "Latest Test Report" is shown.

When build is failed, "Latest Test Report" is NOT shown.

### Expected Results
When build is successfully completed, "Latest Test Report" is shown.

When build is failed, "Latest Test Report" is NOT shown.

### Actual Results
When build is successfully completed, "Latest Test Report" is shown.

When build is failed, "Latest Test Report" is NOT shown.

### Anything else?
the "Latest Test Result" link is added by junit-plugin rather than the Jenkins core: https://github.com/jenkinsci/junit-plugin/blob/1240.vf9529b_881428/src/main/resources/hudson/tasks/test/TestResultProjectAction/jobMain.jelly#L32
Contributor guide
Assessment
This issue has not been assessed yet.