diff --git a/gauge-proto b/gauge-proto index e46ec3d19..7013a9f8b 160000 --- a/gauge-proto +++ b/gauge-proto @@ -1 +1 @@ -Subproject commit e46ec3d1915e4d903de1bdf78c6598586d9b5865 +Subproject commit 7013a9f8bca3bc72fce095c2157a10978acd88f2 diff --git a/gauge_messages/api_v2.pb.go b/gauge_messages/api_v2.pb.go index abd467474..d032bb7d1 100644 --- a/gauge_messages/api_v2.pb.go +++ b/gauge_messages/api_v2.pb.go @@ -22,41 +22,38 @@ var _ = math.Inf type ExecutionResponse_ExecutionResponseType int32 const ( - ExecutionResponse_BeforeScenarioHookResult ExecutionResponse_ExecutionResponseType = 0 - ExecutionResponse_ScenarioResult ExecutionResponse_ExecutionResponseType = 1 - ExecutionResponse_AfterScenarioHookResult ExecutionResponse_ExecutionResponseType = 2 - ExecutionResponse_BeforeSuiteHookResult ExecutionResponse_ExecutionResponseType = 3 - ExecutionResponse_AfterSuiteHookResult ExecutionResponse_ExecutionResponseType = 4 - ExecutionResponse_BeforeSpecHookResult ExecutionResponse_ExecutionResponseType = 5 - ExecutionResponse_AfterSpecHookResult ExecutionResponse_ExecutionResponseType = 6 - ExecutionResponse_SuiteDataStoreInitResult ExecutionResponse_ExecutionResponseType = 7 - ExecutionResponse_SpecDataStoreInitResult ExecutionResponse_ExecutionResponseType = 8 - ExecutionResponse_ErrorResult ExecutionResponse_ExecutionResponseType = 9 + ExecutionResponse_SuiteDataStoreInitResult ExecutionResponse_ExecutionResponseType = 0 + ExecutionResponse_SuiteStart ExecutionResponse_ExecutionResponseType = 1 + ExecutionResponse_SpecDataStoreInitResult ExecutionResponse_ExecutionResponseType = 2 + ExecutionResponse_SpecStart ExecutionResponse_ExecutionResponseType = 3 + ExecutionResponse_ScenarioStart ExecutionResponse_ExecutionResponseType = 4 + ExecutionResponse_ScenarioEnd ExecutionResponse_ExecutionResponseType = 5 + ExecutionResponse_SpecEnd ExecutionResponse_ExecutionResponseType = 6 + ExecutionResponse_SuiteEnd ExecutionResponse_ExecutionResponseType = 7 + ExecutionResponse_ErrorResult ExecutionResponse_ExecutionResponseType = 8 ) var ExecutionResponse_ExecutionResponseType_name = map[int32]string{ - 0: "BeforeScenarioHookResult", - 1: "ScenarioResult", - 2: "AfterScenarioHookResult", - 3: "BeforeSuiteHookResult", - 4: "AfterSuiteHookResult", - 5: "BeforeSpecHookResult", - 6: "AfterSpecHookResult", - 7: "SuiteDataStoreInitResult", - 8: "SpecDataStoreInitResult", - 9: "ErrorResult", + 0: "SuiteDataStoreInitResult", + 1: "SuiteStart", + 2: "SpecDataStoreInitResult", + 3: "SpecStart", + 4: "ScenarioStart", + 5: "ScenarioEnd", + 6: "SpecEnd", + 7: "SuiteEnd", + 8: "ErrorResult", } var ExecutionResponse_ExecutionResponseType_value = map[string]int32{ - "BeforeScenarioHookResult": 0, - "ScenarioResult": 1, - "AfterScenarioHookResult": 2, - "BeforeSuiteHookResult": 3, - "AfterSuiteHookResult": 4, - "BeforeSpecHookResult": 5, - "AfterSpecHookResult": 6, - "SuiteDataStoreInitResult": 7, - "SpecDataStoreInitResult": 8, - "ErrorResult": 9, + "SuiteDataStoreInitResult": 0, + "SuiteStart": 1, + "SpecDataStoreInitResult": 2, + "SpecStart": 3, + "ScenarioStart": 4, + "ScenarioEnd": 5, + "SpecEnd": 6, + "SuiteEnd": 7, + "ErrorResult": 8, } func (x ExecutionResponse_ExecutionResponseType) Enum() *ExecutionResponse_ExecutionResponseType { @@ -177,12 +174,17 @@ type ExecutionResponse struct { // An identifier for the current execution result ID *string `protobuf:"bytes,2,opt,name=ID,json=iD" json:"ID,omitempty"` Status *ExecutionResponse_Status `protobuf:"varint,3,opt,name=status,enum=gauge.messages.ExecutionResponse_Status" json:"status,omitempty"` - // Contains the Execution error and its details - Error []*ExecutionResponse_ExecutionError `protobuf:"bytes,4,rep,name=error" json:"error,omitempty"` - ExecutionTime *int64 `protobuf:"varint,5,opt,name=executionTime" json:"executionTime,omitempty"` + // Contains the Execution errors and its details + Errors []*ExecutionResponse_ExecutionError `protobuf:"bytes,4,rep,name=errors" json:"errors,omitempty"` + // Specifies the execution time + ExecutionTime *int64 `protobuf:"varint,5,opt,name=executionTime" json:"executionTime,omitempty"` // Contains the console output messages - Stdout *string `protobuf:"bytes,6,opt,name=stdout" json:"stdout,omitempty"` - XXX_unrecognized []byte `json:"-"` + Stdout *string `protobuf:"bytes,6,opt,name=stdout" json:"stdout,omitempty"` + // Holds the pre hook failure + PreHookFailure *ExecutionResponse_ExecutionError `protobuf:"bytes,7,opt,name=preHookFailure" json:"preHookFailure,omitempty"` + // Holds the post hook failure + PostHookFailure *ExecutionResponse_ExecutionError `protobuf:"bytes,8,opt,name=postHookFailure" json:"postHookFailure,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ExecutionResponse) Reset() { *m = ExecutionResponse{} } @@ -194,7 +196,7 @@ func (m *ExecutionResponse) GetType() ExecutionResponse_ExecutionResponseType { if m != nil && m.Type != nil { return *m.Type } - return ExecutionResponse_BeforeScenarioHookResult + return ExecutionResponse_SuiteDataStoreInitResult } func (m *ExecutionResponse) GetID() string { @@ -211,9 +213,9 @@ func (m *ExecutionResponse) GetStatus() ExecutionResponse_Status { return ExecutionResponse_PASSED } -func (m *ExecutionResponse) GetError() []*ExecutionResponse_ExecutionError { +func (m *ExecutionResponse) GetErrors() []*ExecutionResponse_ExecutionError { if m != nil { - return m.Error + return m.Errors } return nil } @@ -232,7 +234,20 @@ func (m *ExecutionResponse) GetStdout() string { return "" } -// Specifies the execution time +func (m *ExecutionResponse) GetPreHookFailure() *ExecutionResponse_ExecutionError { + if m != nil { + return m.PreHookFailure + } + return nil +} + +func (m *ExecutionResponse) GetPostHookFailure() *ExecutionResponse_ExecutionError { + if m != nil { + return m.PostHookFailure + } + return nil +} + // ExecutionError represents the failure during execution along with details of failure type ExecutionResponse_ExecutionError struct { // Stacktrace from the failure @@ -385,36 +400,38 @@ var _Execution_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("api_v2.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 496 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xad, 0x9d, 0x38, 0x21, 0x93, 0x60, 0xca, 0xd0, 0x52, 0x13, 0x10, 0x2a, 0x16, 0x48, 0xb9, - 0x10, 0x45, 0xbe, 0x70, 0xe0, 0x42, 0x50, 0x52, 0x11, 0x15, 0xa4, 0xc8, 0xce, 0xbd, 0x5a, 0x99, - 0x49, 0xb0, 0x9a, 0x7a, 0x8d, 0x77, 0x5d, 0xc1, 0x97, 0x20, 0xf1, 0xa9, 0x9c, 0xd8, 0xf5, 0x3a, - 0xc8, 0x2e, 0x11, 0x11, 0xb7, 0x99, 0xf7, 0xf6, 0xbd, 0x7d, 0x9e, 0x1d, 0xc3, 0x80, 0x65, 0xc9, - 0xd5, 0x6d, 0x30, 0xce, 0x72, 0x2e, 0x39, 0xba, 0x1b, 0x56, 0x6c, 0x68, 0x7c, 0x43, 0x42, 0xb0, - 0x0d, 0x09, 0xff, 0x87, 0x05, 0xc7, 0xf3, 0x6f, 0x14, 0x17, 0x32, 0xe1, 0x69, 0x48, 0x5f, 0x0b, - 0x12, 0x12, 0x4f, 0xc0, 0x11, 0x19, 0xc5, 0xc2, 0xb3, 0xce, 0x5b, 0xa3, 0x5e, 0x68, 0x1a, 0x7c, - 0x0b, 0xce, 0x7a, 0xcb, 0x36, 0xc2, 0xb3, 0x15, 0xda, 0x0f, 0x5e, 0x8d, 0x9b, 0x56, 0xe3, 0xbb, - 0x36, 0x63, 0x7d, 0x3a, 0x34, 0x9a, 0xe1, 0x04, 0xda, 0xba, 0x40, 0x84, 0x76, 0xca, 0x6e, 0x48, - 0x39, 0x5b, 0xca, 0xb9, 0xac, 0xf5, 0x75, 0xb7, 0x6c, 0x5b, 0x90, 0x32, 0xd6, 0xa0, 0x69, 0xfc,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b, 0x9f, 0xc2, 0xd9, 0x74, 0x2d, 0x29, 0xdf, 0x23, 0xb0, 0xf1, - 0x09, 0x9c, 0x56, 0x76, 0x45, 0x22, 0xa9, 0x46, 0xb5, 0xd0, 0x83, 0x13, 0xa3, 0xbb, 0xc3, 0xb4, - 0x35, 0x53, 0x89, 0xd4, 0x32, 0xd7, 0x18, 0x07, 0xcf, 0xe0, 0x91, 0xd1, 0x34, 0x89, 0x8e, 0x8e, - 0x5d, 0xfa, 0xcc, 0x98, 0x64, 0x91, 0x54, 0xd2, 0x45, 0x9a, 0xc8, 0x8a, 0xed, 0xea, 0x88, 0x5a, - 0xb1, 0x8f, 0xbc, 0x87, 0x0f, 0xa0, 0x6f, 0xde, 0xd3, 0x00, 0x3d, 0xff, 0x35, 0x74, 0xcc, 0xaa, - 0x20, 0x40, 0x67, 0x39, 0x8d, 0xa2, 0xf9, 0x4c, 0x7d, 0xba, 0xaa, 0x2f, 0xa6, 0x8b, 0x8f, 0xaa, - 0xb6, 0xb0, 0x0f, 0xdd, 0xe8, 0x72, 0xb1, 0x5c, 0xaa, 0xc6, 0x0e, 0xae, 0xa0, 0xf7, 0x67, 0x94, - 0x18, 0x42, 0xd7, 0xbc, 0x3b, 0xe1, 0xf9, 0xa1, 0x9f, 0x6e, 0xf8, 0xe2, 0xe0, 0xca, 0xf9, 0x47, - 0x13, 0xeb, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x6d, 0xf0, 0xc4, 0x16, 0x04, 0x00, 0x00, + // 523 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xc7, 0x6b, 0x27, 0x71, 0x92, 0x49, 0xe2, 0xa6, 0xa3, 0xdf, 0x0f, 0xac, 0x80, 0x50, 0xb1, + 0x40, 0xca, 0x05, 0x2b, 0xf2, 0x85, 0x03, 0x17,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xf5, 0xa3, 0xdc, 0x97, 0xec, 0xe2, 0x00, 0xba, 0xfa, 0xd2, 0xe6, + 0x36, 0xf0, 0x04, 0x06, 0x69, 0x46, 0x0b, 0xc2, 0x73, 0x66, 0xa5, 0x26, 0x1e, 0x43, 0x6f, 0x23, + 0xcd, 0x8a, 0xeb, 0x61, 0x0b, 0x7b, 0xd0, 0xd6, 0x16, 0x1d, 0x78, 0xd8, 0x87, 0x8e, 0x29, 0xa6, + 0xa3, 0xb6, 0xce, 0xb5, 0x23, 0xb4, 0xf8, 0x4e, 0xf8, 0x0a, 0x3c, 0xbb, 0x89, 0x08, 0xe0, 0x2d, + 0xce, 0xd2, 0x74, 0x36, 0x55, 0x1d, 0xaa, 0xf3, 0xf9, 0xd9, 0xfc, 0x9d, 0x3a, 0x3b, 0x86, 0x76, + 0x39, 0x5f, 0x2c, 0x54, 0xe0, 0xc6, 0x57, 0xd0, 0xfd, 0xfd, 0xc5, 0x98, 0x40, 0xdb, 0x2e, 0x15, + 0xc5, 0xd3, 0x43, 0xff, 0xf4, 0xe8, 0xf9, 0xc1, 0x57, 0x0e, 0x8f, 0x26, 0xce, 0xaf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x7a, 0x1f, 0x6e, 0x35, 0x75, 0x04, 0x00, 0x00, } diff --git a/reporter/reporter_test.go b/reporter/reporter_test.go index 6069c4876..8d40edd08 100644 --- a/reporter/reporter_test.go +++ b/reporter/reporter_test.go @@ -58,10 +58,12 @@ func (s *MySuite) TestSubscribeScenarioStart(c *C) { SimpleConsoleOutput = true event.InitRegistry() sce := &gauge.Scenario{Heading: &gauge.Heading{Value: "My Scenario Heading"}} + sceHeading := "My scenario heading" + sceRes := result.NewScenarioResult(&gauge_messages.ProtoScenario{ScenarioHeading: &sceHeading}) ListenExecutionEvents() - event.Notify(event.NewExecutionEvent(event.ScenarioStart, sce, nil, 0, gauge_messages.ExecutionInfo{})) + event.Notify(event.NewExecutionEvent(event.ScenarioStart, sce, sceRes, 0, gauge_messages.ExecutionInfo{})) c.Assert(dw.output, Equals, " ## My Scenario Heading\n") } @@ -74,10 +76,12 @@ func (s *MySuite) TestSubscribeScenarioStartWithDataTable(c *C) { dataTable.AddHeaders([]string{"foo", "bar"}) dataTable.AddRowValues([]string{"one", "two"}) sce := &gauge.Scenario{Heading: &gauge.Heading{Value: "My Scenario Heading"}, DataTableRow: dataTable} + sceHeading := "My scenario heading" + sceRes := result.NewScenarioResult(&gauge_messages.ProtoScenario{ScenarioHeading: &sceHeading}) ListenExecutionEvents() - event.Notify(event.NewExecutionEvent(event.ScenarioStart, sce, nil, 0, gauge_messages.ExecutionInfo{})) + event.Notify(event.NewExecutionEvent(event.ScenarioStart, sce, sceRes, 0, gauge_messages.ExecutionInfo{})) table := ` |foo|bar| |---|---|