-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
Copy pathupdate-generated.sh
executable file
·31 lines (24 loc) · 1.7 KB
/
update-generated.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
STARTTIME=$(date +%s)
source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
# Update test names.
# Since k8s 1.24, GCP PD tests are opt-in through an environment variable. See:
# https://github.com/kubernetes/kubernetes/pull/109541
ENABLE_STORAGE_GCE_PD_DRIVER=yes go generate -mod vendor ./test/extended
# the test names are now contained in test/extended/util/annotate/generated/zz_generated.annotations.go
# A txt file would be more extensible, but Maciej stacked the debt here and he's the same person who will have pay it down
# as we add more images with more tests, so this seems acceptable.
go run -mod vendor ./cmd/openshift-tests render test-report --output-dir=./zz_generated.manifests
# Update mirror mapping from upstream to quay
# By default, "openshift-tests images" lists images from external binaries. However, we force
# this script to list images from built-in tests in order to avoid requiring an OCP release image.
echo "# This file is generated by hack/update-generated.sh" > test/extended/util/image/zz_generated.txt
OPENSHIFT_SKIP_EXTERNAL_TESTS=1 go run -mod vendor ./cmd/openshift-tests images --upstream --to-repository quay.io/openshift/community-e2e-images >> test/extended/util/image/zz_generated.txt
os::build::setup_env
OUTPUT_PARENT=${OUTPUT_ROOT:-$OS_ROOT}
# If you hit this, please reduce other tests instead of importing more
if [[ "$( cat "${OUTPUT_PARENT}/test/extended/testdata/bindata.go" | wc -c )" -gt 2500000 ]]; then
echo "error: extended bindata is $( cat "${OUTPUT_PARENT}/test/extended/testdata/bindata.go" | wc -c ) bytes, reduce the size of the import" 1>&2
exit 1
fi
ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret"