mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-09-15 12:18:57 +00:00
Do not run ineffective targets, do run all module tests
This commit is contained in:
8
Makefile
8
Makefile
@@ -97,7 +97,7 @@ verify-kustomize: \
|
|||||||
install-tools \
|
install-tools \
|
||||||
lint-kustomize \
|
lint-kustomize \
|
||||||
test-unit-kustomize-all \
|
test-unit-kustomize-all \
|
||||||
test-unit-cmd-all \
|
test-unit-non-plugin \
|
||||||
test-go-mod \
|
test-go-mod \
|
||||||
test-examples-kustomize-against-HEAD \
|
test-examples-kustomize-against-HEAD \
|
||||||
test-examples-kustomize-against-v4-release
|
test-examples-kustomize-against-v4-release
|
||||||
@@ -130,6 +130,10 @@ lint-kustomize: $(MYGOBIN)/golangci-lint-kustomize $(builtinplugins)
|
|||||||
test-unit-all: $(builtinplugins)
|
test-unit-all: $(builtinplugins)
|
||||||
./hack/for-each-module.sh "make test"
|
./hack/for-each-module.sh "make test"
|
||||||
|
|
||||||
|
.PHONY: test-unit-non-plugin
|
||||||
|
test-unit-non-plugin:
|
||||||
|
./hack/for-each-module.sh "make test" "./plugin/*" 15
|
||||||
|
|
||||||
.PHONY: test-unit-kustomize-api
|
.PHONY: test-unit-kustomize-api
|
||||||
test-unit-kustomize-api: build-kustomize-api
|
test-unit-kustomize-api: build-kustomize-api
|
||||||
cd api; go test ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222"
|
cd api; go test ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222"
|
||||||
@@ -149,7 +153,7 @@ test-unit-kustomize-all: \
|
|||||||
test-unit-kustomize-cli \
|
test-unit-kustomize-cli \
|
||||||
test-unit-kustomize-plugins
|
test-unit-kustomize-plugins
|
||||||
|
|
||||||
test-unit-cmd-all:
|
test-unit-kyaml-all:
|
||||||
./hack/kyaml-pre-commit.sh
|
./hack/kyaml-pre-commit.sh
|
||||||
|
|
||||||
test-go-mod:
|
test-go-mod:
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# Copyright 2022 The Kubernetes Authors.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
MYGOBIN = $(shell go env GOBIN)
|
MYGOBIN = $(shell go env GOBIN)
|
||||||
ifeq ($(MYGOBIN),)
|
ifeq ($(MYGOBIN),)
|
||||||
MYGOBIN = $(shell go env GOPATH)/bin
|
MYGOBIN = $(shell go env GOPATH)/bin
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
../Makefile-modules.mk
|
|
||||||
7
api/Makefile
Normal file
7
api/Makefile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Copyright 2022 The Kubernetes Authors.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
include ../Makefile-modules.mk
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test -v -timeout 45m -cover ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222"
|
||||||
@@ -14,6 +14,8 @@ if [[ -z "${1-}" ]] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cmd=$1
|
cmd=$1
|
||||||
|
skip_pattern="${2-}"
|
||||||
|
expected_module_count=${3:-44}
|
||||||
|
|
||||||
seen=()
|
seen=()
|
||||||
# Hack scripts must be run from the root of the repository.
|
# Hack scripts must be run from the root of the repository.
|
||||||
@@ -21,7 +23,7 @@ KUSTOMIZE_ROOT=$(pwd)
|
|||||||
export KUSTOMIZE_ROOT
|
export KUSTOMIZE_ROOT
|
||||||
|
|
||||||
# verify all modules pass validation
|
# verify all modules pass validation
|
||||||
for i in $(find . -name go.mod -not -path "./site/*"); do
|
for i in $(find . -name go.mod -not -path "./site/*" -not -path "$skip_pattern"); do
|
||||||
pushd .
|
pushd .
|
||||||
cd $(dirname $i);
|
cd $(dirname $i);
|
||||||
|
|
||||||
@@ -43,9 +45,8 @@ echo -e "\n\n----------------------------------------------------------"
|
|||||||
echo -e "SUCCESS: Ran '$cmd' on the following modules:"
|
echo -e "SUCCESS: Ran '$cmd' on the following modules:"
|
||||||
printf " - %s\n" "${seen[@]}"
|
printf " - %s\n" "${seen[@]}"
|
||||||
|
|
||||||
EXPECTED_MODULE_COUNT=44
|
if [[ "${#seen[@]}" -ne $expected_module_count ]]; then
|
||||||
if [[ "${#seen[@]}" -ne $EXPECTED_MODULE_COUNT ]]; then
|
|
||||||
echo
|
echo
|
||||||
echo "SANITY CHECK FAILURE: Expected to see $EXPECTED_MODULE_COUNT modules, but saw ${#seen[@]}"
|
echo "SANITY CHECK FAILURE: Expected to see $expected_module_count modules, but saw ${#seen[@]}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user