From 070b1f0129adaa80ebe06f84699ee01ae38d778f Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 6 Feb 2024 15:26:00 +0100 Subject: [PATCH 1/7] Notify Runner with concept start and end Signed-off-by: Piotr Nestorow --- execution/scenarioExecutor.go | 2 ++ go.mod | 4 +++- go.sum | 2 -- runner/grpcRunner.go | 6 ++++++ version/version.go | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/execution/scenarioExecutor.go b/execution/scenarioExecutor.go index dd439e7b7..0b87bc819 100644 --- a/execution/scenarioExecutor.go +++ b/execution/scenarioExecutor.go @@ -145,12 +145,14 @@ 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) + e.runner.ExecuteMessageWithTimeout(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) + e.runner.ExecuteMessageWithTimeout(message) } func (e *scenarioExecutor) createStepRequest(protoStep *gauge_messages.ProtoStep) *gauge_messages.ExecuteStepRequest { diff --git a/go.mod b/go.mod index 9b99a2d4d..90e38ec39 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/getgauge/gauge -go 1.21 +go 1.21.0 require ( github.com/apoorvam/goterminal v0.0.0-20180523175556-614d345c47e5 @@ -40,3 +40,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/getgauge/gauge-proto/go/gauge_messages => ../gauge-proto/go/gauge_messages diff --git a/go.sum b/go.sum index 6be7c7a4f..fb78f4155 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,6 @@ 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-20231026143554-1599dddc7f01 h1:YS9Wlu7GKlfQcPzs1tTQ30nsjeAdJeJUqQq+j35YpVo= github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01/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/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= diff --git a/runner/grpcRunner.go b/runner/grpcRunner.go index 6e2e310fc..844118c0b 100644 --- a/runner/grpcRunner.go +++ b/runner/grpcRunner.go @@ -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 } diff --git a/version/version.go b/version/version.go index 028212ab2..35c331023 100644 --- a/version/version.go +++ b/version/version.go @@ -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 = "" From 63d4b8918a88804450749394bc940cb2c0a41b9f Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Wed, 7 Feb 2024 16:44:24 +0100 Subject: [PATCH 2/7] Add isConcept for concept step notification Signed-off-by: Piotr Nestorow --- execution/scenarioExecutor.go | 6 +++--- execution/stepExecutor.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/execution/scenarioExecutor.go b/execution/scenarioExecutor.go index 0b87bc819..bd5eaeadf 100644 --- a/execution/scenarioExecutor.go +++ b/execution/scenarioExecutor.go @@ -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) @@ -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) @@ -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) diff --git a/execution/stepExecutor.go b/execution/stepExecutor.go index bd9d7b6fc..66d3c00f1 100644 --- a/execution/stepExecutor.go +++ b/execution/stepExecutor.go @@ -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] From 0134d27cacf953a060daf50f678c38cf5ccd6e7d Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 13 Feb 2024 13:17:44 +0100 Subject: [PATCH 3/7] Gauge update after gauge-proto update Signed-off-by: Piotr Nestorow --- go.mod | 10 ++++------ go.sum | 14 ++++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 90e38ec39..db0366e7b 100644 --- a/go.mod +++ b/go.mod @@ -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-20231026143554-1599dddc7f01 - github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240122132601-bb92eb77d703 + github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213105730-e93bf609d1e5 github.com/golang/protobuf v1.5.3 github.com/magiconair/properties v1.8.7 github.com/natefinch/lumberjack v2.0.0+incompatible @@ -18,7 +18,7 @@ require ( github.com/sourcegraph/jsonrpc2 v0.2.0 github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 - google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac + google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 google.golang.org/grpc v1.61.0 google.golang.org/protobuf v1.32.0 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c @@ -33,12 +33,10 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/getgauge/gauge-proto/go/gauge_messages => ../gauge-proto/go/gauge_messages diff --git a/go.sum b/go.sum index fb78f4155..c8fac6899 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,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-20231026143554-1599dddc7f01 h1:YS9Wlu7GKlfQcPzs1tTQ30nsjeAdJeJUqQq+j35YpVo= github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01/go.mod h1:p/Q0+qO2bLq08PuxaHrxIgkvKlGGYHyXad33+zKIiXU= +github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213105730-e93bf609d1e5 h1:bn9VZB/7pIdhOL2J0UqurHY1kHGRO7H+9b1AgYyARtg= +github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213105730-e93bf609d1e5/go.mod h1:zfjq+Lj8ymoh0pigSGdBmGhs5+19hoNcR1CDj/ocPts= 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= @@ -60,16 +62,16 @@ github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= From 47ff86b8197d647c06d07852979e5002b26416b4 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 13 Feb 2024 14:58:18 +0100 Subject: [PATCH 4/7] Go 1.21 update Signed-off-by: Piotr Nestorow --- go.mod | 4 ++-- go.sum | 4 ++-- logger/_testdata/logs/gauge.log | 0 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 logger/_testdata/logs/gauge.log diff --git a/go.mod b/go.mod index 78ae4e575..ccaa9e41a 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/getgauge/gauge -go 1.21.0 +go 1.21 require ( github.com/apoorvam/goterminal v0.0.0-20180523175556-614d345c47e5 github.com/daviddengcn/go-colortext v1.0.0 github.com/fsnotify/fsnotify v1.7.0 github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01 - github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213105730-e93bf609d1e5 + github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213132655-d676f0e170fb github.com/golang/protobuf v1.5.3 github.com/magiconair/properties v1.8.7 github.com/natefinch/lumberjack v2.0.0+incompatible diff --git a/go.sum b/go.sum index f3e0fd232..2f237a443 100644 --- a/go.sum +++ b/go.sum @@ -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-20231026143554-1599dddc7f01 h1:YS9Wlu7GKlfQcPzs1tTQ30nsjeAdJeJUqQq+j35YpVo= github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01/go.mod h1:p/Q0+qO2bLq08PuxaHrxIgkvKlGGYHyXad33+zKIiXU= -github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213105730-e93bf609d1e5 h1:bn9VZB/7pIdhOL2J0UqurHY1kHGRO7H+9b1AgYyARtg= -github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213105730-e93bf609d1e5/go.mod h1:zfjq+Lj8ymoh0pigSGdBmGhs5+19hoNcR1CDj/ocPts= +github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213132655-d676f0e170fb h1:cj1aQODxopfVOLwNl/YxWecp0hUHVFvF4j5q4tIm5XE= +github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213132655-d676f0e170fb/go.mod h1:B2BNUpaYWBn2UQIXm1vbFGm1dYPayIqWCwNZduA0Hcg= 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= diff --git a/logger/_testdata/logs/gauge.log b/logger/_testdata/logs/gauge.log new file mode 100644 index 000000000..e69de29bb From af225694455eec5abae5688fa5d26fefb37e5581 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Wed, 14 Feb 2024 10:31:57 +0100 Subject: [PATCH 5/7] Use ExecuteAndGetStatus to deliver Concept Start and End notification Signed-off-by: Piotr Nestorow --- execution/scenarioExecutor.go | 4 ++-- runner/grpcRunner.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/execution/scenarioExecutor.go b/execution/scenarioExecutor.go index bd5eaeadf..ee494bd43 100644 --- a/execution/scenarioExecutor.go +++ b/execution/scenarioExecutor.go @@ -145,14 +145,14 @@ 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) - e.runner.ExecuteMessageWithTimeout(message) + _ = 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) - e.runner.ExecuteMessageWithTimeout(message) + _ = e.runner.ExecuteAndGetStatus(message) } func (e *scenarioExecutor) createStepRequest(protoStep *gauge_messages.ProtoStep) *gauge_messages.ExecuteStepRequest { diff --git a/runner/grpcRunner.go b/runner/grpcRunner.go index 844118c0b..281d44e3e 100644 --- a/runner/grpcRunner.go +++ b/runner/grpcRunner.go @@ -227,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 From 88a268e2a751a9e72d80f32ec883608685f0ef30 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Thu, 15 Feb 2024 09:06:02 +0100 Subject: [PATCH 6/7] Send Concept start and end if runner supports these Signed-off-by: Piotr Nestorow --- execution/scenarioExecutor.go | 14 +++++++++----- execution/stepExecutor.go | 2 +- go.mod | 6 +++--- go.sum | 12 ++++++------ runner/runner.go | 1 + 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/execution/scenarioExecutor.go b/execution/scenarioExecutor.go index ee494bd43..9ae5d72d9 100644 --- a/execution/scenarioExecutor.go +++ b/execution/scenarioExecutor.go @@ -145,14 +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) - _ = e.runner.ExecuteAndGetStatus(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) - _ = e.runner.ExecuteAndGetStatus(message) + if (e.runner.Info().ConceptMessages) { + _ = e.runner.ExecuteAndGetStatus(message) + } } func (e *scenarioExecutor) createStepRequest(protoStep *gauge_messages.ProtoStep) *gauge_messages.ExecuteStepRequest { @@ -201,7 +205,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, IsConcept: true} + e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false} event.Notify(event.NewExecutionEvent(event.ConceptStart, item, nil, e.stream, e.currentExecutionInfo)) e.notifyBeforeConcept(scenarioResult) @@ -218,7 +222,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, IsConcept: true} + e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false} defer event.Notify(event.NewExecutionEvent(event.ConceptEnd, nil, cptResult, e.stream, e.currentExecutionInfo)) defer e.notifyAfterConcept(scenarioResult) @@ -229,7 +233,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, IsConcept: true} + e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false} defer event.Notify(event.NewExecutionEvent(event.ConceptEnd, nil, cptResult, e.stream, e.currentExecutionInfo)) defer e.notifyAfterConcept(scenarioResult) diff --git a/execution/stepExecutor.go b/execution/stepExecutor.go index 66d3c00f1..bd9d7b6fc 100644 --- a/execution/stepExecutor.go +++ b/execution/stepExecutor.go @@ -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, IsConcept: false} + e.currentExecutionInfo.CurrentStep = &gauge_messages.StepInfo{Step: stepRequest, IsFailed: false} stepResult := result.NewStepResult(protoStep) for i := range step.GetFragments() { stepFragmet := step.GetFragments()[i] diff --git a/go.mod b/go.mod index ccaa9e41a..40a5dd3ee 100644 --- a/go.mod +++ b/go.mod @@ -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-20231026143554-1599dddc7f01 - github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213132655-d676f0e170fb + 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 @@ -18,8 +18,8 @@ require ( github.com/sourcegraph/jsonrpc2 v0.2.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.61.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 + google.golang.org/grpc v1.61.1 google.golang.org/protobuf v1.32.0 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c ) diff --git a/go.sum b/go.sum index 2f237a443..ab893d9fe 100644 --- a/go.sum +++ b/go.sum @@ -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-20231026143554-1599dddc7f01 h1:YS9Wlu7GKlfQcPzs1tTQ30nsjeAdJeJUqQq+j35YpVo= github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01/go.mod h1:p/Q0+qO2bLq08PuxaHrxIgkvKlGGYHyXad33+zKIiXU= -github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213132655-d676f0e170fb h1:cj1aQODxopfVOLwNl/YxWecp0hUHVFvF4j5q4tIm5XE= -github.com/getgauge/gauge-proto/go/gauge_messages v0.0.0-20240213132655-d676f0e170fb/go.mod h1:B2BNUpaYWBn2UQIXm1vbFGm1dYPayIqWCwNZduA0Hcg= +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= @@ -69,10 +69,10 @@ golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 h1:hZB7eLIaYlW9qXRfCq/qDaPdbeY3757uARz5Vvfv+cY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= diff --git a/runner/runner.go b/runner/runner.go index b994ac5f5..81ed6e973 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -58,6 +58,7 @@ type RunnerInfo struct { GaugeVersionSupport version.VersionSupport LspLangId string GRPCSupport bool + ConceptMessages bool Killed bool } From 9a75c1f7efef21e6c409198f64e1a864634a5c00 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Thu, 15 Feb 2024 12:37:42 +0100 Subject: [PATCH 7/7] github.com/getgauge/common version update Signed-off-by: Piotr Nestorow --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5f4a211a8..050b9cd81 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/apoorvam/goterminal v0.0.0-20180523175556-614d345c47e5 github.com/daviddengcn/go-colortext v1.0.0 github.com/fsnotify/fsnotify v1.7.0 - github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01 + github.com/getgauge/common v0.0.0-20231211152919-94c93e29f0b9 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 diff --git a/go.sum b/go.sum index 44d9356b5..ef447266a 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,8 @@ github.com/dmotylev/goproperties v0.0.0-20140630191356-7cbffbaada47 h1:sP2APvSdZ github.com/dmotylev/goproperties v0.0.0-20140630191356-7cbffbaada47/go.mod h1:f2V6964+f0p8Asqy8mIK5cKyyVc6MP9PFzGVNRcnYJQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01 h1:YS9Wlu7GKlfQcPzs1tTQ30nsjeAdJeJUqQq+j35YpVo= -github.com/getgauge/common v0.0.0-20231026143554-1599dddc7f01/go.mod h1:p/Q0+qO2bLq08PuxaHrxIgkvKlGGYHyXad33+zKIiXU= +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-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=