Skip to content

Commit 2e807de

Browse files
committed
update xk6 dependencies to work with latest versions
1 parent 34c2f20 commit 2e807de

File tree

7 files changed

+386
-590
lines changed

7 files changed

+386
-590
lines changed

go.work

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
go 1.24.0
1+
go 1.25.4
22

33
use (
44
.

go.work.sum

Lines changed: 197 additions & 21 deletions
Large diffs are not rendered by default.

xk6-pitaya/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
## Building the k6 binary
88

99
```shell
10-
xk6 build --with github.com/topfreegames/xk6-pitaya=. --with github.com/topfreegames/pitaya/v3/pkg=../pkg
10+
xk6 build --with github.com/topfreegames/pitaya/xk6-pitaya=./ --replace github.com/topfreegames/pitaya/v3=../
1111
```
1212

1313
## Building the k6 docker image

xk6-pitaya/client.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"sync"
1111
"time"
1212

13-
"github.com/dop251/goja"
13+
"github.com/grafana/sobek"
1414
pitayaclient "github.com/topfreegames/pitaya/v3/pkg/client"
1515
pitayamessage "github.com/topfreegames/pitaya/v3/pkg/conn/message"
1616
"github.com/topfreegames/pitaya/v3/pkg/session"
@@ -71,7 +71,7 @@ func (c *Client) IsConnected() bool {
7171
// ConsumePush will return a promise that will be resolved when a push is received on the given route.
7272
// The promise will be rejected if the timeout is reached before a push is received.
7373
// The promise will be resolved with the push data.
74-
func (c *Client) ConsumePush(route string, timeoutMs int) *goja.Promise {
74+
func (c *Client) ConsumePush(route string, timeoutMs int) *sobek.Promise {
7575
promise, resolve, reject := c.makeHandledPromise()
7676
ch := c.getPushChannelForRoute(route)
7777
go func() {
@@ -115,7 +115,7 @@ func (c *Client) Notify(route string, msg interface{}) error {
115115
// str is the string passed in request
116116
// returns a promise that will be resolved when the response is received
117117
// the promise will be rejected if the timeout is reached before a response is received
118-
func (c *Client) RequestB64(route string, b64msg string) *goja.Promise { // TODO: add custom timeout
118+
func (c *Client) RequestB64(route string, b64msg string) *sobek.Promise { // TODO: add custom timeout
119119
promise, resolve, reject := c.makeHandledPromise()
120120
data, err := base64.StdEncoding.DecodeString(b64msg)
121121
if err != nil {
@@ -155,7 +155,7 @@ func (c *Client) RequestB64(route string, b64msg string) *goja.Promise { // TODO
155155
// msg is the message to send
156156
// returns a promise that will be resolved when the response is received
157157
// the promise will be rejected if the timeout is reached before a response is received
158-
func (c *Client) Request(route string, msg interface{}) *goja.Promise { // TODO: add custom timeout
158+
func (c *Client) Request(route string, msg interface{}) *sobek.Promise { // TODO: add custom timeout
159159
m := msg
160160
if m == nil {
161161
m = map[string]interface{}{}
@@ -295,7 +295,7 @@ func (c *Client) getPushChannelForRoute(route string) chan []byte {
295295
// makeHandledPromise will create a promise and return its resolve and reject methods,
296296
// wrapped in such a way that it will block the eventloop from exiting before they are
297297
// called even if the promise isn't resolved by the time the current script ends executing.
298-
func (c *Client) makeHandledPromise() (*goja.Promise, func(interface{}), func(interface{})) {
298+
func (c *Client) makeHandledPromise() (*sobek.Promise, func(interface{}), func(interface{})) {
299299
runtime := c.vu.Runtime()
300300
callback := c.vu.RegisterCallback()
301301
p, resolve, reject := runtime.NewPromise()

xk6-pitaya/go.mod

Lines changed: 50 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
module github.com/topfreegames/pitaya/xk6-pitaya
22

3-
go 1.23
4-
5-
toolchain go1.23.4
3+
go 1.25
64

75
require (
8-
github.com/dop251/goja v0.0.0-20240610225006-393f6d42497b
6+
github.com/grafana/sobek v0.0.0-20251121143121-9f4828fa8148
97
github.com/sirupsen/logrus v1.9.3
10-
github.com/topfreegames/pitaya/v3 v3.0.0-20240729164016-edc136f224b3
11-
go.k6.io/k6 v0.52.0
8+
github.com/topfreegames/pitaya/v3 v3.0.0-beta.6.0.20251121170220-34c2f2055044
9+
go.k6.io/k6 v1.4.1
1210
)
1311

1412
require (
1513
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
16-
github.com/Microsoft/go-winio v0.6.1 // indirect
14+
github.com/Microsoft/go-winio v0.6.2 // indirect
1715
github.com/beorn7/perks v1.0.1 // indirect
1816
github.com/bitly/go-simplejson v0.5.1 // indirect
19-
github.com/bufbuild/protocompile v0.8.0 // indirect
20-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
21-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
17+
github.com/bufbuild/protocompile v0.14.1 // indirect
18+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
19+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2220
github.com/coreos/go-semver v0.3.1 // indirect
2321
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
24-
github.com/dlclark/regexp2 v1.9.0 // indirect
25-
github.com/evanw/esbuild v0.21.2 // indirect
26-
github.com/fatih/color v1.16.0 // indirect
22+
github.com/dlclark/regexp2 v1.11.5 // indirect
23+
github.com/evanw/esbuild v0.27.0 // indirect
24+
github.com/fatih/color v1.18.0 // indirect
2725
github.com/fsnotify/fsnotify v1.6.0 // indirect
28-
github.com/go-logr/logr v1.4.2 // indirect
26+
github.com/go-logr/logr v1.4.3 // indirect
2927
github.com/go-logr/stdr v1.2.2 // indirect
3028
github.com/go-playground/locales v0.14.1 // indirect
3129
github.com/go-playground/universal-translator v0.18.1 // indirect
@@ -34,74 +32,69 @@ require (
3432
github.com/gogo/protobuf v1.3.2 // indirect
3533
github.com/golang/protobuf v1.5.4 // indirect
3634
github.com/gomodule/redigo v1.9.2 // indirect
37-
github.com/google/pprof v0.0.0-20230728192033-2ba5b33183c6 // indirect
35+
github.com/google/pprof v0.0.0-20251114195745-4902fdda35c8 // indirect
3836
github.com/google/uuid v1.6.0 // indirect
39-
github.com/gorilla/websocket v1.5.1 // indirect
40-
github.com/grafana/sobek v0.0.0-20240613124309-cb36746e8fee // indirect
41-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
37+
github.com/gorilla/websocket v1.5.3 // indirect
38+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
4239
github.com/hashicorp/hcl v1.0.0 // indirect
43-
github.com/jhump/protoreflect v1.15.6 // indirect
40+
github.com/jhump/protoreflect v1.17.0 // indirect
4441
github.com/josharian/intern v1.0.0 // indirect
45-
github.com/klauspost/compress v1.17.11 // indirect
42+
github.com/klauspost/compress v1.18.1 // indirect
4643
github.com/leodido/go-urn v1.2.4 // indirect
47-
github.com/magiconair/properties v1.8.7 // indirect
44+
github.com/magiconair/properties v1.8.10 // indirect
4845
github.com/mailgun/proxyproto v1.0.0 // indirect
49-
github.com/mailru/easyjson v0.7.7 // indirect
50-
github.com/mattn/go-colorable v0.1.13 // indirect
46+
github.com/mailru/easyjson v0.9.1 // indirect
47+
github.com/mattn/go-colorable v0.1.14 // indirect
5148
github.com/mattn/go-isatty v0.0.20 // indirect
52-
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
5349
github.com/mitchellh/mapstructure v1.5.0 // indirect
5450
github.com/mstoykov/atlas v0.0.0-20220811071828-388f114305dd // indirect
55-
github.com/nats-io/nats-server/v2 v2.10.24 // indirect
56-
github.com/nats-io/nats.go v1.38.0 // indirect
57-
github.com/nats-io/nkeys v0.4.9 // indirect
51+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
52+
github.com/nats-io/nats.go v1.47.0 // indirect
53+
github.com/nats-io/nkeys v0.4.11 // indirect
5854
github.com/nats-io/nuid v1.0.1 // indirect
5955
github.com/onsi/ginkgo v1.16.5 // indirect
60-
github.com/onsi/gomega v1.20.2 // indirect
56+
github.com/onsi/gomega v1.33.0 // indirect
6157
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
6258
github.com/pkg/errors v0.9.1 // indirect
63-
github.com/prometheus/client_golang v1.16.0 // indirect
64-
github.com/prometheus/client_model v0.5.0 // indirect
65-
github.com/prometheus/common v0.43.0 // indirect
66-
github.com/prometheus/procfs v0.10.1 // indirect
59+
github.com/prometheus/client_golang v1.23.2 // indirect
60+
github.com/prometheus/client_model v0.6.2 // indirect
61+
github.com/prometheus/common v0.67.4 // indirect
62+
github.com/prometheus/procfs v0.19.2 // indirect
6763
github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e // indirect
68-
github.com/spf13/afero v1.10.0 // indirect
64+
github.com/spf13/afero v1.15.0 // indirect
6965
github.com/spf13/cast v1.5.1 // indirect
7066
github.com/spf13/jwalterweatherman v1.1.0 // indirect
71-
github.com/spf13/pflag v1.0.5 // indirect
67+
github.com/spf13/pflag v1.0.10 // indirect
7268
github.com/spf13/viper v1.15.0 // indirect
7369
github.com/stretchr/objx v0.5.2 // indirect
7470
github.com/subosito/gotenv v1.4.2 // indirect
7571
github.com/topfreegames/go-workers v1.2.1 // indirect
7672
go.etcd.io/etcd/api/v3 v3.5.11 // indirect
7773
go.etcd.io/etcd/client/pkg/v3 v3.5.11 // indirect
7874
go.etcd.io/etcd/client/v3 v3.5.11 // indirect
79-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
80-
go.opentelemetry.io/otel v1.28.0 // indirect
81-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
82-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
83-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
84-
go.opentelemetry.io/otel/metric v1.28.0 // indirect
85-
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
86-
go.opentelemetry.io/otel/trace v1.28.0 // indirect
87-
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
75+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
76+
go.opentelemetry.io/otel v1.38.0 // indirect
77+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
78+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0 // indirect
79+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 // indirect
80+
go.opentelemetry.io/otel/metric v1.38.0 // indirect
81+
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
82+
go.opentelemetry.io/otel/trace v1.38.0 // indirect
83+
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
8884
go.uber.org/atomic v1.11.0 // indirect
8985
go.uber.org/multierr v1.11.0 // indirect
9086
go.uber.org/zap v1.24.0 // indirect
91-
golang.org/x/crypto v0.31.0 // indirect
92-
golang.org/x/mod v0.19.0 // indirect
93-
golang.org/x/net v0.27.0 // indirect
94-
golang.org/x/sync v0.10.0 // indirect
95-
golang.org/x/sys v0.28.0 // indirect
96-
golang.org/x/text v0.21.0 // indirect
97-
golang.org/x/time v0.8.0 // indirect
98-
golang.org/x/tools v0.23.0 // indirect
99-
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
100-
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
101-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
102-
google.golang.org/grpc v1.64.0 // indirect
103-
google.golang.org/protobuf v1.34.2 // indirect
104-
gopkg.in/guregu/null.v3 v3.3.0 // indirect
87+
go.yaml.in/yaml/v2 v2.4.3 // indirect
88+
golang.org/x/crypto v0.45.0 // indirect
89+
golang.org/x/net v0.47.0 // indirect
90+
golang.org/x/sys v0.38.0 // indirect
91+
golang.org/x/text v0.31.0 // indirect
92+
golang.org/x/time v0.14.0 // indirect
93+
google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba // indirect
94+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251111163417-95abcf5c77ba // indirect
95+
google.golang.org/grpc v1.77.0 // indirect
96+
google.golang.org/protobuf v1.36.10 // indirect
97+
gopkg.in/guregu/null.v3 v3.5.0 // indirect
10598
gopkg.in/ini.v1 v1.67.0 // indirect
10699
gopkg.in/yaml.v3 v3.0.1 // indirect
107100
)

0 commit comments

Comments
 (0)