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

Display any extensions bundled by xk6 in the pre-execution output #1741

Closed
simskij opened this issue Nov 27, 2020 · 4 comments
Closed

Display any extensions bundled by xk6 in the pre-execution output #1741

simskij opened this issue Nov 27, 2020 · 4 comments
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature medium prio
Milestone

Comments

@simskij
Copy link
Contributor

simskij commented Nov 27, 2020

Feature Description

With the introduction of xk6, it is likely that we'll start to get support questions or bug reports where users are running bespoke versions of k6. From a "k6 core" point of view, the course of action would/should likely be to ask the user to try again with an official build.

That aside, if we ever want to support any extension, or make life easier for extension developers, we need some way to tell by execution logs how to replicate their builds.

Suggested Solution

Add a new row in the pre-execution output of k6 cli. This would only be visible when k6 detects something in the 'k6/x' namespace, and should then list extensions and their versions. Mockup below:

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io
  execution: local
     script: test.js
 extensions: github.com/dgzlopes/k6-extension-notifications
             github.com/dgzlopes/k6-extension-zmq
     output: -

With versions displayed:

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io
  execution: local
     script: test.js
 extensions: github.com/dgzlopes/[email protected]
             github.com/dgzlopes/[email protected]
     output: -

Given that we've been discussing other kinds of extensions than js extensions in the future, we might also need some way to detect those. One way of doing this would be to add a tripwire to modules.Register instead. Personally, I'd argue that we can leave that as a future improvement and focus on the js case for now.

@simskij simskij added feature medium prio evaluation needed proposal needs to be validated or tested before fully implementing it in k6 labels Nov 27, 2020
@na--
Copy link
Member

na-- commented Nov 27, 2020

We might also investigate a way to display the included extensions and their version in the output of k6 version, so we have a one-stop command we can ask users to perform, which will give us all the information we want (k6 version, Go version, OS, extensions).

@imiric
Copy link
Contributor

imiric commented Nov 15, 2021

Hey, can we prioritize this for an upcoming cycle?

Support for outputting the included extensions and their version in k6 version specifically would be helpful when working on extension issues reported by users, since currently it outputs something like k6 v0.34.1 ((devel), go1.17.2, darwin/amd64). See grafana/xk6-browser#111 (comment).

We should probably define a new Version() method extensions must implement.

@na-- na-- added this to the v0.36.0 milestone Nov 16, 2021
@na--
Copy link
Member

na-- commented Nov 16, 2021

Yeah, it's probably high time we do this... The Version() method should be optional though, if it's not implemented, we can just display the extension import path or output identifier 🤷‍♂️ Though I wonder if we even need Version(), maybe this is enough? https://pkg.go.dev/runtime/debug#BuildInfo

@na--
Copy link
Member

na-- commented Dec 20, 2022

Closed by #2805 (which was actually merged in #2826)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature medium prio
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants