Skip to content

Commit

Permalink
Merge pull request #56 from grafana/update-k6deps-to-v0.1.6
Browse files Browse the repository at this point in the history
Update k6deps to v0.1.6
  • Loading branch information
szkiba authored Nov 19, 2024
2 parents 28584d8 + 1190c3e commit 36784ff
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 40 deletions.
8 changes: 4 additions & 4 deletions examples/combined.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use k6 = 0.52";
"use k6 with k6/x/faker >= 0.3.0";
"use k6 with k6/x/sql >= 0.4.0";
"use k6 with k6/x/sql >= 1.0.0";

import faker from "./faker.js";
import sqlite from "./sqlite.js";
import sql from "./sql.js";

export { setup, teardown } from "./sqlite.js";
export { setup, teardown } from "./sql.js";

export default () => {
faker();
sqlite();
sql();
};
25 changes: 25 additions & 0 deletions examples/sql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// source: https://github.com/grafana/xk6-sql/blob/v0.4.0/examples/sqlite3_test.js
import sql from "k6/x/sql";
import driver from "k6/x/sql/driver/ramsql";

const db = sql.open(driver);

export function setup() {
db.exec(`CREATE TABLE IF NOT EXISTS namevalues (
id integer PRIMARY KEY AUTOINCREMENT,
name varchar NOT NULL,
value varchar);`);
}

export function teardown() {
db.close();
}

export default function () {
db.exec("INSERT INTO namevalues (name, value) VALUES('plugin-name', 'k6-plugin-sql');");

let results = db.query("SELECT * FROM namevalues WHERE name = $1;", "plugin-name");
for (const row of results) {
console.log(`name: ${row.name}, value: ${row.value}`);
}
}
24 changes: 0 additions & 24 deletions examples/sqlite.js

This file was deleted.

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ require (
github.com/adrg/xdg v0.5.3
github.com/grafana/clireadme v0.1.0
github.com/grafana/k6build v0.3.3
github.com/grafana/k6deps v0.1.5
github.com/grafana/k6deps v0.1.6
github.com/grafana/k6pack v0.2.2
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/samber/slog-logrus/v2 v2.5.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.9.0
golang.org/x/term v0.25.0
golang.org/x/term v0.26.0
)

require (
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanw/esbuild v0.23.1 // indirect
github.com/evanw/esbuild v0.24.0 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/grafana/k6catalog v0.2.3 // indirect
github.com/grafana/k6foundry v0.3.0 // indirect
Expand All @@ -30,7 +30,7 @@ require (
github.com/samber/slog-common v0.17.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/evanw/esbuild v0.23.1 h1:ociewhY6arjTarKLdrXfDTgy25oxhTZmzP8pfuBTfTA=
github.com/evanw/esbuild v0.23.1/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
github.com/evanw/esbuild v0.24.0 h1:GZ78naTLp7FKr+K7eNuM/SLs5maeiHYRPsTg6kmdsSE=
github.com/evanw/esbuild v0.24.0/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
Expand All @@ -18,8 +18,8 @@ github.com/grafana/k6build v0.3.3 h1:U6TgF6QIIFH5g0DAPVTxqO+fUSINgBBym41qFzW3+uI
github.com/grafana/k6build v0.3.3/go.mod h1:9e3IPYKatismMUV3Oq0V7auStNxoiVuiuk2uZrmRqhg=
github.com/grafana/k6catalog v0.2.3 h1:Gol46qra9yjPYSrxLj6CDKcdY/DUEprM4Xd4TCNPkfA=
github.com/grafana/k6catalog v0.2.3/go.mod h1:ozCf9+KBw63lNrRiZtp7CvzA7V0ATQuOQN2IoG2irw4=
github.com/grafana/k6deps v0.1.5 h1:UYp61ez7MbW6v9aKvsuvK9a7Ym6+1iPvzuqrJOne7Dg=
github.com/grafana/k6deps v0.1.5/go.mod h1:FJFn19VjeiPQq1hlYY39uChetg8H2rwFrqvOZR8AGOo=
github.com/grafana/k6deps v0.1.6 h1:g232iZWiXKasbnqUn9kh5AiMG6FLpc1Fa1T53AM+GEw=
github.com/grafana/k6deps v0.1.6/go.mod h1:/6jmPWr08dTiHGFOgV8sdnF/eVyeBg19C3omUj+4TEM=
github.com/grafana/k6foundry v0.3.0 h1:C+6dPbsOv7Uq4hEhBFNuYqmTdE9jQ0VqhXqBDtMkVTE=
github.com/grafana/k6foundry v0.3.0/go.mod h1:/NtBSQQgXup5SVbfInl0Q8zKVx08xgvXIZ0xncqexEs=
github.com/grafana/k6pack v0.2.2 h1:ynppjxOhLH6nuPe1O/I9qmWbcRusYA+D13OXWjLg5xE=
Expand Down Expand Up @@ -58,10 +58,10 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=
golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
Expand Down
5 changes: 5 additions & 0 deletions releases/v0.1.9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
k6exec `v0.1.9` is here 🎉!

This release includes:

- Update k6deps to v0.1.6: Support import path of arbitrary depth (deeper than three levels) (eg `k6/x/foo/bar`). Drivers of the `xk6-sql` extension use 5-level deep imports (eg `k6/x/sql/driver/ramsql`)

0 comments on commit 36784ff

Please sign in to comment.