kubernetes/hack/make-rules
Patrick Ohly fe06a4c3cc test: support running upstream unit tests
The logtools linter broke a while ago when moving to more recent Go and/or more
recent dependencies such that it stopped reporting certain issues. This was
only noticed much later when a broken log call was found in the code base which
should have been flagged as wrong by the linter.

It is possible to run upstream Go unit tests in a downstream project. This is
now done for logtools if (and only if) no explicit test targets are
selected. Because hack/tools is not part of the workspace, this only works
after changing directories. gotestsum gets invoked once for the root and this
additional directory with different result files and set of test targets.

We could add more upstream tests. etcd tests were mentioned as something where
that would be useful. However, right now upstream etcd tests have some
dependencies on being run inside the original source tree, so that would have
to be fixed first. For now only single etcd client package gets tests as
a proof-of-concept of the new support for testing vendored upstream packages.
For those, -mod=readonly is needed to avoid:

    $ go test go.etcd.io/etcd/client/pkg/v3/fileutil
    ?   	go.etcd.io/etcd/client/pkg/v3/fileutil	[no test files]
2026-04-24 16:40:35 +02:00
..
build.sh hacks: build main target without go in the PATH 2024-04-05 17:36:57 +03:00
clean.sh Simpler and less noisy make-clean 2023-12-08 09:20:44 -08:00
cross.sh
make-help.sh avoid masking return values in hack/make-rules/make-help.sh 2022-10-19 23:46:18 -07:00
test-cmd.sh make test-cmd: use kube::util::find-binary to get kubeadm binary 2024-11-26 17:33:44 -08:00
test-e2e-node.sh drop automaxprocs hacks now that go 1.25 handles this built in 2025-09-17 16:36:15 -07:00
test-integration.sh Merge pull request #133503 from p0lyn0mial/upstream-disable-panic-watch-decode-err-for-integration 2025-10-31 02:52:03 -07:00
test.sh test: support running upstream unit tests 2026-04-24 16:40:35 +02:00
update.sh Add update-featuregates to update.sh 2025-03-13 15:53:06 -07:00
verify.sh hack verify.sh: clean up "base" 2024-09-30 18:12:39 +02:00