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

Programmatic skip #42

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Conversation

PiotrNestor
Copy link
Contributor

Add SkipScenarioException to be used for programmatically skipping remaining scenario execution.

@gaugebot
Copy link

gaugebot bot commented Mar 27, 2024

@PiotrNestor Thank you for contributing to gauge-csharp-lib. Your pull request has been labeled as a release candidate 🎉🎉.

Merging this PR will trigger a release.

Please bump up the version as part of this PR.

Instructions to bump the version can found at CONTRIBUTING.md

If the CONTRIBUTING.md file does not exist or does not include instructions about bumping up the version, please looks previous commits in git history to see what changes need to be done.

@sriv
Copy link
Member

sriv commented Mar 27, 2024

I don't mind this design of raising an exception to skip a scenario. But I wanted to suggest that an explicit API that can be a function call may also be considered.

Ex: Gauge.SkipCurrentScenario() similar to Gauge.WriteMessage()

What do you think @PiotrNestor ?

@PiotrNestor
Copy link
Contributor Author

@sriv
We're aiming for simplicity and minimal additions.
With the exception approach there is only one exception definition in the library. In the dotnet language runner the SkipScenarioException is handled in the existing flow of scenario hook and step execution where the skip is indicated back to the gauge runner in the Execution result via the 'skipScenario' in ProtoExecutionResult. Yo can check the dotnet runner updates here: https://github.com/system-verification/gauge-dotnet/tree/programmatic-skip-scenario in HookExecutor.cs, StepExecutor.cs

What would be the execution flow with the Gauge.SkipCurrentScenario() approach? Sounds more complex to implement !?

@sriv
Copy link
Member

sriv commented Apr 2, 2024

I am going to merge this, since I don't have a huge preference here. In any case, we can always include support for a Skip scenario function when we need more context around it.

@sriv sriv merged commit 9d5ca8a into getgauge:master Apr 2, 2024
3 checks passed
@PiotrNestor PiotrNestor deleted the programmatic-skip branch June 5, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants