Cucumber test report file formation is failing in Gradle 1.5

(Mark Petrovic) #1

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.


(Luke Daley) #2

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.

(Mark Petrovic) #3

Thanks, Luke.

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

(Luke Daley) #4

Confirmed, raised as GRADLE-2739.

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

(Mark Petrovic) #5

Sure, here you go:

(Mark Petrovic) #6

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.

(Marco Vermeulen) #7

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

(Mark Petrovic) #8

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

(enrico.comiti) #9

I confirm it is fixed in the last nigthly using:

test {

reports.html.enabled = false

reports.junitXml.enabled = false


(Marco Vermeulen) #10

It seems like my issue is more closely related to

(Marco Vermeulen) #11

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

(Mark Petrovic) #12

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

(Luke Daley) #13

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

(Luke Daley) #14

This week.

(Quentin Suire) #15

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