diff --git a/hack/update-generated-api-compatibility-data.sh b/hack/update-generated-api-compatibility-data.sh index 94f5a7200b7..415a09d889e 100755 --- a/hack/update-generated-api-compatibility-data.sh +++ b/hack/update-generated-api-compatibility-data.sh @@ -23,11 +23,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env +# run in module mode to match test command in readme.md +export GO111MODULE=on + # UPDATE_COMPATIBILITY_FIXTURE_DATA=true regenerates fixture data if needed. # -run //HEAD only runs the test cases comparing against testdata for HEAD. # We suppress the output because we are expecting to have changes. # We suppress the test failure that occurs when there are changes. -UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test ./vendor/k8s.io/api -run //HEAD >/dev/null 2>&1 || true +UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test k8s.io/api -run //HEAD >/dev/null 2>&1 || true # Now that we have regenerated data at HEAD, run the test without suppressing output or failures -go test ./vendor/k8s.io/api -run //HEAD -count=1 +go test k8s.io/api -run //HEAD -count=1 diff --git a/staging/src/k8s.io/api/testdata/README.md b/staging/src/k8s.io/api/testdata/README.md index 425b30be226..f6c9277215e 100644 --- a/staging/src/k8s.io/api/testdata/README.md +++ b/staging/src/k8s.io/api/testdata/README.md @@ -29,7 +29,7 @@ HEAD/ To run serialization tests just for the current version: ```sh -go test ./vendor/k8s.io/api -run //HEAD +go test k8s.io/api -run //HEAD ``` All three formats of a given group/version/kind are expected to decode successfully to identical objects, @@ -37,7 +37,7 @@ and to round-trip back to serialized form with identical bytes. Adding new fields or API types *is* expected to modify these fixtures. To regenerate them, run: ```sh -UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test ./vendor/k8s.io/api -run //HEAD +UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test k8s.io/api -run //HEAD ``` ## Previous versions @@ -57,12 +57,12 @@ This requires making optional scalar and struct fields pointers so that protobuf To run serialization tests just for a previous version, like `v1.14.0`: ```sh -go test ./vendor/k8s.io/api -run //v1.14.0 +go test k8s.io/api -run //v1.14.0 ``` To run serialization tests for a particular group/version/kind, like `apps/v1` `Deployment`: ```sh -go test ./vendor/k8s.io/api -run /apps.v1.Deployment/ +go test k8s.io/api -run /apps.v1.Deployment/ ``` Failures to decode, to round-trip identical bytes, or to decode identical objects from json/yaml/protobuf,