Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade k6 to v0.38.3 (breaking change) #3

Closed
ex0b1t opened this issue Aug 7, 2022 · 1 comment
Closed

Upgrade k6 to v0.38.3 (breaking change) #3

ex0b1t opened this issue Aug 7, 2022 · 1 comment

Comments

@ex0b1t
Copy link

ex0b1t commented Aug 7, 2022

The upgrade to v0.38.0 has some breaking changes, see the below release notes.

The reason for this is if you need to build a k6 runner with multiple extensions. For example the below will fail.

xk6 build \
  --with github.com/walterwanderley/xk6-stomp \
  --with github.com/grafana/xk6-output-influxdb

The Go types in the stats package were moved to the metrics package grafana/k6#2433
For convenience and to facilitate further developments, the types and functionalities that used to live in k6's stats package have been moved to the metrics package. The stats package is, as of v0.38.0, removed in favor of the metrics package. Besides, grafana/k6#2442 removed the stats.New function in favor of initializing new metric via a register.NewMetric call instead.

@ex0b1t
Copy link
Author

ex0b1t commented Aug 7, 2022

I started working on a change but I'm not a Go dev and I was not able to get it to work (yet).
main...ex0b1t:xk6-stomp:main

❯ xk6 run ./scripts/examples/stomp.js -v
2022/08/08 00:09:50 [INFO] Temporary folder: /Users/jaco/code/github/xk6-stomp/buildenv_2022-08-08-0009.3821980493
2022/08/08 00:09:50 [INFO] Initializing Go module
2022/08/08 00:09:50 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init k6 
go: creating new go.mod: module k6
2022/08/08 00:09:50 [INFO] Replace github.com/walterwanderley/xk6-stomp => /Users/jaco/code/github/xk6-stomp
2022/08/08 00:09:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod edit -replace github.com/walterwanderley/xk6-stomp=/Users/jaco/code/github/xk6-stomp 
2022/08/08 00:09:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17 
go: warning: "all" matched no packages
2022/08/08 00:09:50 [INFO] Pinning versions
2022/08/08 00:09:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17 
go: found github.com/walterwanderley/xk6-stomp in github.com/walterwanderley/xk6-stomp v0.0.0-00010101000000-000000000000
go: finding module for package github.com/fsnotify/fsnotify
go: finding module for package gopkg.in/tomb.v1
go: found gopkg.in/tomb.v1 in gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: found github.com/fsnotify/fsnotify in github.com/fsnotify/fsnotify v1.5.4
2022/08/08 00:09:50 [INFO] Writing main module: /Users/jaco/code/github/xk6-stomp/buildenv_2022-08-08-0009.3821980493/main.go
2022/08/08 00:09:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17 
2022/08/08 00:09:50 [INFO] Build environment ready
2022/08/08 00:09:50 [INFO] Building k6
2022/08/08 00:09:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17 
2022/08/08 00:09:50 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /Users/jaco/code/github/xk6-stomp/k6 -ldflags -w -s -trimpath 
2022/08/08 00:09:52 [INFO] Build complete: ./k6
2022/08/08 00:09:52 [INFO] Cleaning up temporary folder: /Users/jaco/code/github/xk6-stomp/buildenv_2022-08-08-0009.3821980493
2022/08/08 00:09:52 [INFO] Running [./k6 run /Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js -v]

DEBU[0000] Logger format: TEXT                          
DEBU[0000] k6 version: v0.38.3 ((devel), go1.19, darwin/amd64) 

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

DEBU[0000] Resolving and reading test '/Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js'... 
DEBU[0000] Loading...                                    moduleSpecifier="file:///Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js" originalModuleSpecifier=/Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js
DEBU[0000] '/Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js' resolved to 'file:///Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js' and successfully loaded 1962 bytes! 
DEBU[0000] Gathering k6 runtime options...              
DEBU[0000] Initializing k6 runner for '/Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js' (file:///Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js)... 
DEBU[0000] Detecting test type for...                    test_path="file:///Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js"
DEBU[0000] Trying to load as a JS test...                test_path="file:///Users/jaco/code/github/baas-devops-rnd/ce-k6/scripts/examples/stomp.js"
DEBU[0000] Babel: Transformed                            t=59.052708ms
DEBU[0000] Loading...                                    moduleSpecifier="https://jslib.k6.io/k6-utils/1.4.0/index.js" originalModuleSpecifier="https://jslib.k6.io/k6-utils/1.4.0/index.js"
DEBU[0000] Fetching source...                            url="https://jslib.k6.io/k6-utils/1.4.0/index.js?_k6=1"
DEBU[0000] Fetched!                                      len=4974 t=80.740166ms url="https://jslib.k6.io/k6-utils/1.4.0/index.js?_k6=1"
DEBU[0000] Loading...                                    moduleSpecifier="https://jslib.k6.io/k6-utils/1.4.0/index.js.map" originalModuleSpecifier="https://jslib.k6.io/k6-utils/1.4.0/index.js.map"
DEBU[0000] Fetching source...                            url="https://jslib.k6.io/k6-utils/1.4.0/index.js.map?_k6=1"
DEBU[0000] Fetched!                                      len=16297 t=10.432959ms url="https://jslib.k6.io/k6-utils/1.4.0/index.js.map?_k6=1"
DEBU[0000] Runner successfully initialized!             
DEBU[0000] Parsing CLI flags...                         
DEBU[0000] Consolidating config layers...               
DEBU[0000] Parsing thresholds and validating config...  
ERRO[0000] invalid threshold defined on stomp_read_time; reason: no metric name "stomp_read_time" found 
2022/08/08 00:09:54 [ERROR] exit status 104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant