Update test of examples against new releases.

This commit is contained in:
jregan
2020-12-10 12:31:14 -08:00
parent 826b5d9792
commit 97e4353755
2 changed files with 28 additions and 14 deletions

View File

@@ -26,7 +26,8 @@ verify-kustomize: \
lint-kustomize \ lint-kustomize \
test-unit-kustomize-all \ test-unit-kustomize-all \
test-examples-kustomize-against-HEAD \ test-examples-kustomize-against-HEAD \
test-examples-kustomize-against-3.8.6 test-examples-kustomize-against-3.9.0 \
test-examples-kustomize-against-3.8.8
# The following target referenced by a file in # The following target referenced by a file in
# https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/kustomize # https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/kustomize
@@ -38,7 +39,8 @@ prow-presubmit-check: \
test-unit-cmd-all \ test-unit-cmd-all \
test-go-mod \ test-go-mod \
test-examples-kustomize-against-HEAD \ test-examples-kustomize-against-HEAD \
test-examples-kustomize-against-3.8.6 test-examples-kustomize-against-3.9.0 \
test-examples-kustomize-against-3.8.8
.PHONY: verify-kustomize-e2e .PHONY: verify-kustomize-e2e
verify-kustomize-e2e: test-examples-e2e-kustomize verify-kustomize-e2e: test-examples-e2e-kustomize
@@ -274,17 +276,12 @@ test-examples-kustomize-against-HEAD: $(MYGOBIN)/kustomize $(MYGOBIN)/mdrip
./hack/testExamplesAgainstKustomize.sh HEAD ./hack/testExamplesAgainstKustomize.sh HEAD
.PHONY: .PHONY:
test-examples-kustomize-against-3.8.6: $(MYGOBIN)/mdrip test-examples-kustomize-against-3.9.0: $(MYGOBIN)/mdrip
( \ ./hack/testExamplesAgainstKustomize.sh v3.9.0
set -e; \
tag=v3.8.6; \ .PHONY:
/bin/rm -f $(MYGOBIN)/kustomize; \ test-examples-kustomize-against-3.8.8: $(MYGOBIN)/mdrip
echo "Installing kustomize $$tag."; \ ./hack/testExamplesAgainstKustomize.sh v3.8.8
GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3@$${tag}; \
./hack/testExamplesAgainstKustomize.sh $$tag; \
echo "Reinstalling kustomize from HEAD."; \
cd kustomize; go install .; \
)
# linux only. # linux only.
# This is for testing an example plugin that # This is for testing an example plugin that

View File

@@ -12,11 +12,22 @@ version=$1
# All hack scripts should run from top level. # All hack scripts should run from top level.
. hack/shellHelpers.sh . hack/shellHelpers.sh
echo "Installing kustomize ${version}"
# Always rebuild, never assume the installed verion is
# the right one to test.
rm -f $(go env GOPATH)/bin/kustomize
if [ "$version" == "HEAD" ]; then
(cd kustomize; go install .)
else
GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3@${version}
fi
# TODO: change the label? # TODO: change the label?
# We test against the latest release, and HEAD, and presumably # We test against the latest release, and HEAD, and presumably
# any branch using this label, so it should probably get # any branch using this label, so it should probably get
# a new value. # a new value.
mdrip --mode test --blockTimeOut 9m \ mdrip --mode test --blockTimeOut 15m \
--label testAgainstLatestRelease examples --label testAgainstLatestRelease examples
# TODO: make work for non-linux # TODO: make work for non-linux
@@ -28,4 +39,10 @@ if onLinuxAndNotOnRemoteCI; then
mdrip --mode test --label helmtest examples/chart.md mdrip --mode test --label helmtest examples/chart.md
fi fi
# Force outside logic to rebuild kustomize rather than
# rely on whatever this script just did. Tests should
# be order independent.
echo "Removing kustomize ${version}"
rm $(go env GOPATH)/bin/kustomize
echo "Example tests passed against ${version}." echo "Example tests passed against ${version}."