From 71d79ca188c30f7b7ba0b4cfec37cf66df444fa7 Mon Sep 17 00:00:00 2001 From: Ibrahim Umar Date: Thu, 29 Jan 2026 14:18:40 +0100 Subject: [PATCH 1/7] Update installation --- .gitignore | 12 ++ Makefile | 6 +- README.md | 25 +++ helpers/db2_cli_setup.go | 402 +++++++++++++++++++++++++++++++++++++++ make.linux.env | 8 +- make.osx.env | 8 +- make.win.env | 8 +- 7 files changed, 453 insertions(+), 16 deletions(-) create mode 100644 helpers/db2_cli_setup.go diff --git a/.gitignore b/.gitignore index 5ed2f93..eb4ead9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,13 @@ k6 +helpers/clidriver +helpers/*.tar.gz +helpers/*.zip + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Compiled Static libraries +*.a +*.lib \ No newline at end of file diff --git a/Makefile b/Makefile index 6c3ca3c..db2fafc 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ endef all: test build example xk6${ext}: - xk6${ext} -V + xk6${ext} -V || (echo "Please install xk6 or make sure it is available in your PATH"; exit 1) test: setup-db2 *.go testdata/*.js go test -count 1 ./... @@ -51,9 +51,7 @@ setup-container: $(call check_timeout, until docker exec db2test su - -c "db2 connect to SAMPLE" db2inst1) setup-db2: - curl -L https://raw.githubusercontent.com/ibmdb/go_ibm_db/refs/heads/master/installer/setup.go -o setup.go - -go run setup.go - rm -f setup.go + go run ./helpers/db2_cli_setup.go k6: xk6${ext} setup-db2 *.go go.mod go.sum xk6${ext} build -v --with github.com/grafana/xk6-sql@latest --with github.com/oleiade/xk6-encoding@latest --with github.com/iambaim/xk6-sql-driver-db2=. diff --git a/README.md b/README.md index 82b7a63..6ce6ae1 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,31 @@ export default function () { } ``` +## Building + +The included `Makefile` is the preferred way to build this extension. Just execute `make k6`. + +### Manual building step + +1. Download and extract DB2 CLI driver (available here: https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli). +2. Install `xk6`: + ``` + go install go.k6.io/xk6@latest + ``` +3. Set the environment variable, for example in Linux: + ``` + export IBM_DB_HOME= + export CGO_CFLAGS=-I${IBM_DB_HOME}/include + export CGO_LDFLAGS=-L${IBM_DB_HOME}/lib + export LD_LIBRARY_PATH=${IBM_DB_HOME}/lib + export XK6_RACE_DETECTOR=1 + export CGO_ENABLED=1 + ``` +4. Build this extension (we need encoding for query result texts): + ``` + xk6 build --with github.com/grafana/xk6-sql@latest --with github.com/oleiade/xk6-encoding@latest --with github.com/iambaim/xk6-sql-driver-db2=. + ``` + ## Usage Check the [xk6-sql documentation](https://github.com/grafana/xk6-sql) on how to use this database driver. diff --git a/helpers/db2_cli_setup.go b/helpers/db2_cli_setup.go new file mode 100644 index 0000000..001430c --- /dev/null +++ b/helpers/db2_cli_setup.go @@ -0,0 +1,402 @@ +//go:build exclude +// Adapted from https://github.com/ibmdb/go_ibm_db/blob/master/installer/setup.go + +package main + +import ( + "archive/zip" + "bufio" + "fmt" + "io" + "net/http" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" +) + +const ( + primaryURL = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/" + fallbackURL = "https://github.com/ibmdb/db2drivers/raw/main/clidriver/" +) + +func fileExists(path string) bool { + _, err := os.Stat(path) + return err == nil +} + +func dirExists(path string) bool { + info, err := os.Stat(path) + return err == nil && info.IsDir() +} + +func downloadFile(url string, filename string) error { + // Create HTTP GET request + resp, err := http.Get(url) + if err != nil { + return fmt.Errorf("Failed to fetch %s: %w", url, err) + } + defer resp.Body.Close() + + // Check for non-200 status + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("Failed to download %s: HTTP %d", url, resp.StatusCode) + } + + // Create destination file + out, err := os.Create("./helpers/" + filename) + if err != nil { + return fmt.Errorf("Failed to create file %s: %w", filename, err) + } + defer out.Close() + + // Copy data + _, err = io.Copy(out, resp.Body) + if err != nil { + return fmt.Errorf("Failed to save file %s: %w", filename, err) + } + + return nil +} + +func Unzipping(sourcefile string, targetDirectory string) { + reader, err := zip.OpenReader("./helpers/" + sourcefile) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + defer reader.Close() + for _, f := range reader.Reader.File { + zipped, err := f.Open() + if err != nil { + fmt.Println(err) + os.Exit(1) + } + defer zipped.Close() + path := filepath.Join(targetDirectory, f.Name) + if f.FileInfo().IsDir() { + os.MkdirAll(path, f.Mode()) + fmt.Println("Creating directory", path) + } else { + writer, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, f.Mode()) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + defer writer.Close() + if _, err = io.Copy(writer, zipped); err != nil { + fmt.Println(err) + os.Exit(1) + } + fmt.Println("Unzipping : ", path) + } + } +} + +func linux_untar(clidriver string, targetDirectory string, ibmdbDir string) error { + fmt.Printf("Extracting with tar -xzf %s -C %s", clidriver, targetDirectory) + out, err := exec.Command("tar", "xzf", "./helpers/" + clidriver, "-C", targetDirectory).Output() + + fmt.Println(string(out)) + if err != nil { + fmt.Println("Error while running tar: " + err.Error()) + return err + } else { + fmt.Println("Extracted clidriver path = " + targetDirectory + "/clidriver") + fmt.Println("\nNow run below commands:") + fmt.Println("export IBM_DB_HOME=" + targetDirectory + "/clidriver") + fmt.Println("source " + ibmdbDir + "/installer/setenv.sh") + } + + if runtime.GOOS == "darwin" { + // Create symlinks for libdb2 + _, _ = exec.Command("ln", "-s", targetDirectory + "/clidriver/lib/libdb2.dylib", targetDirectory + "/libdb2.dylib").Output() + _, _ = exec.Command("ln", "-s", targetDirectory + "/clidriver/lib/libdb2.dylib", ibmdbDir + "/libdb2.dylib").Output() + _, _ = exec.Command("ln", "-s", targetDirectory + "/clidriver/lib/libdb2.dylib", ibmdbDir + "/testdata/libdb2.dylib").Output() + } + + return nil +} + +func aix_untar(clidriver string, targetDirectory string) error { + fmt.Printf("Extracting with gunzip %s", clidriver) + gunzipOut, err := exec.Command("gunzip", "./helpers/"+clidriver).Output() + + fmt.Println(string(gunzipOut)) + if err != nil { + fmt.Println("Error while running gunzip: " + err.Error()) + return err + } + + clidriver = strings.TrimRight(clidriver, ".gz") + + fmt.Printf("Extracting with tar -xvf %s -C %s", clidriver, targetDirectory) + tarOut, err := exec.Command("tar", "xvf", "./helpers/"+clidriver, "-C", targetDirectory).Output() + + fmt.Println(string(tarOut)) + if err != nil { + fmt.Println("Error while running tar: " + err.Error()) + return err + } else { + fmt.Println("Extracted clidriver path = " + targetDirectory + "/clidriver") + fmt.Println("\nNow run below commands:") + fmt.Println("export IBM_DB_HOME=" + targetDirectory + "/clidriver") + fmt.Println("export CGO_CFLAGS==\"-I$IBM_DB_HOME/include\"") + fmt.Println("export CGO_LDFLAGS==\"-L$IBM_DB_HOME/lib\"") + } + + return nil +} + +func checkInstalledDriver(validateout string) bool { + var line string + + scanner := bufio.NewScanner(strings.NewReader(validateout)) + + for scanner.Scan() { + line = scanner.Text() + + if strings.Contains(line, "Install") { + fields := strings.Split(line, " ") + //fmt.Println(fields[7]) + input1 := fields[7][0:len(fields[7])] + fmt.Println("Found installed Db2 Client as", input1) + if checkIncludeDir(input1) { + fmt.Println("Please set IBM_DB_HOME to", input1) + return true + } + } + } + return false +} + +func checkIncludeDir(clidriver string) bool { + if dirExists(clidriver + "/include") { + //fmt.Println("clidriver/include folder exists in the path", clidriver) + if dirExists(clidriver + "/lib") { + //fmt.Println("clidriver/lib folder exists in the path", clidriver) + if fileExists(clidriver + "/include/sqlcli.h") { + return true + } else { + fmt.Println(clidriver + "/include/sqlcli.h file does not exist.") + } + } else { + fmt.Println(clidriver + "/lib directory does not exist.") + } + } else { + fmt.Println(clidriver + "/include directory does not exist.") + } + return false +} + +func main() { + var target, ibmdbDir, cliFileName, existingDriver string + var unpackageType int + var err11 error + var out []byte + + fmt.Println("os =",runtime.GOOS, ", processor =", runtime.GOARCH) + path, ok := os.LookupEnv("DB2HOME") + if ok { + fmt.Println("NOTE: Environment variable DB2HOME name is changed to IBM_DB_HOME.") + fmt.Println("DB2HOME environment variable is set to", path) + } + + out, err11 = exec.Command("db2cli", "validate").Output() + if err11 != nil { + // db2cli validate is not working, check for IBM_DB_HOME + ibmDBHome, found := os.LookupEnv("IBM_DB_HOME") + if !found || ibmDBHome == "" || !dirExists(ibmDBHome) { + // IBM_DB_HOME is not set + if runtime.GOOS == "windows" { + fmt.Println("Please set IBM_DB_HOME and add %IBM_DB_HOME%/bin to PATH and %IBM_DB_HOME%/lib to LIB environment variables after clidriver installation") + } else if runtime.GOOS == "aix" { + fmt.Println("Please set IBM_DB_HOME, CGO_CFLAGS, CGO_LDFLAGS and LIBPATH environment variables after clidriver installation") + } else if runtime.GOOS == "darwin" { + fmt.Println("Please set IBM_DB_HOME, CGO_CFLAGS, CGO_LDFLAGS and DYLD_LIBRARY_PATH environment variables after clidriver installation") + } else { + fmt.Println("Please set IBM_DB_HOME, CGO_CFLAGS, CGO_LDFLAGS and LD_LIBRARY_PATH environment variables after clidriver installation") + } + } else { + fmt.Println("IBM_DB_HOME is set to", ibmDBHome) + } + } else { + fmt.Println("db2cli validate command is working.") + ibmDBHome, found := os.LookupEnv("IBM_DB_HOME") + if !found || ibmDBHome == "" || !dirExists(ibmDBHome) { + // Check install path in validate output + if checkInstalledDriver(string(out)) { + os.Exit(0) + } + } else { + fmt.Println("IBM_DB_HOME =", ibmDBHome) + if checkIncludeDir(ibmDBHome) { + fmt.Println("IBM_DB_HOME is set and directory exists. Skipping download.") + os.Exit(0) + } + } + } + + _, setupFile, _, ok := runtime.Caller(0) + if ok { + ibmdbDir = filepath.Dir(setupFile) + } else { + ibmdbDir = "./" + } + target = ibmdbDir + ibmdbDir, _ = filepath.Abs(ibmdbDir) + target, _ = filepath.Abs(target) + + if len(os.Args) == 2 { + target = os.Args[1] + } + existingDriver, _ = filepath.Abs(target + "/clidriver") + + if dirExists(existingDriver) { + fmt.Println("Detected existing directory \"" + existingDriver + "\"") + + if checkIncludeDir(existingDriver) { + fmt.Println("==> Skipping clidriver download.") + os.Exit(0) + } else { + // Attempt to remove the directory and its contents + err2 := os.RemoveAll(existingDriver) + if err2 != nil { + fmt.Printf("Error deleting directory '%s': %v\n", existingDriver, err2) + } else { + fmt.Printf("Directory '%s' and its contents successfully deleted.\n", existingDriver) + } + fmt.Println("==> Installing clidriver ...") + } + } + + if runtime.GOOS == "windows" { + unpackageType = 1 + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "ntx64_odbc_cli.zip" + } else { + cliFileName = "nt32_odbc_cli.zip" + } + } else if runtime.GOOS == "linux" { + unpackageType = 2 + if runtime.GOARCH == "ppc64le" { + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "ppc64le_odbc_cli.tar.gz" + } + } else if runtime.GOARCH == "ppc" { + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "ppc64_odbc_cli.tar.gz" + } else { + cliFileName = "ppc32_odbc_cli.tar.gz" + } + } else if runtime.GOARCH == "amd64" { + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "linuxx64_odbc_cli.tar.gz" + } else { + cliFileName = "linuxia32_odbc_cli.tar.gz" + } + } else if runtime.GOARCH == "s390x" { + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "s390x64_odbc_cli.tar.gz" + } else { + cliFileName = "s390_odbc_cli.tar.gz" + } + } + } else if runtime.GOOS == "aix" { + unpackageType = 3 + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "aix64_odbc_cli.tar.gz" + } else { + cliFileName = "aix32_odbc_cli.tar.gz" + } + } else if runtime.GOOS == "sunos" { + unpackageType = 2 + if runtime.GOARCH == "i86pc" { + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "sunamd64_odbc_cli.tar.gz" + } else { + cliFileName = "sunamd32_odbc_cli.tar.gz" + } + } else if runtime.GOARCH == "SUNW" { + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + cliFileName = "sun64_odbc_cli.tar.gz" + } else { + cliFileName = "sun32_odbc_cli.tar.gz" + } + } + } else if runtime.GOOS == "darwin" { + unpackageType = 2 + const wordsize = 32 << (^uint(0) >> 32 & 1) + if wordsize == 64 { + if runtime.GOARCH == "arm64" { + cliFileName = "macarm64_odbc_cli.tar.gz" + } else { + cliFileName = "macos64_odbc_cli.tar.gz" + } + } + } else { + fmt.Println("Error: Unsupported platform!") + os.Exit(3) + } + fileUrl := getDownloadUrl(cliFileName) + fmt.Println("Downloading " + fileUrl) + + // Try primary + err := downloadFile(fileUrl, cliFileName) + if err != nil { + fmt.Println("Error:", err) + // Try fallback if IBM_DB_DOWNLOAD_URL is not set. + downloadUrl, downloadUrlFound := os.LookupEnv("IBM_DB_DOWNLOAD_URL") + if !downloadUrlFound || downloadUrl == "" { + fmt.Println("Trying fallback URL...") + newUrl := strings.ReplaceAll(fileUrl, primaryURL, fallbackURL) + err = downloadFile(newUrl, cliFileName) + if err != nil { + fmt.Println("Fallback download failed:", err) + fmt.Println("Error while downloading file: " + err.Error()) + os.Exit(4) + } + } else { + os.Exit(5) + } + } + fmt.Println("Download completed.") + + if unpackageType == 1 { + Unzipping(cliFileName, target) + } else if unpackageType == 3 { + aix_untar(cliFileName, target) + } else { + linux_untar(cliFileName, target, ibmdbDir) + } +} + +func getDownloadUrl(cliFileName string) string { + downloadUrl, downloadUrlFound := os.LookupEnv("IBM_DB_DOWNLOAD_URL") + if !downloadUrlFound || downloadUrl == "" { + clidriverVersion, ok := os.LookupEnv("CLIDRIVER_DOWNLOAD_VERSION") + if ok && clidriverVersion != "" { + if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" && strings.HasPrefix(strings.ToLower(clidriverVersion), "v11") { + downloadUrl = primaryURL + cliFileName + } else if runtime.GOOS == "darwin" && runtime.GOARCH != "arm64" && strings.HasPrefix(strings.ToLower(clidriverVersion), "v12") { + downloadUrl = primaryURL + cliFileName + } else { + downloadUrl = primaryURL + clidriverVersion + "/" + cliFileName + } + } else { + downloadUrl = primaryURL + cliFileName + } + } else { + fmt.Println("IBM_DB_DOWNLOAD_URL is set to", downloadUrl) + } + return downloadUrl +} \ No newline at end of file diff --git a/make.linux.env b/make.linux.env index cf65c1f..c9f0dc7 100644 --- a/make.linux.env +++ b/make.linux.env @@ -1,6 +1,6 @@ -IBM_DB_HOME=${PWD}/../../clidriver -CGO_CFLAGS=-I${PWD}/../../clidriver/include -CGO_LDFLAGS=-L${PWD}/../../clidriver/lib -LD_LIBRARY_PATH=${PWD}/../../clidriver/lib +IBM_DB_HOME=./helpers/clidriver +CGO_CFLAGS=-I./helpers/clidriver/include +CGO_LDFLAGS=-L./helpers/clidriver/lib +LD_LIBRARY_PATH=./helpers/clidriver/lib XK6_RACE_DETECTOR=1 CGO_ENABLED=1 \ No newline at end of file diff --git a/make.osx.env b/make.osx.env index ae2d78e..0c66be7 100644 --- a/make.osx.env +++ b/make.osx.env @@ -1,6 +1,6 @@ -IBM_DB_HOME=${PWD}/../../clidriver -CGO_CFLAGS=-I${PWD}/../../clidriver/include -CGO_LDFLAGS=-L${PWD}/../../clidriver/lib -DYLD_LIBRARY_PATH=${PWD}/../../clidriver/lib +IBM_DB_HOME=./helpers/clidriver +CGO_CFLAGS=-I${PWD}/helpers/clidriver/include +CGO_LDFLAGS=-L${PWD}/helpers/clidriver/lib +DYLD_LIBRARY_PATH=${PWD}/helpers/clidriver/lib XK6_RACE_DETECTOR=1 CGO_ENABLED=1 \ No newline at end of file diff --git a/make.win.env b/make.win.env index 5bd495e..389de29 100644 --- a/make.win.env +++ b/make.win.env @@ -1,6 +1,6 @@ -IBM_DB_HOME=${PWD}/../../clidriver -LIB=${PWD}/../../clidriver/bin -CGO_CFLAGS=-I${PWD}/../../clidriver/include -CGO_LDFLAGS=-L${PWD}/../../clidriver/lib +IBM_DB_HOME=./helpers/clidriver +LIB=./helpers/clidriver/bin +CGO_CFLAGS=-I./helpers/clidriver/include +CGO_LDFLAGS=-L./helpers/clidriver/lib XK6_RACE_DETECTOR=1 CGO_ENABLED=1 \ No newline at end of file From b35d64562550f201a9c8f4453b59070edf410610 Mon Sep 17 00:00:00 2001 From: Ibrahim Umar Date: Thu, 29 Jan 2026 14:21:45 +0100 Subject: [PATCH 2/7] Debug --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index db2fafc..e57130c 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ setup-db2: go run ./helpers/db2_cli_setup.go k6: xk6${ext} setup-db2 *.go go.mod go.sum + ls ./helpers xk6${ext} build -v --with github.com/grafana/xk6-sql@latest --with github.com/oleiade/xk6-encoding@latest --with github.com/iambaim/xk6-sql-driver-db2=. example: k6 setup-container From 0341bc5c87a3fa8a343f82a2d2301a3d7cee15b2 Mon Sep 17 00:00:00 2001 From: Ibrahim Umar Date: Thu, 29 Jan 2026 14:23:24 +0100 Subject: [PATCH 3/7] Debug --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e57130c..2562da8 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ setup-db2: go run ./helpers/db2_cli_setup.go k6: xk6${ext} setup-db2 *.go go.mod go.sum - ls ./helpers + find ./helpers xk6${ext} build -v --with github.com/grafana/xk6-sql@latest --with github.com/oleiade/xk6-encoding@latest --with github.com/iambaim/xk6-sql-driver-db2=. example: k6 setup-container From 6347aebcf457579b00fcf38d010a9ba5d8c6071b Mon Sep 17 00:00:00 2001 From: Ibrahim Umar Date: Thu, 29 Jan 2026 14:27:01 +0100 Subject: [PATCH 4/7] Enable all OS --- .github/workflows/ci.yml | 3 ++- make.linux.env | 8 ++++---- make.osx.env | 2 +- make.win.env | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec9cba1..e7e47e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: build-with-xk6: strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -36,5 +36,6 @@ jobs: shell: bash - name: Test + if: matrix.os == 'ubuntu-latest' run: make container-test shell: bash \ No newline at end of file diff --git a/make.linux.env b/make.linux.env index c9f0dc7..c16a701 100644 --- a/make.linux.env +++ b/make.linux.env @@ -1,6 +1,6 @@ -IBM_DB_HOME=./helpers/clidriver -CGO_CFLAGS=-I./helpers/clidriver/include -CGO_LDFLAGS=-L./helpers/clidriver/lib -LD_LIBRARY_PATH=./helpers/clidriver/lib +IBM_DB_HOME=${PWD}/helpers/clidriver +CGO_CFLAGS=-I${PWD}/helpers/clidriver/include +CGO_LDFLAGS=-L${PWD}/helpers/clidriver/lib +LD_LIBRARY_PATH=${PWD}/helpers/clidriver/lib XK6_RACE_DETECTOR=1 CGO_ENABLED=1 \ No newline at end of file diff --git a/make.osx.env b/make.osx.env index 0c66be7..ad16cea 100644 --- a/make.osx.env +++ b/make.osx.env @@ -1,4 +1,4 @@ -IBM_DB_HOME=./helpers/clidriver +IBM_DB_HOME=${PWD}/helpers/clidriver CGO_CFLAGS=-I${PWD}/helpers/clidriver/include CGO_LDFLAGS=-L${PWD}/helpers/clidriver/lib DYLD_LIBRARY_PATH=${PWD}/helpers/clidriver/lib diff --git a/make.win.env b/make.win.env index 389de29..1ee5e70 100644 --- a/make.win.env +++ b/make.win.env @@ -1,6 +1,6 @@ -IBM_DB_HOME=./helpers/clidriver -LIB=./helpers/clidriver/bin -CGO_CFLAGS=-I./helpers/clidriver/include -CGO_LDFLAGS=-L./helpers/clidriver/lib +IBM_DB_HOME=${PWD}/helpers/clidriver +LIB=${PWD}/helpers/clidriver/bin +CGO_CFLAGS=-I${PWD}/helpers/clidriver/include +CGO_LDFLAGS=-L${PWD}/helpers/clidriver/lib XK6_RACE_DETECTOR=1 CGO_ENABLED=1 \ No newline at end of file From b9c126b99fade32d0bbd7ce904bdc91a83980154 Mon Sep 17 00:00:00 2001 From: Ibrahim Umar Date: Thu, 29 Jan 2026 14:29:06 +0100 Subject: [PATCH 5/7] Disable windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7e47e2..338373d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: build-with-xk6: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout code From d6953075d83e1b37f3cf81abfc94eeca62d0aa9c Mon Sep 17 00:00:00 2001 From: Ibrahim Umar Date: Thu, 29 Jan 2026 14:35:29 +0100 Subject: [PATCH 6/7] Enable windows --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 338373d..48e0e49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: build-with-xk6: strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -31,11 +31,15 @@ jobs: with: xk6-version: "1.3.1" + - name: Install Make + if: runner.os == 'Windows' + run: choco install make -y + - name: Build run: make build shell: bash - name: Test - if: matrix.os == 'ubuntu-latest' + if: runner.os == 'Linux' run: make container-test shell: bash \ No newline at end of file From cd27a443bafc8b6ada39c501addd5a9e27cbe12d Mon Sep 17 00:00:00 2001 From: Ibrahim Umar Date: Thu, 29 Jan 2026 14:42:19 +0100 Subject: [PATCH 7/7] Disable Windows build for now --- .github/workflows/ci.yml | 6 +----- Makefile | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48e0e49..0ef6b80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: build-with-xk6: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -31,10 +31,6 @@ jobs: with: xk6-version: "1.3.1" - - name: Install Make - if: runner.os == 'Windows' - run: choco install make -y - - name: Build run: make build shell: bash diff --git a/Makefile b/Makefile index 2562da8..db2fafc 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,6 @@ setup-db2: go run ./helpers/db2_cli_setup.go k6: xk6${ext} setup-db2 *.go go.mod go.sum - find ./helpers xk6${ext} build -v --with github.com/grafana/xk6-sql@latest --with github.com/oleiade/xk6-encoding@latest --with github.com/iambaim/xk6-sql-driver-db2=. example: k6 setup-container