Cucumber test report file formation is failing in Gradle 1.5

Good day.

I’m attempting to migrate from Gradle 1.3 to Gradle 1.5, and am performing some smoketesting of a CucumberJVM test suite. The Cuke tests appear to boot and run fine. But when it comes time to write the test report file, the process fails with messages like this:

Problems writing to file: /Users/petrovic/Projects/xoom/qa/prod/cucumber-jvm-test/build/test-results/binary/intTest/Scenario: FX cache clearing for /fx endpoint.stdout

where in the Scenario file we have

Scenario: FX cache clearing for /fx endpoint

Anyone have an idea of how I can fix this? I wanted to migrate from 1.3 to 1.4 when 1.4 came out, but the Cuke tests failed to even start. Hence my wait for 1.5.


Any chance you could supply a sample project?

Seems like a simple escaping issue. Having a sample project will help us verify the fix quicker.

Thanks, Luke.

This project reproduces the effect when you use the wrapper (ignore the 14 in the repo name):

Confirmed, raised as GRADLE-2739.

@Mark: would you mind branching that repo at that point so we can use that as a reference?

Sure, here you go:

If I had a hint on where to look for the lines of code to fix, I can take a look at this in the next couple days.


I found where the exception is thrown, but as I refresh my memory on the failure mode, I note that the root cause of the problem is an NPE:

aused by: org.gradle.api.GradleException: Could not write XML test results for Scenario: Say goodbye

to file /Users/petrovic/Projects/cucumberjvm-gradle14/build/test-results/TEST-Scenario: Say goodbye


at org.gradle.api.internal.tasks.testing.junit.result.Binary2JUnitXmlReportGenerator$1.execute(

at org.gradle.api.internal.tasks.testing.junit.result.Binary2JUnitXmlReportGenerator$1.execute(

at org.gradle.api.internal.tasks.testing.junit.result.TestReportDataCollector.visitClasses(

at org.gradle.api.internal.tasks.testing.junit.result.Binary2JUnitXmlReportGenerator.generate(

at org.gradle.api.tasks.testing.Test.executeTests(

at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(

at org.gradle.api.internal.BeanDynamicObject.invokeMethod(

at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(

at org.gradle.api.tasks.testing.Test_Decorated.invokeMethod(Unknown Source)

at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(

at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(

at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(

… 80 more Caused by: java.lang.NullPointerException

at org.gradle.api.internal.xml.SimpleMarkupWriter.writeXmlAttributeEncoded(

at org.gradle.api.internal.xml.SimpleMarkupWriter.attribute(

at org.gradle.api.internal.tasks.testing.junit.result.JUnitXmlResultWriter.writeTests(

at org.gradle.api.internal.tasks.testing.junit.result.JUnitXmlResultWriter.write(

at org.gradle.api.internal.tasks.testing.junit.result.Binary2JUnitXmlReportGenerator$1.execute(

… 96 more

and not a filename-escaping issue.

I’m seeing the same issue when building gvm, so currently stuck on 1.3 too.

In v1.7, I believe you’ll be able to disable this reporting so the Cucumber test suite will run to completion.

I confirm it is fixed in the last nigthly using:

test {

reports.html.enabled = false

reports.junitXml.enabled = false


It seems like my issue is more closely related to

Any ideas when Gradle 1.7 rc releases will be made available?

The DSL docs for latest-nightly say test.reports is read-only. I must be misinterpreting the doc. Hmm.

The reports property is read only, but the reports object is mutable.

This week.

Maybe it would be helpful to add it to the 1.7 doc about test reporting?