-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
How to Forcefully fail a step without raising an Exception ? #392
Comments
Just to give more information, I am currently handling this on my local by changing Lines 151 to 156 in 14b8421
to else:
if self.state is Step.State.SKIPPED:
self.skip()
elif self.failure is not None:
self.state = Step.State.FAILED
elif self.state is not Step.State.PENDING:
self.state = Step.State.PASSED
return self.state |
did you checkout |
Hi @fliiiix, Yes, I am using Let me link the issue I am dealing right now for keeping things interconnected. Thanks 🎉 |
Hello, Any suggestions/hope about this ? Since I need to release 1.1.0 as soon as possible, I think I will fork |
Thinking about that, it is a bad idea. Let's not create duplicate packages in PyPI for just few lines. Will wait for your answer. |
Hello guys, It has been a while, don't want to push you really, but we are still waiting an update from you to trigger a new release. |
Sorry, I couldn't give some attention earlier ;)
I'm kinda confused about the use-case here. So I'll just provide you some options I think might help you:
That's right - the current |
Hello @timofurrer, Thanks for the attention :) Let me try to explain the situation. As you may know we use The problem here is, as To explain this better, let me give an example ; Scenario Outline: Well-known insecure protocol exposure on Public Network for ingress traffic
Given I have AWS Security Group defined
When it contains ingress
Then it must not have <proto> protocol and port <portNumber> for 0.0.0.0/0
Examples:
| ProtocolName | proto | portNumber |
| HTTP | tcp | 80 |
| Telnet | tcp | 23 |
| SSH | tcp | 22 |
Failure: tcp/22 port is defined within 0.0.0.0/0 network in module.mysg.aws_security_group.alb. So, based on this result, all looks ok, right ? There is a security group somewhere in the terraform code, that hits the checks implemented in the step and it fails. The summary of the result is ;
So we have 1 failed scenario, as expected. We have an exception class called ... but what if there a multiple security-groups failing on the same exact step ? Coming with the new E.g. ; Scenario Outline: Well-known insecure protocol exposure on Public Network for ingress traffic
Given I have AWS Security Group defined
When it contains ingress
Then it must not have <proto> protocol and port <portNumber> for 0.0.0.0/0
Examples:
| ProtocolName | proto | portNumber |
| HTTP | tcp | 80 |
| Telnet | tcp | 23 |
| SSH | tcp | 22 |
Failure: tcp/22 port is defined within 0.0.0.0/0 network in module.mysg.aws_security_group.alb.
Failure: tcp/22 port is defined within 0.0.0.0/0 network in aws_security_group.failure.
Failure: tcp/22 port is defined within 0.0.0.0/0 network in aws_security_group.another_failure.
1 features (0 passed, 1 failed)
9 scenarios (8 passed, 1 failed)
27 steps (26 passed, 1 failed) What we do here is, we mock the exception class a bit where we ;
As I changed the code in my local as I explained here above, this works without any problem for Hope I could explain the situation. Please let me know if you need any more details on any part that I couldn't explain it well. Thanks! |
I will try to override, mock, patch something for the |
@eerkunt can you provide a minimal example for that use-case where i can play around in radish? |
closed feel free to reopen if needed |
Question
Hello,
Gone through the issues but couldn't find one, also spend few hours on the code hacking and mocking some parts to do this, but still couldn't do it. Thus, let me ask the owner about how to do it :)
I would like to have an option where I would like to mark a step as Failed (but continue to run) without raising an Exception.
I tried ;
but it looks like I can't make it due to
stepmodel.py
structure in0.13.1
.radish/radish/stepmodel.py
Line 131 in 14b8421
I was going to create a PR, but found out
master
branch is quite different from what I have on my local, which is0.13.1
. Played withmaster
branch a bit, but the change is quite big that I also need to change how I invoke radish within my codehttps://github.com/eerkunt/terraform-compliance/blob/9d8ecb55e3fd6fcd15c463cb78f1c2f206918011/terraform_compliance/main.py#L71
Any plan supporting failing a step within a step without giving an Exception ?
Hope I could explain myself.
Thanks for the support 🎉
The text was updated successfully, but these errors were encountered: