Skip to content

Commit

Permalink
Merge branch 'master' into grpc-client-discard-response-message
Browse files Browse the repository at this point in the history
  • Loading branch information
lzakharov authored Jul 19, 2024
2 parents 591cd4c + 7b62bc9 commit e9c3c94
Show file tree
Hide file tree
Showing 37 changed files with 988 additions and 1,184 deletions.
6 changes: 4 additions & 2 deletions cmd/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ func getAllOutputConstructors() (map[string]output.Constructor, error) {
"please use the new xk6 kafka output extension instead - https://github.com/k6io/xk6-output-kafka")
},
builtinOutputStatsd.String(): func(params output.Params) (output.Output, error) {
params.Logger.Warn("The statsd output is deprecated, and will be removed in a future k6 version. " +
params.Logger.Warn("The statsd output is deprecated, and will be removed in k6 v0.55.0 " +
"Please use the new xk6 statsd output extension instead. " +
"It can be found at https://github.com/LeonAdato/xk6-output-statsd and " +
"more info at https://github.com/grafana/k6/issues/2982.")
return statsd.New(params)
},
builtinOutputDatadog.String(): func(_ output.Params) (output.Output, error) {
return nil, errors.New("the datadog output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, " +
"please use the statsd output with env. variable K6_STATSD_ENABLE_TAGS=true instead")
"please use the statsd output extension https://github.com/LeonAdato/xk6-output-statsd with environment " +
"variable K6_STATSD_ENABLE_TAGS=true or an experimental opentelemetry output instead",
)
},
builtinOutputExperimentalPrometheusRW.String(): func(params output.Params) (output.Output, error) {
return remotewrite.New(params)
Expand Down
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func (c *cmdRun) run(cmd *cobra.Command, args []string) (err error) {

// Check what the execScheduler.Run() error is.
if err != nil {
err = common.UnwrapGojaInterruptedError(err)
err = common.UnwrapSobekInterruptedError(err)
logger.WithError(err).Debug("Test finished with an error")
return err
}
Expand Down
5 changes: 2 additions & 3 deletions cmd/runtime_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ func runtimeOptionFlagSet(includeSysEnv bool) *pflag.FlagSet {
flags.Bool("include-system-env-vars", includeSysEnv, "pass the real system environment variables to the runtime")
flags.String("compatibility-mode", "extended",
`JavaScript compiler compatibility mode, "extended" or "base" or "experimental_enhanced"
base: pure Sobek - Golang JS VM supporting ES5.1+
extended: base + Babel with parts of ES2015 preset
slower to compile in case the script uses syntax unsupported by base
base: pure Sobek - Golang JS VM supporting ES6+
extended: base + sets "global" as alias for "globalThis"
experimental_enhanced: esbuild-based transpiling for TypeScript and ES6+ support
`)
flags.StringP("type", "t", "", "override test type, \"js\" or \"archive\"")
Expand Down
22 changes: 11 additions & 11 deletions cmd/tests/cmd_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,8 @@ func TestAbortedByScriptSetupErrorWithDependency(t *testing.T) {
if runtime.GOOS == "windows" {
rootPath += "c:/"
}
assert.Contains(t, stdout, `level=error msg="Error: baz\n\tat baz (`+rootPath+`test/bar.js:6:9(3))\n\tat `+
rootPath+`test/bar.js:3:3(3)\n\tat setup (`+rootPath+`test/test.js:5:3(9))\n" hint="script exception"`)
assert.Contains(t, stdout, `level=error msg="Error: baz\n\tat baz (`+rootPath+`test/bar.js:6:10(3))\n\tat default (`+
rootPath+`test/bar.js:3:7(3))\n\tat setup (`+rootPath+`test/test.js:5:7(8))\n" hint="script exception"`)
assert.Contains(t, stdout, `level=debug msg="Sending test finished" output=cloud ref=123 run_status=7 tainted=false`)
assert.Contains(t, stdout, "bogus summary")
}
Expand Down Expand Up @@ -2105,10 +2105,10 @@ func TestEventSystemError(t *testing.T) {
"got event Init with data '<nil>'",
"got event TestStart with data '<nil>'",
"got event IterStart with data '{Iteration:0 VUID:1 ScenarioName:default Error:<nil>}'",
"got event IterEnd with data '{Iteration:0 VUID:1 ScenarioName:default Error:test aborted: oops! at file:///-:11:16(6)}'",
"got event IterEnd with data '{Iteration:0 VUID:1 ScenarioName:default Error:test aborted: oops! at default (file:///-:11:16(5))}'",
"got event TestEnd with data '<nil>'",
"got event Exit with data '&{Error:test aborted: oops! at file:///-:11:16(6)}'",
"test aborted: oops! at file:///-:11:16(6)",
"got event Exit with data '&{Error:test aborted: oops! at default (file:///-:11:16(5))}'",
"test aborted: oops! at default (file:///-:11:16(5))",
},
expExitCode: exitcodes.ScriptAborted,
},
Expand All @@ -2117,8 +2117,8 @@ func TestEventSystemError(t *testing.T) {
script: "undefinedVar",
expLog: []string{
"got event Exit with data '&{Error:could not initialize '-': could not load JS test " +
"'file:///-': ReferenceError: undefinedVar is not defined\n\tat file:///-:2:0(12)\n}'",
"ReferenceError: undefinedVar is not defined\n\tat file:///-:2:0(12)\n",
"'file:///-': ReferenceError: undefinedVar is not defined\n\tat file:///-:2:1(8)\n}'",
"ReferenceError: undefinedVar is not defined\n\tat file:///-:2:1(8)\n",
},
expExitCode: exitcodes.ScriptException,
},
Expand All @@ -2137,11 +2137,11 @@ func TestEventSystemError(t *testing.T) {
"got event Init with data '<nil>'",
"got event TestStart with data '<nil>'",
"got event IterStart with data '{Iteration:0 VUID:1 ScenarioName:default Error:<nil>}'",
"got event IterEnd with data '{Iteration:0 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 IterEnd with data '{Iteration:0 VUID:1 ScenarioName:default Error:Error: oops!\n\tat default (file:///-:9:12(3))\n}'",
"Error: oops!\n\tat default (file:///-:9:12(3))\n",
"got event IterStart with data '{Iteration:1 VUID:1 ScenarioName:default Error:<nil>}'",
"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 IterEnd with data '{Iteration:1 VUID:1 ScenarioName:default Error:Error: oops!\n\tat default (file:///-:9:12(3))\n}'",
"Error: oops!\n\tat default (file:///-:9:12(3))\n",
"got event TestEnd with data '<nil>'",
"got event Exit with data '&{Error:<nil>}'",
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/tests/eventloop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestEventLoopDoesntCrossIterations(t *testing.T) {
eventLoopTest(t, script, func(logLines []string) {
require.Equal(t, []string{
"setTimeout 1 was stopped because the VU iteration was interrupted",
"just error\n\tat file:///-:13:4(15)\n", "1",
"just error\n\tat default (file:///-:13:5(14))\n", "1",
}, logLines)
})
}
Expand Down
Loading

0 comments on commit e9c3c94

Please sign in to comment.