mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-11 13:23:09 +01:00
fix(ci): show test output on failures (#461)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
parent
b2645827b8
commit
3a770798c7
@ -137,6 +137,7 @@ tasks:
|
|||||||
--kube-version ${K8S_VERSION}
|
--kube-version ${K8S_VERSION}
|
||||||
--setup-envtest-version ${SETUP_ENVTEST_VERSION}
|
--setup-envtest-version ${SETUP_ENVTEST_VERSION}
|
||||||
unit-test --src .
|
unit-test --src .
|
||||||
|
stdout
|
||||||
sources:
|
sources:
|
||||||
- ./**/*.go
|
- ./**/*.go
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"dagger/gotest/internal/dagger"
|
"dagger/gotest/internal/dagger"
|
||||||
@ -78,11 +77,10 @@ func New(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Gotest) UnitTest(
|
func (m *Gotest) UnitTest(
|
||||||
ctx context.Context,
|
|
||||||
// Source directory
|
// Source directory
|
||||||
// +required
|
// +required
|
||||||
src *dagger.Directory,
|
src *dagger.Directory,
|
||||||
) (string, error) {
|
) *dagger.Container {
|
||||||
envtestCmd := []string{"setup-envtest", "use", "-p", "path", m.KubeVersion}
|
envtestCmd := []string{"setup-envtest", "use", "-p", "path", m.KubeVersion}
|
||||||
return m.Ctr.WithDirectory("/src", src).
|
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
|
// 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").
|
WithWorkdir("/src").
|
||||||
// Exclude the e2e tests, we don't want to run them here
|
// Exclude the e2e tests, we don't want to run them here
|
||||||
WithoutDirectory("/src/test/e2e").
|
WithoutDirectory("/src/test/e2e").
|
||||||
WithExec([]string{"go", "test", "./..."}).Stdout(ctx)
|
WithExec([]string{"go", "test", "./..."})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user