fix(ci): show test output on failures

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
Leonardo Cecchi 2025-08-07 12:14:46 +02:00
parent b2645827b8
commit 39c14d2ebe
2 changed files with 3 additions and 4 deletions

View File

@ -137,6 +137,7 @@ tasks:
--kube-version ${K8S_VERSION}
--setup-envtest-version ${SETUP_ENVTEST_VERSION}
unit-test --src .
stdout
sources:
- ./**/*.go

View File

@ -15,7 +15,6 @@
package main
import (
"context"
"fmt"
"dagger/gotest/internal/dagger"
@ -78,11 +77,10 @@ func New(
}
func (m *Gotest) UnitTest(
ctx context.Context,
// Source directory
// +required
src *dagger.Directory,
) (string, error) {
) *dagger.Container {
envtestCmd := []string{"setup-envtest", "use", "-p", "path", m.KubeVersion}
return m.Ctr.WithDirectory("/src", src).
// Setup envtest. There is no proper way to install it from a git release, so we use the go install command
@ -93,5 +91,5 @@ func (m *Gotest) UnitTest(
WithWorkdir("/src").
// Exclude the e2e tests, we don't want to run them here
WithoutDirectory("/src/test/e2e").
WithExec([]string{"go", "test", "./..."}).Stdout(ctx)
WithExec([]string{"go", "test", "./..."})
}