Skip to content

Commit

Permalink
Merge pull request #68 from grafana/fix-gh-actions-test-param
Browse files Browse the repository at this point in the history
fix: INPUT_TEST parameter handling in GitHub Action mode
  • Loading branch information
szkiba authored Sep 11, 2024
2 parents 7909c30 + 63cf5a4 commit 0d0c755
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"log/slog"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion cmd/k6registry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ",")
}

Expand Down
9 changes: 9 additions & 0 deletions releases/v0.1.25.md
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit 0d0c755

Please sign in to comment.