diff --git a/cmd/api.go b/cmd/api.go index 7e41e2c..b0d7b86 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "fmt" + "log/slog" "os" "path/filepath" "strings" @@ -350,6 +351,8 @@ func isCatalog(filename string) bool { func testAPI(paths []string, dir string) error { for _, name := range paths { + slog.Debug("Testing API", "path", name) + name = filepath.FromSlash(strings.TrimPrefix(name, "/")) name = filepath.Join(dir, name) diff --git a/cmd/k6registry/main.go b/cmd/k6registry/main.go index db126b1..94937bf 100644 --- a/cmd/k6registry/main.go +++ b/cmd/k6registry/main.go @@ -106,7 +106,7 @@ func getArgs() []string { if paths := getenv("INPUT_TEST", ""); len(paths) != 0 { parts, err := shlex.Split(paths) - if err != nil { + if err == nil { paths = strings.Join(parts, ",") } diff --git a/releases/v0.1.25.md b/releases/v0.1.25.md new file mode 100644 index 0000000..6359945 --- /dev/null +++ b/releases/v0.1.25.md @@ -0,0 +1,9 @@ +k6registry `v0.1.25` is here 🎉! + +This is an internal maintenance release. + +**Added testability of generated files** + +The generated registry and catalog will play an important role in the k6 binary provisioning subsystem, so it is important that there is no loss of service due to generated files. It is advisable to test the generated files to see if they meet the minimum requirements. + +The `--test` flag can be used to test registry and catalog files generated with the `--api` flag. The test is successful if the file is not empty, contains k6 and at least one extension, and if all extensions meet the minimum requirements (e.g. it has versions).