diff --git a/cmd/run.go b/cmd/run.go index 2290e432407..ee64c6f54a7 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -202,11 +202,6 @@ func (c *cmdRun) run(cmd *cobra.Command, args []string) (err error) { }) if hsErr == nil { hsErr = handleSummaryResult(c.gs.FS, c.gs.Stdout, c.gs.Stderr, summaryResult) - waitForSummaryGeneratedEvent := emitEvent(&event.Event{ - Type: event.TestSummaryGenerated, - Data: &event.SummaryData{Summary: summaryResult}, - }) - waitForSummaryGeneratedEvent() } if hsErr != nil { logger.WithError(hsErr).Error("failed to handle the end-of-test summary") diff --git a/cmd/tests/cmd_run_test.go b/cmd/tests/cmd_run_test.go index 321fb896f25..cf55d8bf00a 100644 --- a/cmd/tests/cmd_run_test.go +++ b/cmd/tests/cmd_run_test.go @@ -2073,7 +2073,6 @@ func TestEventSystemOK(t *testing.T) { `got event IterStart with data '{Iteration:4 VUID:1 ScenarioName:default Error:}'`, `got event IterEnd with data '{Iteration:4 VUID:1 ScenarioName:default Error:}'`, `got event TestEnd with data ''`, - `got event TestSummaryGenerated with data '&{Summary:map[stdout:]}'`, `got event Exit with data '&{Error:}'`, } log := ts.LoggerHook.Lines() @@ -2108,7 +2107,6 @@ func TestEventSystemError(t *testing.T) { "got event IterStart with data '{Iteration:0 VUID:1 ScenarioName:default Error:}'", "got event IterEnd with data '{Iteration:0 VUID:1 ScenarioName:default Error:test aborted: oops! at file:///-:11:16(6)}'", "got event TestEnd with data ''", - "got event TestSummaryGenerated with data '&{Summary:map[stdout:]}'", "got event Exit with data '&{Error:test aborted: oops! at file:///-:11:16(6)}'", "test aborted: oops! at file:///-:11:16(6)", }, @@ -2145,7 +2143,6 @@ func TestEventSystemError(t *testing.T) { "got event IterEnd with data '{Iteration:1 VUID:1 ScenarioName:default Error:Error: oops!\n\tat file:///-:9:11(3)\n}'", "Error: oops!\n\tat file:///-:9:11(3)\n", "got event TestEnd with data ''", - "got event TestSummaryGenerated with data '&{Summary:map[stdout:]}'", "got event Exit with data '&{Error:}'", }, expExitCode: 0, diff --git a/event/type.go b/event/type.go index 8755ddea131..7e02f3e04d3 100644 --- a/event/type.go +++ b/event/type.go @@ -1,7 +1,5 @@ package event -import "io" - // Type represents the different event types emitted by k6. // //go:generate enumer -type=Type -trimprefix Type -output type_gen.go @@ -20,14 +18,12 @@ const ( IterEnd // Exit is emitted when the k6 process is about to exit. Exit - // TestSummaryGenerated is emitted when the test result summary is generated. - TestSummaryGenerated ) //nolint:gochecknoglobals var ( // GlobalEvents are emitted once per test run. - GlobalEvents = []Type{Init, TestStart, TestEnd, TestSummaryGenerated, Exit} + GlobalEvents = []Type{Init, TestStart, TestEnd, Exit} // VUEvents are emitted multiple times per each VU. VUEvents = []Type{IterStart, IterEnd} ) @@ -45,8 +41,3 @@ type IterData struct { ScenarioName string Error error } - -// SummaryData is the data sent in the TestSummaryGenerated event. -type SummaryData struct { - Summary map[string]io.Reader -} diff --git a/event/type_gen.go b/event/type_gen.go index 9c88b079daf..21b2662ba3b 100644 --- a/event/type_gen.go +++ b/event/type_gen.go @@ -6,9 +6,9 @@ import ( "fmt" ) -const _TypeName = "InitTestStartTestEndIterStartIterEndExitTestSummaryGenerated" +const _TypeName = "InitTestStartTestEndIterStartIterEndExit" -var _TypeIndex = [...]uint8{0, 4, 13, 20, 29, 36, 40, 60} +var _TypeIndex = [...]uint8{0, 4, 13, 20, 29, 36, 40} func (i Type) String() string { i -= 1 @@ -18,7 +18,7 @@ func (i Type) String() string { return _TypeName[_TypeIndex[i]:_TypeIndex[i+1]] } -var _TypeValues = []Type{1, 2, 3, 4, 5, 6, 7} +var _TypeValues = []Type{1, 2, 3, 4, 5, 6} var _TypeNameToValueMap = map[string]Type{ _TypeName[0:4]: 1, @@ -27,7 +27,6 @@ var _TypeNameToValueMap = map[string]Type{ _TypeName[20:29]: 4, _TypeName[29:36]: 5, _TypeName[36:40]: 6, - _TypeName[40:60]: 7, } // TypeString retrieves an enum value from the enum constants string name.