Skip to content

Commit

Permalink
Concept start end notify runner (#2483)
Browse files Browse the repository at this point in the history
* Notify Runner with concept start and end

Signed-off-by: Piotr Nestorow <[email protected]>

* Add isConcept for concept step notification

Signed-off-by: Piotr Nestorow <[email protected]>

* Gauge update after gauge-proto update

Signed-off-by: Piotr Nestorow <[email protected]>

* Go 1.21 update

Signed-off-by: Piotr Nestorow <[email protected]>

* Use ExecuteAndGetStatus to deliver Concept Start and End notification

Signed-off-by: Piotr Nestorow <[email protected]>

* Send Concept start and end if runner supports these

Signed-off-by: Piotr Nestorow <[email protected]>

* github.com/getgauge/common version update

Signed-off-by: Piotr Nestorow <[email protected]>

---------

Signed-off-by: Piotr Nestorow <[email protected]>
  • Loading branch information
PiotrNestor committed Feb 19, 2024
1 parent dc110ac commit e1b8dd9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions execution/scenarioExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,18 @@ func (e *scenarioExecutor) notifyBeforeConcept(conceptResult *result.ScenarioRes
message := &gauge_messages.Message{MessageType: gauge_messages.Message_ConceptExecutionStarting,
ConceptExecutionStartingRequest: &gauge_messages.ConceptExecutionStartingRequest{CurrentExecutionInfo: e.currentExecutionInfo, Stream: int32(e.stream)}}
e.pluginHandler.NotifyPlugins(message)
if (e.runner.Info().ConceptMessages) {
_ = e.runner.ExecuteAndGetStatus(message)
}
}

func (e *scenarioExecutor) notifyAfterConcept(conceptResult *result.ScenarioResult) {
message := &gauge_messages.Message{MessageType: gauge_messages.Message_ConceptExecutionEnding,
ConceptExecutionEndingRequest: &gauge_messages.ConceptExecutionEndingRequest{CurrentExecutionInfo: e.currentExecutionInfo, Stream: int32(e.stream)}}
e.pluginHandler.NotifyPlugins(message)
if (e.runner.Info().ConceptMessages) {
_ = e.runner.ExecuteAndGetStatus(message)
}
}

func (e *scenarioExecutor) createStepRequest(protoStep *gauge_messages.ProtoStep) *gauge_messages.ExecuteStepRequest {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/daviddengcn/go-colortext v1.0.0
github.com/fsnotify/fsnotify v1.7.0
github.com/getgauge/common v0.0.0-20231211152919-94c93e29f0b9
github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240122132601-bb92eb77d703
github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240215051240-9e50dbd68dfa
github.com/golang/protobuf v1.5.3
github.com/magiconair/properties v1.8.7
github.com/natefinch/lumberjack v2.0.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/getgauge/common v0.0.0-20231211152919-94c93e29f0b9 h1:OwggKdL8AeteB2y0xJzloieq9CMhYG7YmKKMh6D8FLs=
github.com/getgauge/common v0.0.0-20231211152919-94c93e29f0b9/go.mod h1:p/Q0+qO2bLq08PuxaHrxIgkvKlGGYHyXad33+zKIiXU=
github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240122132601-bb92eb77d703 h1:ZFK55KGnHAFpwk4YbQsp8r1ybf76MQcEVba5V21qB7w=
github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240122132601-bb92eb77d703/go.mod h1:grwwUhEUaDZHOj11RDIk5w7tciDv3fYDXeyYoL2BgGc=
github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240215051240-9e50dbd68dfa h1:yUuCvJmCxXlC4nhEtGjVDjgYTuB6t7lqN9aX/9FlQkc=
github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240215051240-9e50dbd68dfa/go.mod h1:qf8Dv2iFBwlgpBZBOKjW9JDaYi5lHqXNYXEHTXd62Uw=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
Expand Down
Empty file added logger/_testdata/logs/gauge.log
Empty file.
8 changes: 7 additions & 1 deletion runner/grpcRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ func (r *GrpcRunner) invokeServiceFor(message *gm.Message) (*gm.Message, error)
case gm.Message_KillProcessRequest:
_, _ = r.RunnerClient.Kill(context.Background(), message.KillProcessRequest)
return nil, nil
case gm.Message_ConceptExecutionStarting:
_, err := r.RunnerClient.NotifyConceptExecutionStarting(context.Background(), message.ConceptExecutionStartingRequest)
return nil, err
case gm.Message_ConceptExecutionEnding:
_, err := r.RunnerClient.NotifyConceptExecutionEnding(context.Background(), message.ConceptExecutionEndingRequest)
return nil, err
default:
return nil, nil
}
Expand Down Expand Up @@ -221,7 +227,7 @@ func (r *GrpcRunner) ExecuteAndGetStatus(m *gm.Message) *gm.ProtoExecutionResult
}
return &gauge_messages.ProtoExecutionResult{Failed: true, ErrorMessage: err.Error()}
}
return res.ExecutionStatusResponse.ExecutionResult
if res != nil { return res.ExecutionStatusResponse.ExecutionResult } else { return nil }
}

// Alive check if the runner process is still alive
Expand Down
1 change: 1 addition & 0 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type RunnerInfo struct {
GaugeVersionSupport version.VersionSupport
LspLangId string
GRPCSupport bool
ConceptMessages bool
Killed bool
}

Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

// CurrentGaugeVersion represents the current version of Gauge
var CurrentGaugeVersion = &Version{1, 6, 1}
var CurrentGaugeVersion = &Version{1, 6, 2}

// BuildMetadata represents build information of current release (e.g, nightly build information)
var BuildMetadata = ""
Expand Down

0 comments on commit e1b8dd9

Please sign in to comment.