Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions internal/endtoend/endtoend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"os"
osexec "os/exec"
"path/filepath"
"strings"
"testing"
Expand Down Expand Up @@ -102,6 +103,13 @@ func TestReplay(t *testing.T) {
args := parseExec(t, path)
expected := expectedStderr(t, path)

if args.Process != "" {
_, err := osexec.LookPath(args.Process)
if err != nil {
t.Skipf("executable not found: %s %s", args.Process, err)
}
}

switch args.Command {
case "diff":
err = cmd.Diff(ctx, cmd.Env{ExperimentalFeatures: true}, path, "", &stderr)
Expand Down Expand Up @@ -144,6 +152,9 @@ func cmpDirectory(t *testing.T, dir string, actual map[string]string) {
if filepath.Base(path) == "sqlc.json" {
return nil
}
if filepath.Base(path) == "exec.json" {
return nil
}
if strings.Contains(path, "/kotlin/build") {
return nil
}
Expand Down Expand Up @@ -199,6 +210,7 @@ func expectedStderr(t *testing.T, dir string) string {

type exec struct {
Command string `json:"command"`
Process string `json:"process"`
}

func parseExec(t *testing.T, dir string) exec {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"process": "sqlc-gen-json"
}