apko: fix go tests

This commit is contained in:
emilylange
2024-10-05 15:16:59 +02:00
parent 3900c97722
commit b4e2028211
+9 -4
View File
@@ -41,10 +41,15 @@ buildGoModule rec {
ldflags+=" -X sigs.k8s.io/release-utils/version.buildDate=$(cat SOURCE_DATE_EPOCH)"
'';
checkFlags = [
# fails to run on read-only filesystem
"-skip=(TestPublish|TestBuild|TestTarFS)"
];
preCheck = ''
# some tests require a writable HOME
export HOME=$(mktemp -d)
# some test data include SOURCE_DATE_EPOCH (which is different from our default)
# and the default version info which we get by unsetting our ldflags
export SOURCE_DATE_EPOCH=0
ldflags=
'';
postInstall = ''
installShellCompletion --cmd apko \