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

1.0.8 json report "undefined" skipped tests #328

Closed
poum opened this issue May 25, 2012 · 9 comments
Closed

1.0.8 json report "undefined" skipped tests #328

poum opened this issue May 25, 2012 · 9 comments

Comments

@poum
Copy link

poum commented May 25, 2012

Hi and many thanks for cucumber-jvm.

Trying to use jenkins-cucumber-jvm-reports-plugin-java, I've noticed that skipped test (using @ignore and PendingException) are correctly reported in xml surefire-report but as "undefined" in json file.

I'm using cucumber-jvm 1.0.8, maven 3.0.4 & java openjdk 1.6.

damianszczepanik/cucumber-reporting-jenkins#7

@poum
Copy link
Author

poum commented May 29, 2012

Hi again. I've further investigate and according to my comprehension, cucumber-jvm has the following behaviour:

  • unimplemented step => 'pending': OK
  • @ignore step => 'skipped': OK
  • step throwing PendingException => 'failed': ??

I was expecting that step throwing a PendingException would be marked as 'pending' ... Am I wrong ?

@aslakhellesoy
Copy link
Contributor

Cucumber steps can end up in one of the following native states:

  • passed (console green)
  • failed (console red)
  • pending (console yellow)
  • undefined (console yellow)
  • skipped (console cyan)

When using the JUnit runner we have to map those states onto the states that JUnit understands:

  • passed
  • failed
  • ignored

All of the states pending, undefined and skipped are mapped to the ignored state for JUnit. The JSON report uses Cucumber's native states.

Does this answer your question? If not, can you explain with some more concrete examples? (code snippets and output snippets). Please use triple backticks if you paste code. See GFM

@poum
Copy link
Author

poum commented May 31, 2012

Many thanks for this explanation. I mean: could cucumber-jvm catch PendingExceptions to avoid the step to fail and marked it as 'pending' in JSON (and 'ignored' in JUnit). To me, a pending step should not cause test fail ... but also not pass. Another way to express my question could be: what is PendingException purpose ?

@aslakhellesoy
Copy link
Contributor

I don't understand your question. When PendingException is thrown, it doesn't cause a step to fail. Cucumber catches it internally and causes the step to be marked as pending.

That is, unless you're using the --strict option, which causes PendingException to be treated as a regular error (fail).

The purpose of marking a step as pending is to give yourself a reminder to implement this step definition.

I'm going to close this issue unless you provide me with some code to describe what you mean.

@aslakhellesoy
Copy link
Contributor

Never mind my previous comment. It looks like there has been a recent regression here. I'm working on a fix.

@poum
Copy link
Author

poum commented Jun 8, 2012

Ouf ! I started thinking I forgot how throwing an exception ;-)

Many thanks for time spend on my request ...

@poum
Copy link
Author

poum commented Jun 8, 2012

Ok, it works perfectly for me. Many thanks !

@aslakhellesoy
Copy link
Contributor

Great! Thanks for the feedback and sorry about the confusion/regression.

@lock
Copy link

lock bot commented Oct 25, 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 Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants