Skip to content

Commit

Permalink
Add isConcept for concept step notification
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Nestorow <[email protected]>
  • Loading branch information
PiotrNestor committed Feb 7, 2024
1 parent 070b1f0 commit 63d4b89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions execution/scenarioExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (e *scenarioExecutor) executeConcept(item *gauge.Step, protoConcept *gauge_

// Add the Concept step data to the Execution info that is sent to plugins
stepRequest := e.createStepRequest(protoConcept.ConceptStep)
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false}
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false, IsConcept: true}
event.Notify(event.NewExecutionEvent(event.ConceptStart, item, nil, e.stream, e.currentExecutionInfo))
e.notifyBeforeConcept(scenarioResult)

Expand All @@ -218,7 +218,7 @@ func (e *scenarioExecutor) executeConcept(item *gauge.Step, protoConcept *gauge_
}
// The concept is finishing after a step failure
// Restore the Concept step data in the Execution info that is sent to plugins
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false}
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false, IsConcept: true}
defer event.Notify(event.NewExecutionEvent(event.ConceptEnd, nil, cptResult, e.stream, e.currentExecutionInfo))
defer e.notifyAfterConcept(scenarioResult)

Expand All @@ -229,7 +229,7 @@ func (e *scenarioExecutor) executeConcept(item *gauge.Step, protoConcept *gauge_
cptResult.UpdateConceptExecResult()

// Restore the Concept step to the Execution info that is sent to plugins
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false}
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false, IsConcept: true}
defer event.Notify(event.NewExecutionEvent(event.ConceptEnd, nil, cptResult, e.stream, e.currentExecutionInfo))
defer e.notifyAfterConcept(scenarioResult)

Expand Down
2 changes: 1 addition & 1 deletion execution/stepExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type stepExecutor struct {
// TODO: stepExecutor should not consume both gauge.Step and gauge_messages.ProtoStep. The usage of ProtoStep should be eliminated.
func (e *stepExecutor) executeStep(step *gauge.Step, protoStep *gauge_messages.ProtoStep) *result.StepResult {
stepRequest := e.createStepRequest(protoStep)
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false}
e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false, IsConcept: false}
stepResult := result.NewStepResult(protoStep)
for i := range step.GetFragments() {
stepFragmet := step.GetFragments()[i]
Expand Down

0 comments on commit 63d4b89

Please sign in to comment.