Skip to content

Commit

Permalink
fixup! Emit events in run command and js.VU.RunOnce()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Jun 6, 2023
1 parent 524cdff commit 1dd74bf
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions cmd/tests/cmd_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2034,20 +2034,20 @@ func TestEventSystemOK(t *testing.T) {
cmd.ExecuteWithGlobalState(ts.GlobalState)

expLog := []string{
`got event init with data '<nil>', test status: InitVUs`,
`got event testStart with data '<nil>', test status: Running`,
`got event iterStart with data '{Iteration:0 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterEnd with data '{Iteration:0 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterStart with data '{Iteration:1 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterEnd with data '{Iteration:1 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterStart with data '{Iteration:2 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterEnd with data '{Iteration:2 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterStart with data '{Iteration:3 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterEnd with data '{Iteration:3 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterStart with data '{Iteration:4 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event iterEnd with data '{Iteration:4 VUID:1 ScenarioName:default Error:<nil>}', test status: Ended`,
`got event testEnd with data '<nil>', test status: Ended`,
`got event exit with data '&{Error:<nil>}'`,
`got event Init with data '<nil>', test status: InitVUs`,
`got event TestStart with data '<nil>', test status: Running`,
`got event IterStart with data '{Iteration:0 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterEnd with data '{Iteration:0 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterStart with data '{Iteration:1 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterEnd with data '{Iteration:1 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterStart with data '{Iteration:2 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterEnd with data '{Iteration:2 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterStart with data '{Iteration:3 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterEnd with data '{Iteration:3 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterStart with data '{Iteration:4 VUID:1 ScenarioName:default Error:<nil>}', test status: Running`,
`got event IterEnd with data '{Iteration:4 VUID:1 ScenarioName:default Error:<nil>}', test status: Ended`,
`got event TestEnd with data '<nil>', test status: Ended`,
`got event Exit with data '&{Error:<nil>}'`,
}
log := ts.LoggerHook.Lines()
assert.Equal(t, expLog, log)
Expand Down Expand Up @@ -2086,10 +2086,10 @@ func TestEventSystemAborted(t *testing.T) {
cmd.ExecuteWithGlobalState(ts.GlobalState)

expLog := []string{
`got event init with data '<nil>', test status: InitVUs`,
`got event testStart with data '<nil>', test status: Running`,
`got event testEnd with data '<nil>', test status: Interrupted`,
`got event exit with data '&{Error:test aborted: oops! at file:///-:13:14(12)}'`,
`got event Init with data '<nil>', test status: InitVUs`,
`got event TestStart with data '<nil>', test status: Running`,
`got event TestEnd with data '<nil>', test status: Interrupted`,
`got event Exit with data '&{Error:test aborted: oops! at file:///-:13:14(12)}'`,
`test aborted: oops! at file:///-:13:14(12)`,
}
log := ts.LoggerHook.Lines()
Expand Down

0 comments on commit 1dd74bf

Please sign in to comment.