Hi,
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
1 - https://bitbucket.org/tebeka/go2xunit
2-
https://github.com/jenkinsci/xunit-plugin/blob/a4790967f8928d368b819b35b6577d474c660066/src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java#L257
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.