jenkinsci / jenkinsci/junit-plugin

In Permalinks, "Latest Test Result" field is not even shown for builds not completed in "lastCompletedBuild/testReport/"

Open
#577 5 comments 0 reactions 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

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.

![image-2023-10-05-08-39-29-881](https://github.com/jenkinsci/junit-plugin/assets/75658153/88fb7d4b-e10e-4033-9879-c6281d04a77f)

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

![image-2023-10-05-08-31-35-645](https://github.com/jenkinsci/junit-plugin/assets/75658153/25687a7d-a42a-4c5f-b32d-9df17e8e244e)

### Expected Results

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

![image-2023-10-05-08-39-29-881](https://github.com/jenkinsci/junit-plugin/assets/75658153/88fb7d4b-e10e-4033-9879-c6281d04a77f)

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

![image-2023-10-05-08-31-35-645](https://github.com/jenkinsci/junit-plugin/assets/75658153/25687a7d-a42a-4c5f-b32d-9df17e8e244e)

### Actual Results

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

![image-2023-10-05-08-39-29-881](https://github.com/jenkinsci/junit-plugin/assets/75658153/88fb7d4b-e10e-4033-9879-c6281d04a77f)

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

![image-2023-10-05-08-31-35-645](https://github.com/jenkinsci/junit-plugin/assets/75658153/25687a7d-a42a-4c5f-b32d-9df17e8e244e)

### 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.