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

feat: skip support at step level #592

Merged
merged 4 commits into from
Oct 18, 2022
Merged

feat: skip support at step level #592

merged 4 commits into from
Oct 18, 2022

Conversation

lowlighter
Copy link
Member

Closes #486

Make it possible to skip at step level (currently it's only possible to do so at case level)
If all steps from a case are skipped, then the case will also change its state to "SKIP" rather than "PASS"

Default output:
image

Verbose output:
image

Additionally this slightly changes the output of skipped test case when verbose mode is enabled to display that "all steps were skipped" rather than nothing, which could be misleading as a user may think that something is wrong with their test case definition

Current output

image

Signed-off-by: GitHub <noreply@github.com>
@@ -302,24 +302,31 @@ func (v *Venom) runTestSteps(ctx context.Context, tc *TestCase, tsIn *TestStepRe
printStepName := v.Verbose >= 1 && !fromUserExecutor
v.setTestStepName(tsResult, e, step, &ranged, &rangedData, rangedIndex, printStepName)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff below looks complicated but it actually just move all the code related to v.RunTestStep to the else block of the if skip conditional

for _, testStepResult := range tc.TestStepResults {
if testStepResult.RangedEnable {
hasRanged = true
}
if testStepResult.Status == StatusFail {
hasFailure = true
}
if testStepResult.Status == StatusSkip {
skippedSteps++
}
}

if verboseReport || hasRanged {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's because of my environment, but the newline seems to be printed too late when I run venom in verbose mode:
image

In my tests I moved this block to line 114 (just before v.runTestCase(ctx, ts, tc)) and it seems to yield the correct output.

Since the output from #583 (comment) looked correct, I didn't touched it, but just wanted to make a note about it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, fixed.

@lowlighter lowlighter marked this pull request as ready for review October 17, 2022 17:52
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
@sonarcloud
Copy link

sonarcloud bot commented Oct 17, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

86.8% 86.8% Coverage
0.0% 0.0% Duplication

Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
for _, testStepResult := range tc.TestStepResults {
if testStepResult.RangedEnable {
hasRanged = true
}
if testStepResult.Status == StatusFail {
hasFailure = true
}
if testStepResult.Status == StatusSkip {
skippedSteps++
}
}

if verboseReport || hasRanged {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, fixed.

@yesnault yesnault merged commit 6259c5d into master Oct 18, 2022
@fsamin fsamin deleted the feat-step-skip branch September 29, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat request: skip at step level
3 participants