Skip to content

Commit cccbbbe

Browse files
authored
fix: resolve tests directory relative to cwd (#4713)
1 parent 6d101d3 commit cccbbbe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/db/test/test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ const (
2727
func Run(ctx context.Context, testFiles []string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error {
2828
// Build test command
2929
if len(testFiles) == 0 {
30-
testFiles = append(testFiles, utils.DbTestsDir)
30+
absTestsDir, err := filepath.Abs(utils.DbTestsDir)
31+
if err != nil {
32+
return errors.Errorf("failed to resolve tests dir: %w", err)
33+
}
34+
testFiles = append(testFiles, absTestsDir)
3135
}
3236
binds := make([]string, len(testFiles))
3337
cmd := []string{"pg_prove", "--ext", ".pg", "--ext", ".sql", "-r"}

0 commit comments

Comments
 (0)