Skip to content

Commit

Permalink
Fix README's examples
Browse files Browse the repository at this point in the history
The README examples kept referencing `github.com/k6io/xk6-sql`
as the extension to build against. However, this repository does
not exist anymore, and made the README inaccurate. To address it,
this commit makes the examples point to `github.com/grafana/xk6-browser`
instead.
  • Loading branch information
oleiade committed Nov 23, 2021
1 parent 153b991 commit 24e2476
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,36 +47,40 @@ $ xk6 build [<k6_version>]

- `<k6_version>` is the core k6 version to build; defaults to `K6_VERSION` env variable or latest.
- `--output` changes the output file.
<<<<<<< HEAD
- `--with` can be used multiple times to add extensions by specifying the Go module name and optionally its version, similar to `go get`. Module name is required, but specific version and/or local replacement are optional.
=======
- `--with` can be used multiple times to add extensions by specifying the Go module name and optionally its version, similar to `go get`. Module name is required, but specific version and/or local replacement are optional. For an up-to-date list of k6 extensions, head to our documentation's [extensions page](https://k6.io/docs/extensions/).
>>>>>>> 35d8e0f... RFR
- `--replace` can be used multiple times to add replacements by specifying the Go module name and the replacement module, similar to `go mod edit -replace=`. Version of the replacement can be specified with the `@version` suffix in the replacement path.

Examples:

```bash
$ xk6 build \
--with github.com/k6io/xk6-sql
--with github.com/grafana/xk6-browser

$ xk6 build v0.29.0 \
--with github.com/k6io/xk6-sql@v0.0.1
$ xk6 build v0.35.0 \
--with github.com/grafana/xk6-browser@v0.1.1

$ xk6 build \
--with github.com/k6io/xk6-sql=../../my-fork
--with github.com/grafana/xk6-browser=../../my-fork

$ xk6 build \
--with github.com/k6io/xk6-sql=.
--with github.com/grafana/xk6-browser=.

$ xk6 build \
--with github.com/k6io/xk6-sql@v0.0.1=../../my-fork
--with github.com/grafana/xk6-browser@v0.1.1=../../my-fork

# Build using a k6 fork repository. Note that a version is required if
# XK6_K6_REPO is a URI.
$ XK6_K6_REPO=github.com/example/k6 xk6 build master \
--with github.com/k6io/xk6-sql
--with github.com/grafana/xk6-browser

# Build using a k6 fork repository from a local path. The version must be omitted
# and the path must be absolute.
$ XK6_K6_REPO="$PWD/../../k6" xk6 build \
--with github.com/k6io/xk6-sql
--with github.com/grafana/xk6-browser
```

### For extension development
Expand Down Expand Up @@ -110,11 +114,11 @@ The race detector can be enabled by setting `XK6_RACE_DETECTOR=1`.

```go
builder := xk6.Builder{
k6Version: "v0.29.0",
k6Version: "v0.35.0",
Extensions: []xk6.Dependency{
{
ModulePath: "github.com/k6io/xk6-sql",
Version: "v0.0.1",
ModulePath: "github.com/grafana/xk6-browser",
Version: "v0.1.1",
},
},
}
Expand Down

0 comments on commit 24e2476

Please sign in to comment.