Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vrukesh opened this issue Oct 12, 2023 · 5 comments
Labels

Comments

@vrukesh
Copy link

vrukesh commented Oct 12, 2023

Jenkins and plugins versions report

In Permalinks, "Latest Test Result" field is not even shown for builds not completed in "lastCompletedBuild/testReport/"
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

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

image-2023-10-05-08-31-35-645

Expected Results

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

image-2023-10-05-08-39-29-881

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

image-2023-10-05-08-31-35-645

Actual Results

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

image-2023-10-05-08-39-29-881

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

image-2023-10-05-08-31-35-645

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

@vrukesh vrukesh added the bug label Oct 12, 2023
@timja
Copy link
Member

timja commented Oct 12, 2023

This is because "lastCompletedBuild" can indicate passed or failed build. When build is failed, obviously, test report does not get generated.

Why would it not get generated?

The expected pattern is either than you set your build to not fail on test errors and let the junit plugin run or that you catch the error and let junit run.

Either way the junit plugin should be the one that aborts the build normally if configured to do so (the default).

This seems like a misconfiguration in your build

@vrukesh
Copy link
Author

vrukesh commented Oct 13, 2023

Tim
Are you suggesting that even if build fails, we should still execute the tests (whose number run into hundreds of thousands)?
Vrukesh

@timja
Copy link
Member

timja commented Oct 13, 2023

Ah I see right, I think this makes sense then but will need testing in a few scenarios to make sure it's right.

@vrukesh
Copy link
Author

vrukesh commented Nov 2, 2023

Hi Tim,
Hope we are making progress to fix+test this.
Do you have any tentative timelines to share for the availability of the fix?
Thanks,
Vrukesh

@timja
Copy link
Member

timja commented Nov 2, 2023

Would you be able to contribute a pull request? Currently I do not have time to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants