Skip to content

Commit

Permalink
move release tests to separate pkg
Browse files Browse the repository at this point in the history
exclude it from 'just test' as we do not want to run it outside
of one of the target envs

add a build-test-release recipe in the justfile to build the
testing executable

Signed-off-by: Emanuele Di Pascale <[email protected]>
  • Loading branch information
edipascale committed Jan 23, 2025
1 parent 7daf548 commit 6b55803
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 61 deletions.
2 changes: 1 addition & 1 deletion hack/tools.just
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ lint-gha: _actionlint

# Run tests
test path="./...": gen _envtest _gcov2lcov
KUBEBUILDER_ASSETS=`{{envtest}} use {{envtest_k8s_version}} --bin-dir {{localbinpath}} -p path` go test {{go_flags}} `go list {{path}} | grep -v /e2e` -coverprofile cover.out
KUBEBUILDER_ASSETS=`{{envtest}} use {{envtest_k8s_version}} --bin-dir {{localbinpath}} -p path` go test {{go_flags}} `go list {{path}} | grep -v -e /e2e -e /test/release` -coverprofile cover.out
{{gcov2lcov}} -infile cover.out -outfile lcov.info

#
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ oem_dir := "./pkg/embed/flatcaroem"
go_flags := "--tags containers_image_openpgp,containers_image_storage_stub -ldflags=\"-w -s -X go.githedgehog.com/fabricator/pkg/version.Version=" + version + "\""
go_build := "go build " + go_flags
go_linux_build := "GOOS=linux GOARCH=amd64 " + go_build
go_test := "go test " + go_flags

_touch_embed:
@touch ./pkg/embed/recipebin/hhfab-recipe.gz
Expand Down Expand Up @@ -164,3 +165,7 @@ zot := localbin / "zot" + "-" + zot_os + "-" + zot_arch + "-" + zot_version
_localreg: _zot
./hack/localreg.sh
{{zot}} serve .zot/config.json 2>&1 | tee .zot/log

# Build binary which runs the release test (excluded from "just test")
build-test-release:
{{go_test}} -c -o bin/test-release ./test/release
Loading

0 comments on commit 6b55803

Please sign in to comment.