junit-plugin icon indicating copy to clipboard operation
junit-plugin copied to clipboard

check result is not reported if no tests are found

Open jtnord opened this issue 2 years ago • 1 comments
trafficstars

Jenkins and plugins versions report

Environment
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 before the check is published

jtnord avatar Mar 02 '23 15:03 jtnord

Having this as well. Running KICS against a Terraform module. Everything is good so no tests are reported in the output. Thus the plugin fails.

XML output by KICS when 100% successful:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="KICS development" time="22.202968066s" failures="0"></testsuites>

Suggestion: Junit plugin should report no failures if the XML report has no tests.

davidjeddy avatar May 22 '23 11:05 davidjeddy