From f38660b14bdfd5f63bac4dc4364457ae1be232a6 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 24 Apr 2026 13:18:56 +0200 Subject: [PATCH] test: move list of extra tests into separate file This is a bit easier to edit than directly in the bash script. --- hack/dependency-unit-tests.conf | 21 +++++++++++++++++++++ hack/make-rules/test.sh | 23 ++++------------------- 2 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 hack/dependency-unit-tests.conf diff --git a/hack/dependency-unit-tests.conf b/hack/dependency-unit-tests.conf new file mode 100644 index 00000000000..8f34eb26db7 --- /dev/null +++ b/hack/dependency-unit-tests.conf @@ -0,0 +1,21 @@ +# These packages get included in the set of packages tested by "make test" +# when no explicit WHAT target is specified. +# +# Which packages to include here is a bit subjective: +# - Should be "important". In particular, it should +# be compiled into one of our production binaries (use +# `go mod why $package` without the vendor prefix) or +# be used regularly. +# - Should be at risk of breaking because we compile them +# differently than upstream (different Go version, different +# dependencies). +# - Must support being tested outside of their normal source tree. +# - Must be reasonably fast. + +# Compiled differently (Go version, dependencies) than in the upstream +# repo, therefore worth testing locally. +hack/tools/golangci-lint/sigs.k8s.io/logtools/... + +# This is just one package which is known to work. +# The goal is to run more. +vendor/go.etcd.io/etcd/client/pkg/v3/fileutil diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index 6893ef406e5..b6e74991bab 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -176,25 +176,10 @@ for arg; do done if [[ ${#testcases[@]} -eq 0 ]]; then # If the user passed no targets in, we want ~everything. - kube::util::read-array testcases < <(kube::test::find_go_packages) - - # In addition, also test some specific upstream packages. - # Which packages to include here is a bit subjective: - # - Should be "important". In particular, it should - # be compiled into one of our production binaries (use - # `go mod why $package` without the vendor prefix) or - # be used regularly. - # - Should be at risk of breaking because we compile them - # differently than upstream (different Go version, different - # dependencies). - # - Must support being tested outside of their normal source tree. - # - Must be reasonably fast. - testcases+=( - hack/tools/golangci-lint/sigs.k8s.io/logtools/... - - # This is just an one package which is known to work. - # The goal is to run more. - vendor/go.etcd.io/etcd/client/pkg/v3/fileutil + # In addition also test some specific upstream packages. + kube::util::read-array testcases < <( + kube::test::find_go_packages + grep -v -e '^#' -e '^$' "${KUBE_ROOT}/hack/dependency-unit-tests.conf" ) else # If the user passed targets, we should normalize them.