Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cucumber tests fails when run with Gradle test task. (Gradle 1.4) #468

Closed
karaaie opened this issue Mar 1, 2013 · 7 comments
Closed

Cucumber tests fails when run with Gradle test task. (Gradle 1.4) #468

karaaie opened this issue Mar 1, 2013 · 7 comments
Labels
⌛ stale Will soon be closed by stalebot unless there is activity

Comments

@karaaie
Copy link

karaaie commented Mar 1, 2013

Hello, I'm experiencing some problems when I try to run Cucumber-jvm tests. The file RunCukesTest is annotated with @RunWith(Cucumber.class). It can be seen below.

  • What went wrong:
    Execution failed for task ':test'.

    Could not write XML test results for com.assaabloy.stg.a3p.acceptancetests.RunCukesTest to file C:\Dev\Jobb\arx_trunk\server-rt\AccteptanceTests\build\test-results\TEST-com.assaabloy.stg.a3p.acceptancetests.RunCukesTest.xml.

Also I've been able to verify that the tests run and succeed in Intellij. In my quest to solve this on my own I checked out the gradle source code and ran som debugging on my own. I managed to narrow it down to that when writing the xml-report file the last test doesn't have a name which makes the method write in the class JUnitXmlResultWriter at the row .attribute("name", methodResult.getName()) throw a null pointer.

The test suite reports 4 tests for a scenario with three steps in it:

Scenario: Blabha lba
Given: assdf
When: aslkdfj
Then: asdf

The given, when and then steps succeed and have a name, but then a fourth TestMethodResult is added which I belive is the conclusion of the scenario and that one lacks a name.

I'm not sure if this is a bug with Gradle test which can't handle test methods with null names or if this is a problem with cucumber-jvm, thus I'll post this here and also on the gradle issue tracker.

Best regards, Kamil

@karaaie
Copy link
Author

karaaie commented Mar 5, 2013

This seems to be an issue with how cucumbers junitreporter works, http://forums.gradle.org/gradle/topics/beforetest_descriptor_is_null_and_the_test_is_not_actually_run_trying_to_run_groovy_and_java_cucumber_step_definition
Is this something that will receive attention by the cucumber-jvm developers, or is my best bet to fork this project and fix it myself ?

@aslakhellesoy
Copy link
Contributor

What Cucumber-JVM version?

@karaaie
Copy link
Author

karaaie commented Mar 5, 2013

It's version 1.1.2, perhaps there is a snaphot for 1.1.3 available?

@agileknight
Copy link

This seems to solve the problem with gradle (tested on 1.5):
https://github.com/philstyler/cucumber-jvm/commits/gradle_compatibility

What do you think?

Edit: There still seem to be some issues with the test report generation. The HTML report index page lists the cucumber tests only when at least one test failed. The page for the default-package always lists the results.

Maybe the root cause is calling testStart testStart testFinish testFinish events instead of always pairing them.

@stale
Copy link

stale bot commented Oct 26, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

@stale stale bot added the ⌛ stale Will soon be closed by stalebot unless there is activity label Oct 26, 2017
@stale
Copy link

stale bot commented Nov 2, 2017

This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective

@stale stale bot closed this as completed Nov 2, 2017
@lock
Copy link

lock bot commented Nov 2, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⌛ stale Will soon be closed by stalebot unless there is activity
Projects
None yet
Development

No branches or pull requests

3 participants