From 71013568ced03562ab0f2499838fdc27dc59371a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Tue, 19 Nov 2024 11:45:10 +0100 Subject: [PATCH 1/3] feat: update k6deps to v0.1.6 --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 232317e..b179152 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 ) diff --git a/go.sum b/go.sum index 0549300..4ae5681 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= @@ -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= From a7cf7a24f893a4043579d4ea7e59a4286d00798e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Tue, 19 Nov 2024 11:45:19 +0100 Subject: [PATCH 2/3] docs: release notes --- releases/v0.1.9.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releases/v0.1.9.md diff --git a/releases/v0.1.9.md b/releases/v0.1.9.md new file mode 100644 index 0000000..f5c60ee --- /dev/null +++ b/releases/v0.1.9.md @@ -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`) From 1190c3eccee3f9129c5a057e856e36f6a8f10d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Tue, 19 Nov 2024 11:45:51 +0100 Subject: [PATCH 3/3] docs: refactor examples to us xk6-sql v1.0.0 --- examples/combined.js | 8 ++++---- examples/sql.js | 25 +++++++++++++++++++++++++ examples/sqlite.js | 24 ------------------------ 3 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 examples/sql.js delete mode 100644 examples/sqlite.js diff --git a/examples/combined.js b/examples/combined.js index d293258..c6e337d 100644 --- a/examples/combined.js +++ b/examples/combined.js @@ -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(); }; diff --git a/examples/sql.js b/examples/sql.js new file mode 100644 index 0000000..3811831 --- /dev/null +++ b/examples/sql.js @@ -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}`); + } +} diff --git a/examples/sqlite.js b/examples/sqlite.js deleted file mode 100644 index c17f93e..0000000 --- a/examples/sqlite.js +++ /dev/null @@ -1,24 +0,0 @@ -// source: https://github.com/grafana/xk6-sql/blob/v0.4.0/examples/sqlite3_test.js -import sql from "k6/x/sql"; - -const db = sql.open("sqlite3", "./test.db"); - -export function setup() { - db.exec(`CREATE TABLE IF NOT EXISTS keyvalues ( - id integer PRIMARY KEY AUTOINCREMENT, - key varchar NOT NULL, - value varchar);`); -} - -export function teardown() { - db.close(); -} - -export default function () { - db.exec("INSERT INTO keyvalues (key, value) VALUES('plugin-name', 'k6-plugin-sql');"); - - let results = sql.query(db, "SELECT * FROM keyvalues WHERE key = $1;", "plugin-name"); - for (const row of results) { - console.log(`key: ${row.key}, value: ${row.value}`); - } -}