-
Notifications
You must be signed in to change notification settings - Fork 69
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
Test failure cannot be detected #84
Comments
I don't have time to look into this but I'd be happy to receive an experimental pull request that solves your problem then discuss the appropriate API changes to make it generally useful. 🙂 |
So my understanding of your requirements based on your example PR is to be able to programmatically determine the outcome of a test run. Entirely reasonable. Would it not make more sense for us to return an object similar to https://doc.rust-lang.org/std/process/struct.Output.html? A standard "Output" object could contain total tests run, total errors, etc, with a basic We could add a |
Returning some kind of I would be wary of using So one function that returns an |
To clarify, I proposed changing the return type of |
That's perfect! :D |
This is in |
I want to run my cucumber tests and fail the whole execution if a step fails.
Right now, there does not seem to be the case; Looking at
Cucumber::run()
the steps are simply executed in awhile
loop:https://github.com/bbqsrc/cucumber-rust/blob/7140ba0d7314cd8863d7c290e8e31c2a/src/cucumber.rs#L145-L158
In my code base I isolate my call to
Cucumber::run()
in a separate crate (where all my steps/tests are defined) and re-use them in either a CLI or a webapp. This allows me to run some integration tests either locally or side-by-side with the system being tested (required due to auth issues).Right now, I realize that I have no way of detecting if a test failed or not without looking at stdout/err, which makes running in service not as useful as it should be.
Searching the code base I found commits relating to exit code, for example 6bee788. This one uses
std::process:exit(1)
which is not what I need, but it seems the intent was to propagate the error to the caller.I think the simplest would be to let
Cucumber::run()
return aResult<>
instead of nothing? That way one can unwrap/assert/check/... the actual result of the test.The text was updated successfully, but these errors were encountered: