From d95aa21755dad5b2fb72893741bcfe8367c1db89 Mon Sep 17 00:00:00 2001 From: Flamki <9833ayush@gmail.com> Date: Tue, 10 Feb 2026 22:24:36 +0530 Subject: [PATCH 1/2] Fix pgTAP single-file working dir --- internal/db/test/test.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/internal/db/test/test.go b/internal/db/test/test.go index 2852ee943..d15e20585 100644 --- a/internal/db/test/test.go +++ b/internal/db/test/test.go @@ -7,6 +7,7 @@ import ( "os" "path" "path/filepath" + "sort" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" @@ -34,7 +35,7 @@ func Run(ctx context.Context, testFiles []string, config pgconn.Config, fsys afe } testFiles = append(testFiles, absTestsDir) } - binds := make([]string, len(testFiles)) + bindsSet := map[string]struct{}{} cmd := []string{"pg_prove", "--ext", ".pg", "--ext", ".sql", "-r"} var workingDir string for i, fp := range testFiles { @@ -43,14 +44,24 @@ func Run(ctx context.Context, testFiles []string, config pgconn.Config, fsys afe } dockerPath := utils.ToDockerPath(fp) cmd = append(cmd, dockerPath) - binds[i] = fmt.Sprintf("%s:%s:ro", fp, dockerPath) + + hostDir := fp + dockerDir := dockerPath + if path.Ext(dockerPath) != "" { + hostDir = filepath.Dir(fp) + dockerDir = path.Dir(dockerPath) + } + bindsSet[fmt.Sprintf("%s:%s:ro", hostDir, dockerDir)] = struct{}{} + if workingDir == "" { - workingDir = dockerPath - if path.Ext(dockerPath) != "" { - workingDir = path.Dir(dockerPath) - } + workingDir = dockerDir } } + binds := make([]string, 0, len(bindsSet)) + for b := range bindsSet { + binds = append(binds, b) + } + sort.Strings(binds) if viper.GetBool("DEBUG") { cmd = append(cmd, "--verbose") } From 232bd58c38e58ed47030f75280d05d25f48f9a55 Mon Sep 17 00:00:00 2001 From: Flamki <9833ayush@gmail.com> Date: Tue, 10 Feb 2026 22:34:08 +0530 Subject: [PATCH 2/2] Fix unused index in pgTAP runner --- internal/db/test/test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/db/test/test.go b/internal/db/test/test.go index d15e20585..97f9fb17f 100644 --- a/internal/db/test/test.go +++ b/internal/db/test/test.go @@ -38,7 +38,7 @@ func Run(ctx context.Context, testFiles []string, config pgconn.Config, fsys afe bindsSet := map[string]struct{}{} cmd := []string{"pg_prove", "--ext", ".pg", "--ext", ".sql", "-r"} var workingDir string - for i, fp := range testFiles { + for _, fp := range testFiles { if !filepath.IsAbs(fp) { fp = filepath.Join(utils.CurrentDirAbs, fp) }