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

Undefined steps does not fail a test #16

Open
jacek99 opened this issue Dec 1, 2010 · 6 comments
Open

Undefined steps does not fail a test #16

jacek99 opened this issue Dec 1, 2010 · 6 comments
Labels
Milestone

Comments

@jacek99
Copy link

jacek99 commented Dec 1, 2010

When I created a scenario and had no steps, it gave me the UNDEFINED error in the output...but all the tests were flagged as passed and nose displayed OK at the end.

Also a 0 return code was returned from the process instead of 1 (or some error code) to indicate failure.

This means it's hard for automated builds to know if the tests actually failed or not, since a test that was not run due to undefined steps does not fail the test run.

if that is the default behavior, freshen should offer an option to override it.

@rlisagor
Copy link
Owner

rlisagor commented Jun 4, 2011

Agreed, an option to make it fail if there are undefined steps could be useful. Cucumber allows this with the --strict flag. Adding to the 1.0 milestone.

@dannystaple
Copy link

One hack to use this in CI/build system would be to pipe the output (or tee the output) to a file, then this:

grep UNDEFINED nose.log && (echo "ERROR: Undefined found"; exit 1)

@dexterous
Copy link
Contributor

Or simply grep UNDEFINED nose.log; [ $? -ne 0 ]

@jacek99
Copy link
Author

jacek99 commented Jan 5, 2012

That is exactly what we had to do. I wrote a Maven plugin to trigger Freshen runs for our Java apps and we had to add custom logic like that:
https://github.com/jacek99/maven-python-mojos/blob/master/maven-python-mojos/maven-bdd-plugin/src/main/java/com/github/mojo/bdd/NoseMojo.java

@dannystaple
Copy link

Ah yes- this would work fine with a Jenkins job or in a build/deploy
script. With bash, you could probably simplify it to:

grep UNDEFINED nose.log && exit 1

On 5 January 2012 14:55, Jacek Furmankiewicz
[email protected]
wrote:

That is exactly what we had to do. I wrote a Maven plugin to trigger Freshen runs for our Java apps and we had to add custom logic like that:
https://github.com/jacek99/maven-python-mojos/blob/master/maven-python-mojos/maven-bdd-plugin/src/main/java/com/github/mojo/bdd/NoseMojo.java


Reply to this email directly or view it on GitHub:
#16 (comment)

Danny Staple

Director, ODM Solutions Ltd
w: http://www.odmsolutions.co.uk
Blog: http://orionrobots.co.uk/blog1-Danny-Staple

@abeld
Copy link

abeld commented Jan 24, 2012

See abeld@3bca046 for an implementation of the "add an option to turn undefined steps into failures" feature. (The branch is https://github.com/abeld/freshen/tree/undefined-steps-are-errors--option)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants