diff --git a/Taskfile.yml b/Taskfile.yml index 6763eff..f75771f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -137,6 +137,7 @@ tasks: --kube-version ${K8S_VERSION} --setup-envtest-version ${SETUP_ENVTEST_VERSION} unit-test --src . + stdout sources: - ./**/*.go diff --git a/dagger/gotest/main.go b/dagger/gotest/main.go index 05801c4..5df1289 100644 --- a/dagger/gotest/main.go +++ b/dagger/gotest/main.go @@ -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", "./..."}) }