I'm trying to use the xUnit plugin to collect tests from go (using [1]). I've installed and set up the plugin which seems to be working OK except that it doesn't detect any tests. The plugin outputs to the console:
...
go test -v xxx | bin/go2xunit -fail -output go-test.xml
make: Leaving directory `/var/lib/jenkins/jobs/xxx/workspace/go'
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing Custom Tool
[xUnit] [INFO] - [Custom Tool] - 1 test report file(s) were found with the pattern 'go/go-test.xml' relative to '/var/lib/jenkins/jobs/xxx/workspace' for the testing framework 'Custom Tool'.
[xUnit] [WARNING] - All test reports are empty.
[xUnit] [INFO] - Check 'Failed Tests' threshold.
[xUnit] [INFO] - Check 'Skipped Tests' threshold.
[xUnit] [INFO] - Setting the build status to SUCCESS
[xUnit] [INFO] - Stopping recording.
The file go-test.xml contains:
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="xxx" tests="4" errors="0" failures="0" skip="0">
<testcase classname="xxx" name="Test_DefaultConfig" time="0.00">
</testcase>
<testcase classname="xxx" name="Test_NewLoggerError" time="0.00">
</testcase>
<testcase classname="xxx" name="Test_Alert" time="0.00">
</testcase>
<testcase classname="xxx" name="Test_Post" time="0.00">
</testcase>
</testsuite>
<testsuite name="yyy" tests="1" errors="0" failures="0" skip="0">
<testcase classname="yyy" name="Test_HelloWorld" time="0.00">
</testcase>
</testsuite>
</testsuites>
which implies 5 tests were run, as expected.
Looking for the source of that error leads me to [2]. I'm not familiar with Jenkins source code but I wonder if the junitFilePattern argument to getTestResult, "**/TEST-*.xml", is related? Does my output file have to be named to match this pattern?
Thanks,
brian