diff --git a/go.mod b/go.mod index f9bdbc6e7..4bb5fc542 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/mstoykov/k6-taskqueue-lib v0.1.0 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - go.k6.io/k6 v0.51.0 + go.k6.io/k6 v0.51.1-0.20240529085517-bdbe5b52d1f5 go.opentelemetry.io/otel v1.24.0 go.opentelemetry.io/otel/trace v1.24.0 golang.org/x/net v0.23.0 @@ -29,6 +29,7 @@ require ( github.com/chromedp/sysutil v1.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dlclark/regexp2 v1.9.0 // indirect + github.com/evanw/esbuild v0.21.2 // indirect github.com/fatih/color v1.16.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/go.sum b/go.sum index 9a34ea774..eda3c0ba7 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ github.com/dop251/goja v0.0.0-20240220182346-e401ed450204 h1:O7I1iuzEA7SG+dK8ocO github.com/dop251/goja v0.0.0-20240220182346-e401ed450204/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= +github.com/evanw/esbuild v0.21.2 h1:CLplcGi794CfHLVmUbvVfTMKkykm+nyIHU8SU60KUTA= +github.com/evanw/esbuild v0.21.2/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -137,8 +139,8 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.k6.io/k6 v0.51.0 h1:TdMpPNwYuvtmBF1APoKFHuMnNzdIMI/XLaPklSjrIUw= -go.k6.io/k6 v0.51.0/go.mod h1:72d4MKuvKiRnkbPBGOk/gbz1aAcbKycX+GIlU7IOpuA= +go.k6.io/k6 v0.51.1-0.20240529085517-bdbe5b52d1f5 h1:cJBN6CjQVgxjmKduTN3VmEbZxruGnLO6Ip79FAf84Gw= +go.k6.io/k6 v0.51.1-0.20240529085517-bdbe5b52d1f5/go.mod h1:YvtuIbREVgWl7DuAT0IZqaiw4SxxRqLOXdlgkXkR0rU= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= diff --git a/k6ext/k6test/vu.go b/k6ext/k6test/vu.go index 376613530..b3834d7ef 100644 --- a/k6ext/k6test/vu.go +++ b/k6ext/k6test/vu.go @@ -16,6 +16,7 @@ import ( k6common "go.k6.io/k6/js/common" k6eventloop "go.k6.io/k6/js/eventloop" k6modulestest "go.k6.io/k6/js/modulestest" + "go.k6.io/k6/lib" k6lib "go.k6.io/k6/lib" k6executor "go.k6.io/k6/lib/executor" k6testutils "go.k6.io/k6/lib/testutils" @@ -158,9 +159,6 @@ func NewVU(tb testing.TB, opts ...any) *VU { logger := k6testutils.NewLogger(tb) - root, err := k6lib.NewGroup("", nil) - require.NoError(tb, err) - testRT := k6modulestest.NewRuntime(tb) testRT.VU.InitEnvField.LookupEnv = lookupFunc testRT.VU.EventsField = k6common.Events{ @@ -168,8 +166,6 @@ func NewVU(tb testing.TB, opts ...any) *VU { Local: k6event.NewEventSystem(100, logger), } - tags := testRT.VU.InitEnvField.Registry.RootTagSet() - state := &k6lib.State{ Options: k6lib.Options{ MaxRedirects: null.IntFrom(10), @@ -191,11 +187,12 @@ func NewVU(tb testing.TB, opts ...any) *VU { }, }, }, - Logger: logger, - Group: root, - BufferPool: k6lib.NewBufferPool(), - Samples: samples, - Tags: k6lib.NewVUStateTags(tags.With("group", root.Path)), + Logger: logger, + BufferPool: k6lib.NewBufferPool(), + Samples: samples, + Tags: k6lib.NewVUStateTags( + testRT.VU.InitEnvField.Registry.RootTagSet().With("group", lib.RootGroupPath), + ), BuiltinMetrics: k6metrics.RegisterBuiltinMetrics(k6metrics.NewRegistry()), TracerProvider: tracerProvider, }