Skip to content

Commit

Permalink
Handle message when skip scenario
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com>
  • Loading branch information
PiotrNestor committed Mar 26, 2024
1 parent bb445df commit b641549
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions execution/scenarioExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ func (e *scenarioExecutor) execute(i gauge.Item, r result.Result) {
}

if scenarioResult.GetSkippedScenario() {
if len(scenarioResult.ProtoScenario.PreHookMessages) > 0 {
e.errMap.ScenarioErrs[scenario] = append([]error{errors.New(scenarioResult.ProtoScenario.PreHookMessages[0])}, e.errMap.ScenarioErrs[scenario]...)
} else {
e.errMap.ScenarioErrs[scenario] = append([]error{errors.New(e.currentExecutionInfo.CurrentStep.ErrorMessage)}, e.errMap.ScenarioErrs[scenario]...)
}
setSkipInfoInResult(scenarioResult, scenario, e.errMap)
}

Expand Down Expand Up @@ -131,6 +136,7 @@ func (e *scenarioExecutor) notifyBeforeScenarioHook(scenarioResult *result.Scena
}
if skippedScenario(res.GetSkipScenario()) {
scenarioResult.SetSkippedScenario()
scenarioResult.ProtoScenario.PreHookMessages = []string{res.ErrorMessage}
}
message.ScenarioExecutionStartingRequest.ScenarioResult = gauge.ConvertToProtoScenarioResult(scenarioResult)
e.pluginHandler.NotifyPlugins(message)
Expand Down

0 comments on commit b641549

Please sign in to comment.