-
Notifications
You must be signed in to change notification settings - Fork 115
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
Skip tests for specific context if precondition functions failed #242
Comments
I can add a configuration flag to enable that I believe. Let me rephrase so that I make sure I understand what you want. If at any point during running tests for a context, if the Sound right? |
Yes, that's exactly what we need. This will reduce time spent on failure investigation, since in most cases test failures are caused by incomplete execution of "before" and "once". "Configuration flag" sounds great. Please let me know when to expect this feature. Thanks in advance! |
Looking at the code a failure in There is also a configuration flag called failFast which if you set it it to true it will stop running tests after any test fails (including the before). It will stop running all tests though, and not just tests for a specific context. In its current state, the runner is a total mess and I need to refactor it. I will take the time to do that today hopefully and get your feature in too. It may take longer than I want and spill over a few days though. |
You can download this now! https://www.nuget.org/packages/canopy/0.9.46 Set this configuration to true
Then any failure in once or before will skip the rest of the tests for that context. |
Im trying to add this feature to my tests, if the test fails in once block skip the rest of the tests, I am having a hard time changing the value of skipRemainingTestsInContextOnFailure to true. Pls let me know if any changes are needed to the following code. let all _ = if (currentTitle <> expectedTitle) then // added failwith and tried |
Its not compiling or its not working? If its not working it must be because your currentTitle does equal your expected title. |
It is compiling but not working. No , current title is google and expected is my application. I put a breakpoint at let currentTitle = title () and navigate to google.com manually to pass the condition When the condition is true ,I see the cursor at |
Ok I think I understand. This flag is just a configuration setting, so if a test fails, it will skip any remaining tests in the current context. You need to set it to true, then if a test fails it will work. If there is a failure in the https://github.com/lefthandedgoat/canopy/blob/master/src/canopy/runner.fs#L205-L208 If you want your
|
ok will try that. |
Got the exception "equality check failed" stepped into and executed line no .111 in runner.fs and the following lines were not executed my code is let all _ = let currentTitle = title() |
Its generally best to not run your tests in Visual Studio because the debugger will attach to any exceptions it thinks are un-handeled. Try running the exe from console and it should work. |
My test environment was down today , Jenkins job executed exe , and it didnt work still , all the tests i have were executed and reported failure. |
I need to see your full test to help. |
Pls let me know if I can reach you out via email. |
lefthandedgoat gmail On Tue, Aug 9, 2016 at 3:37 PM, danuma [email protected] wrote:
|
Hi,
Is there any way to not execute tests in context if functions "once", "before" has failed for some reason?
The text was updated successfully, but these errors were encountered: