Fix for typecheck doesn't notice compile errors in test files

- ensure we add all the staging modules so the _test files in there are "loaded"
- use build tags to skip tests that fail to build in specific os/arch pairs

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Co-Authored-By: Tim Hockin <thockin@google.com>
This commit is contained in:
Davanum Srinivas
2024-07-02 16:26:41 -04:00
parent a38cde339a
commit c230a45383
7 changed files with 41 additions and 12 deletions

View File

@@ -26,6 +26,17 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
cd "${KUBE_ROOT}"
kube::golang::setup_env
kube::util::require-jq
if [[ $# == 0 ]]; then
# Doing it this way is MUCH faster than simply saying "all", and there doesn't
# seem to be a simpler way to express "this whole workspace".
packages=()
kube::util::read-array packages < <(
go work edit -json | jq -r '.Use[].DiskPath + "/..."'
)
set -- "${packages[@]}"
fi
ret=0
TYPECHECK_SERIAL="${TYPECHECK_SERIAL:-false}"