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

Provide an end-of-build message #42

Merged
merged 2 commits into from
Mar 18, 2022
Merged

Conversation

javaducky
Copy link
Contributor

@javaducky javaducky commented Mar 17, 2022

Addresses issue #38.

Example output:
image

I didn't add the output to the log, preferring plain stdout. WDYT? Timestamps and level just seemed superfluous.

@javaducky
Copy link
Contributor Author

./xk6 build \
  --with github.com/grafana/xk6-output-prometheus-remote \
  --with github.com/grafana/xk6-output-timescaledb \
  --output /tmp/my-k6

produces the following:
image

Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! just wondering if the extra information added isn't going to be more confusing then not.

cmd/xk6/main.go Outdated
fmt.Println("***************************************************")
fmt.Println("xk6 has now produced a new k6 binary with the following:")
for _, extension := range extensions {
fmt.Println(" -", extension.PackagePath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is necessary given that it was just provided as arguments. Especially as if replace and specific versions were used it might also be a bit confusing - not giving that information here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I was originally thinking to include version as well, but seemed like a potential rabbit-hole for little benefit. 😄

cmd/xk6/main.go Outdated Show resolved Hide resolved
cmd/xk6/main.go Outdated Show resolved Hide resolved
@javaducky
Copy link
Contributor Author

javaducky commented Mar 18, 2022

So @mstoykov @imiric, what if we only display a basic message if the --output is not provided to simply avoid confusion for the default k6 binary? That way, an "advanced user" can override settings and will know where the new binary is going to be, whereas a new user that is simply relying on defaults will have the warning that this is not the k6 that is on their system path.

For example:

NOTE: xk6 has now produced a new k6 binary in <current directoy>.

This _may_ be different than the k6 command on your system path.

This will simplify the "edge" cases, but hopefully not be more confusing 😆. For this, I'd add to logger at WARN level. WDYT?

@javaducky
Copy link
Contributor Author

How about this? (only if --output option is specified)

image

Turns out the summary is a slippery slope!
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I think this will still be helpful.

Although, it's the wrong suggestion on Windows. I think it will fail there...

EDIT: Nevermind, it works fine 🎉:
2022-03-18-142251_788x44_scrot

2nd although 😄: this warning is actually irrelevant on Windows, since all shells run binaries in the CWD first by default and then check the PATH, so plain k6 (no .\k6) will run the just built binary. Yeah, huge security risk, but that's Windows... 😅

@javaducky javaducky merged commit 9001905 into master Mar 18, 2022
@javaducky javaducky deleted the paul/post-build-message branch March 18, 2022 13:31
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

Successfully merging this pull request may close these issues.

None yet

3 participants