Cucumber in combination with jUnit-reporting tries to create files with special characters "|"

Hi,

I have exactly the same problem on latest gradle 2.10 that is described in the old forum concerning Cucumber in combination with the Gradle jUnit reporting.

From the stack trace I clearly see that gradle is trying to create a file with “|” on windows and that is of course failing:

Caused by: org.gradle.api.UncheckedIOException: Could not write to file '<project>\build\reports\tests\packages\| NOT_RELEVANT | EMPTY | NOT_RELEVANT | NOT_RELEVANT
| NOT_RELEVANT | ~ | NOT_RELEVANT | error | java.lang.html'.
        at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:115)
        at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:91)

For now I had to disable the JUnit XML file generation on windows:

if (System.getProperty('os.name').toLowerCase().contains('windows')) {
    test.reports.html.enabled = false
}

Best regards

Can you provide a reproducible example?

Sure. But it will probably take me a while, sorry.

Hi,

sorry for the delay. Ok here is more info, the problem is actually cause by combination of special characters:

For example when you have in you .feature file something like this:

Examples:
      | Employee | Increase | Salary | Something    | Something more |
      | 3        | 5        | 57750  | <NULL>       | my.test        |

The combination of “<>” and dot in “my.test” is causing issues.

Reproducable example:

git clone https://github.com/vehovmar/gradle-cucumber-bug-example.git 
gradlew.bat build --stacktrace

Tested on Windows 7 and 10.