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

Update Windows commands #1582

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update Windows commands #1582

wants to merge 1 commit into from

Conversation

sabi0
Copy link

@sabi0 sabi0 commented May 8, 2024

What?

The k6 executable from the latest .msi installer says it does not know the init parameter:

C:\>k6 init
ERRO[0000] unknown command "init" for "k6.exe"

I suppose new should be used instead, like on Linux.

Also I changed Windows commands to run k6 executable directly instead of via Docker.

Checklist

  • I have used a meaningful title for the PR.
  • I have described the changes I've made in the "What?" section above.
  • I have performed a self-review of my changes.
  • I have run the npm start command locally and verified that the changes look good.
  • I have made my changes in the docs/sources/next folder of the documentation.
  • I have reflected my changes in the docs/sources/v{most_recent_release} folder of the documentation.
  • I have reflected my changes in the relevant folders of the two previous k6 versions of the documentation (if still applicable to previous versions).

Related PR(s)/Issue(s)

1. The k6 executable from the latest .msi installer says it does not know the `init` parameter:
```
C:\>k6 init
ERRO[0000] unknown command "init" for "k6.exe"
```
I suppose `new` should be used instead, like on Linux.

Also I changed Windows commands to run k6 executable directly instead of via Docker.
@sabi0 sabi0 requested a review from heitortsergent as a code owner May 8, 2024 11:17
@CLAassistant
Copy link

CLAassistant commented May 8, 2024

CLA assistant check
All committers have signed the CLA.

@PontusMagnusson
Copy link

PontusMagnusson commented May 21, 2024

I encountered the same issue, but I cannot use k6 new if I've installed via winget. It would probably require configuring the PATH environment variable, but that is not reflected in the documentation.

Running docker run --rm -i -v ${PWD}:/app -w /app grafana/k6 new works though.

Copy link
Collaborator

@heitortsergent heitortsergent left a comment

Choose a reason for hiding this comment

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

@sabi0 thanks for the opening the PR, and sorry about the delay!

Based on @PontusMagnusson feedback, it seems that keeping the Docker commands for now would help most users, I left some comments to revert that and just changing the init command to new.

@@ -37,7 +37,7 @@ To run a simple local script:
```

```windows
PS C:\> docker run --rm -i -v ${PWD}:/app -w /app grafana/k6 init
PS C:\> k6 new
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
PS C:\> k6 new
PS C:\> docker run --rm -i -v ${PWD}:/app -w /app grafana/k6 new

@@ -64,7 +64,7 @@ To run a simple local script:
```

```windows
PS C:\> cat script.js | docker run --rm -i grafana/k6 run -
PS C:\> k6 run script.js
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
PS C:\> k6 run script.js
PS C:\> cat script.js | docker run --rm -i grafana/k6 run -

@@ -84,7 +84,7 @@ $ docker run --rm -i grafana/k6 run --vus 10 --duration 30s - <script.js
```

```windows
PS C:\> cat script.js | docker run --rm -i grafana/k6 run --vus 10 --duration 30s -
PS C:\> k6 run --vus 10 --duration 30s script.js
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
PS C:\> k6 run --vus 10 --duration 30s script.js
PS C:\> cat script.js | docker run --rm -i grafana/k6 run --vus 10 --duration 30s -

@@ -155,7 +155,7 @@ $ docker run --rm -i grafana/k6 run - <script.js
```

```windows
PS C:\> cat script.js | docker run --rm -i grafana/k6 run -
PS C:\> k6 run script.js
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
PS C:\> k6 run script.js
PS C:\> cat script.js | docker run --rm -i grafana/k6 run -

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.

4 participants