xUnit - "All test reports are empty."

689 views
Skip to first unread message

Brian Fallik

unread,
Jan 14, 2014, 10:29:16 PM1/14/14
to jenkin...@googlegroups.com
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

m8mble

unread,
Apr 8, 2014, 10:05:05 AM4/8/14
to jenkin...@googlegroups.com
Hi,

I'm having the exact same issue with a different setup. It's very easy to
reproduce, so I'll post it here:

I'm using cxxtest 4.3 [1]. I'm compiling the examples provided in the sample
folder with the '--xunit-printer' option. This creates an XML with the test
results besides meaningful console output. The XML output for me is
TEST-xunit.xml
<http://jenkins-ci.361315.n4.nabble.com/file/n4697877/TEST-xunit.xml> .

Running xUnit on this XML produces:
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing CppTest-7.3 (default)
[xUnit] [INFO] - [CppTest-7.3 (default)] - 1 test report file(s) were found
with the pattern '**/*.xml' relative to
'/var/lib/jenkins/workspace/CxxUnitTest' for the testing framework
'CppTest-7.3 (default)'.
[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 FAILURE
[xUnit] [INFO] - Stopping recording.

Is there hope for a quick fix?


1: http://cxxtest.com/



--
View this message in context: http://jenkins-ci.361315.n4.nabble.com/xUnit-All-test-reports-are-empty-tp4687575p4697877.html
Sent from the Jenkins dev mailing list archive at Nabble.com.
Reply all
Reply to author
Forward
0 new messages