Skip to content

Commit b085e84

Browse files
committed
Squashed 'release-tools/' changes from e4dab7ff..78c0fb71
kubernetes-csi/csi-release-tools@78c0fb71 Merge kubernetes-csi/csi-release-tools#208 from jsafrane/skip-selinux kubernetes-csi/csi-release-tools@36e433e2 Skip SELinux tests in CI by default kubernetes-csi/csi-release-tools@348d4a92 Merge kubernetes-csi/csi-release-tools#207 from RaunakShah/reviewers kubernetes-csi/csi-release-tools@1efc2724 Merge kubernetes-csi/csi-release-tools#206 from RaunakShah/update-prow kubernetes-csi/csi-release-tools@7d410d88 Changes to csi prow to run e2e tests in sidecars kubernetes-csi/csi-release-tools@cfa5a75c Merge kubernetes-csi/csi-release-tools#203 from humblec/test-vendor kubernetes-csi/csi-release-tools@4edd1d8a Add RaunakShah to CSI reviewers group kubernetes-csi/csi-release-tools@7ccc9594 release tools update to 1.19 kubernetes-csi/csi-release-tools@d24254f6 Merge kubernetes-csi/csi-release-tools#202 from xing-yang/kind_0.14.0 kubernetes-csi/csi-release-tools@0faa3fc7 Update to Kind v0.14.0 images kubernetes-csi/csi-release-tools@ef4e1b2b Merge kubernetes-csi/csi-release-tools#201 from xing-yang/add_1.24_image kubernetes-csi/csi-release-tools@4ddce251 Add 1.24 Kind image kubernetes-csi/csi-release-tools@7fe51491 Merge kubernetes-csi/csi-release-tools#200 from pohly/bump-kubernetes-version kubernetes-csi/csi-release-tools@70915a8e prow.sh: update snapshotter version kubernetes-csi/csi-release-tools@31a3f38b Merge kubernetes-csi/csi-release-tools#199 from pohly/bump-kubernetes-version kubernetes-csi/csi-release-tools@7577454a prow.sh: bump Kubernetes to v1.22.0 kubernetes-csi/csi-release-tools@d29a2e75 Merge kubernetes-csi/csi-release-tools#198 from pohly/csi-test-5.0.0 kubernetes-csi/csi-release-tools@41cb70d3 prow.sh: sanity testing with csi-test v5.0.0 kubernetes-csi/csi-release-tools@c85a63fb Merge kubernetes-csi/csi-release-tools#197 from pohly/fix-alpha-testing kubernetes-csi/csi-release-tools@b86d8e94 support Kubernetes 1.25 + Ginkgo v2 kubernetes-csi/csi-release-tools@ab0b0a3d Merge kubernetes-csi/csi-release-tools#192 from andyzhangx/patch-1 kubernetes-csi/csi-release-tools@7bbab24e Merge kubernetes-csi/csi-release-tools#196 from humblec/non-alpha kubernetes-csi/csi-release-tools@e51ff2cc introduce control variable for non alpha feature gate configuration kubernetes-csi/csi-release-tools@ca19ef52 Merge kubernetes-csi/csi-release-tools#195 from pohly/fix-alpha-testing kubernetes-csi/csi-release-tools@3948331e fix testing with latest Kubernetes kubernetes-csi/csi-release-tools@9a0260c5 fix boilerplate header git-subtree-dir: release-tools git-subtree-split: 78c0fb714fa4448b29962a0f34fa18b7b7d97ae6
1 parent a8238dd commit b085e84

File tree

4 files changed

+90
-29
lines changed

4 files changed

+90
-29
lines changed

KUBERNETES_CSI_OWNERS_ALIASES

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ aliases:
2727
- jingxu97
2828
- jsafrane
2929
- pohly
30+
- RaunakShah
3031
- xing-yang
3132

3233
# This documents who previously contributed to Kubernetes-CSI

filter-junit.go

+18-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,18 @@ var (
3535
)
3636

3737
/*
38-
* TestSuite represents a JUnit file. Due to how encoding/xml works, we have
38+
* TestResults represents a JUnit file. Due to how encoding/xml works, we have
3939
* represent all fields that we want to be passed through. It's therefore
4040
* not a complete solution, but good enough for Ginkgo + Spyglass.
41+
*
42+
* Before Kubernetes 1.25 and ginkgo v2, we directly had <testsuite> in the
43+
* JUnit file. Now we get <testsuites> and inside it the <testsuite>.
4144
*/
45+
type TestResults struct {
46+
XMLName string `xml:"testsuites"`
47+
TestSuite TestSuite `xml:"testsuite"`
48+
}
49+
4250
type TestSuite struct {
4351
XMLName string `xml:"testsuite"`
4452
TestCases []TestCase `xml:"testcase"`
@@ -93,7 +101,15 @@ func main() {
93101
}
94102
}
95103
if err := xml.Unmarshal(data, &junit); err != nil {
96-
panic(err)
104+
if err.Error() != "expected element type <testsuite> but have <testsuites>" {
105+
panic(err)
106+
}
107+
// Fall back to Ginkgo v2 format.
108+
var junitv2 TestResults
109+
if err := xml.Unmarshal(data, &junitv2); err != nil {
110+
panic(err)
111+
}
112+
junit = junitv2.TestSuite
97113
}
98114
}
99115

go-get-kubernetes.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16-
#
16+
1717
# This script can be used while converting a repo from "dep" to "go mod"
1818
# by calling it after "go mod init" or to update the Kubernetes packages
1919
# in a repo that has already been converted. Only packages that are

prow.sh

+70-26
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,17 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -pp
8686
# which is disabled with GOFLAGS=-mod=vendor).
8787
configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory"
8888

89-
configvar CSI_PROW_GO_VERSION_BUILD "1.18" "Go version for building the component" # depends on component's source code
89+
configvar CSI_PROW_GO_VERSION_BUILD "1.19" "Go version for building the component" # depends on component's source code
9090
configvar CSI_PROW_GO_VERSION_E2E "" "override Go version for building the Kubernetes E2E test suite" # normally doesn't need to be set, see install_e2e
9191
configvar CSI_PROW_GO_VERSION_SANITY "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below
9292
configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below
9393
configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building ginkgo" # depends on CSI_PROW_GINKGO_VERSION below
9494

9595
# ginkgo test runner version to use. If the pre-installed version is
96-
# different, the desired version is built from source.
96+
# different, the desired version is built from source. For Kubernetes,
97+
# the version built via "make WHAT=vendor/github.com/onsi/ginkgo/ginkgo" is
98+
# used, which is guaranteed to match what the Kubernetes e2e.test binary
99+
# needs.
97100
configvar CSI_PROW_GINKGO_VERSION v1.7.0 "Ginkgo"
98101

99102
# Ginkgo runs the E2E test in parallel. The default is based on the number
@@ -118,7 +121,7 @@ configvar CSI_PROW_BUILD_JOB true "building code in repo enabled"
118121
# use the same settings as for "latest" Kubernetes. This works
119122
# as long as there are no breaking changes in Kubernetes, like
120123
# deprecating or changing the implementation of an alpha feature.
121-
configvar CSI_PROW_KUBERNETES_VERSION 1.17.0 "Kubernetes"
124+
configvar CSI_PROW_KUBERNETES_VERSION 1.22.0 "Kubernetes"
122125

123126
# CSI_PROW_KUBERNETES_VERSION reduced to first two version numbers and
124127
# with underscore (1_13 instead of 1.13.3) and in uppercase (LATEST
@@ -138,7 +141,7 @@ kind_version_default () {
138141
latest|master)
139142
echo main;;
140143
*)
141-
echo v0.11.1;;
144+
echo v0.14.0;;
142145
esac
143146
}
144147

@@ -149,16 +152,13 @@ configvar CSI_PROW_KIND_VERSION "$(kind_version_default)" "kind"
149152

150153
# kind images to use. Must match the kind version.
151154
# The release notes of each kind release list the supported images.
152-
configvar CSI_PROW_KIND_IMAGES "kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
153-
kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047
154-
kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
155-
kindest/node:v1.20.7@sha256:cbeaf907fc78ac97ce7b625e4bf0de16e3ea725daf6b04f930bd14c67c671ff9
156-
kindest/node:v1.19.11@sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729
157-
kindest/node:v1.18.19@sha256:7af1492e19b3192a79f606e43c35fb741e520d195f96399284515f077b3b622c
158-
kindest/node:v1.17.17@sha256:66f1d0d91a88b8a001811e2f1054af60eef3b669a9a74f9b6db871f2f1eeed00
159-
kindest/node:v1.16.15@sha256:83067ed51bf2a3395b24687094e283a7c7c865ccc12a8b1d7aa673ba0c5e8861
160-
kindest/node:v1.15.12@sha256:b920920e1eda689d9936dfcf7332701e80be12566999152626b2c9d730397a95
161-
kindest/node:v1.14.10@sha256:f8a66ef82822ab4f7569e91a5bccaf27bceee135c1457c512e54de8c6f7219f8" "kind images"
155+
configvar CSI_PROW_KIND_IMAGES "kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e
156+
kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae
157+
kindest/node:v1.22.9@sha256:8135260b959dfe320206eb36b3aeda9cffcb262f4b44cda6b33f7bb73f453105
158+
kindest/node:v1.21.12@sha256:f316b33dd88f8196379f38feb80545ef3ed44d9197dca1bfd48bcb1583210207
159+
kindest/node:v1.20.15@sha256:6f2d011dffe182bad80b85f6c00e8ca9d86b5b8922cdf433d53575c4c5212248
160+
kindest/node:v1.19.16@sha256:d9c819e8668de8d5030708e484a9fdff44d95ec4675d136ef0a0a584e587f65c
161+
kindest/node:v1.18.20@sha256:738cdc23ed4be6cc0b7ea277a2ebcc454c8373d7d8fb991a7fcdbd126188e6d7" "kind images"
162162

163163
# By default, this script tests sidecars with the CSI hostpath driver,
164164
# using the install_csi_driver function. That function depends on
@@ -196,7 +196,7 @@ kindest/node:v1.14.10@sha256:f8a66ef82822ab4f7569e91a5bccaf27bceee135c1457c512e5
196196
# If the deployment script is called with CSI_PROW_TEST_DRIVER=<file name> as
197197
# environment variable, then it must write a suitable test driver configuration
198198
# into that file in addition to installing the driver.
199-
configvar CSI_PROW_DRIVER_VERSION "v1.3.0" "CSI driver version"
199+
configvar CSI_PROW_DRIVER_VERSION "v1.8.0" "CSI driver version"
200200
configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo"
201201
configvar CSI_PROW_DEPLOYMENT "" "deployment"
202202
configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[suffix].yaml files"
@@ -228,13 +228,16 @@ configvar CSI_PROW_E2E_VERSION "$(version_to_git "${CSI_PROW_KUBERNETES_VERSION}
228228
configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo"
229229
configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package"
230230

231+
# Local path for e2e tests. Set to "none" to disable.
232+
configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package"
233+
231234
# csi-sanity testing from the csi-test repo can be run against the installed
232235
# CSI driver. For this to work, deploying the driver must expose the Unix domain
233236
# csi.sock as a TCP service for use by the csi-sanity command, which runs outside
234237
# of the cluster. The alternative would have been to (cross-)compile csi-sanity
235238
# and install it inside the cluster, which is not necessarily easier.
236239
configvar CSI_PROW_SANITY_REPO https://github.com/kubernetes-csi/csi-test "csi-test repo"
237-
configvar CSI_PROW_SANITY_VERSION v4.3.0 "csi-test version"
240+
configvar CSI_PROW_SANITY_VERSION v5.0.0 "csi-test version"
238241
configvar CSI_PROW_SANITY_PACKAGE_PATH github.com/kubernetes-csi/csi-test "csi-test package"
239242
configvar CSI_PROW_SANITY_SERVICE "hostpath-service" "Kubernetes TCP service name that exposes csi.sock"
240243
configvar CSI_PROW_SANITY_POD "csi-hostpathplugin-0" "Kubernetes pod with CSI driver"
@@ -282,13 +285,18 @@ tests_enabled () {
282285
sanity_enabled () {
283286
[ "${CSI_PROW_TESTS_SANITY}" = "sanity" ] && tests_enabled "sanity"
284287
}
288+
289+
sidecar_tests_enabled () {
290+
[ "${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" != "none" ]
291+
}
292+
285293
tests_need_kind () {
286294
tests_enabled "parallel" "serial" "serial-alpha" "parallel-alpha" ||
287-
sanity_enabled
295+
sanity_enabled || sidecar_tests_enabled
288296
}
289297
tests_need_non_alpha_cluster () {
290298
tests_enabled "parallel" "serial" ||
291-
sanity_enabled
299+
sanity_enabled || sidecar_tests_enabled
292300
}
293301
tests_need_alpha_cluster () {
294302
tests_enabled "parallel-alpha" "serial-alpha"
@@ -346,15 +354,23 @@ configvar CSI_PROW_E2E_ALPHA "$(get_versioned_variable CSI_PROW_E2E_ALPHA "${csi
346354
# kubernetes-csi components must be updated, either by disabling
347355
# the failing test for "latest" or by updating the test and not running
348356
# it anymore for older releases.
349-
configvar CSI_PROW_E2E_ALPHA_GATES_LATEST 'GenericEphemeralVolume=true,CSIStorageCapacity=true' "alpha feature gates for latest Kubernetes"
357+
configvar CSI_PROW_E2E_ALPHA_GATES_LATEST '' "alpha feature gates for latest Kubernetes"
350358
configvar CSI_PROW_E2E_ALPHA_GATES "$(get_versioned_variable CSI_PROW_E2E_ALPHA_GATES "${csi_prow_kubernetes_version_suffix}")" "alpha E2E feature gates"
351359

360+
configvar CSI_PROW_E2E_GATES_LATEST '' "non alpha feature gates for latest Kubernetes"
361+
configvar CSI_PROW_E2E_GATES "$(get_versioned_variable CSI_PROW_E2E_GATES "${csi_prow_kubernetes_version_suffix}")" "non alpha E2E feature gates"
362+
363+
# Focus for local tests run in the sidecar E2E repo. Only used if CSI_PROW_SIDECAR_E2E_IMPORT_PATH
364+
# is not set to "none". If empty, all tests in the sidecar repo will be run.
365+
configvar CSI_PROW_SIDECAR_E2E_FOCUS '' "tags for local E2E tests"
366+
configvar CSI_PROW_SIDECAR_E2E_SKIP '' "local tests that need to be skipped"
367+
352368
# Which external-snapshotter tag to use for the snapshotter CRD and snapshot-controller deployment
353369
default_csi_snapshotter_version () {
354370
if [ "${CSI_PROW_KUBERNETES_VERSION}" = "latest" ] || [ "${CSI_PROW_DRIVER_CANARY}" = "canary" ]; then
355371
echo "master"
356372
else
357-
echo "v3.0.2"
373+
echo "v4.0.0"
358374
fi
359375
}
360376
configvar CSI_SNAPSHOTTER_VERSION "$(default_csi_snapshotter_version)" "external-snapshotter version tag"
@@ -365,7 +381,7 @@ configvar CSI_SNAPSHOTTER_VERSION "$(default_csi_snapshotter_version)" "external
365381
# whether they can run with the current cluster provider, but until
366382
# they are, we filter them out by name. Like the other test selection
367383
# variables, this is again a space separated list of regular expressions.
368-
configvar CSI_PROW_E2E_SKIP 'Disruptive' "tests that need to be skipped"
384+
configvar CSI_PROW_E2E_SKIP '\[Disruptive\]|\[Feature:SELinux\]' "tests that need to be skipped"
369385

370386
# This creates directories that are required for testing.
371387
ensure_paths () {
@@ -437,6 +453,10 @@ install_kind () {
437453

438454
# Ensure that we have the desired version of the ginkgo test runner.
439455
install_ginkgo () {
456+
if [ -e "${CSI_PROW_BIN}/ginkgo" ]; then
457+
return
458+
fi
459+
440460
# CSI_PROW_GINKGO_VERSION contains the tag with v prefix, the command line output does not.
441461
if [ "v$(ginkgo version 2>/dev/null | sed -e 's/.* //')" = "${CSI_PROW_GINKGO_VERSION}" ]; then
442462
return
@@ -935,12 +955,17 @@ install_e2e () {
935955
return
936956
fi
937957
958+
if sidecar_tests_enabled; then
959+
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" go test -c -o "${CSI_PROW_WORK}/e2e-local.test" "${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}"
960+
fi
938961
git_checkout "${CSI_PROW_E2E_REPO}" "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_E2E_VERSION}" --depth=1 &&
939962
if [ "${CSI_PROW_E2E_IMPORT_PATH}" = "k8s.io/kubernetes" ]; then
940963
patch_kubernetes "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_WORK}" &&
941964
go_version="${CSI_PROW_GO_VERSION_E2E:-$(go_version_for_kubernetes "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_E2E_VERSION}")}" &&
942965
run_with_go "$go_version" make WHAT=test/e2e/e2e.test "-C${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" &&
943-
ln -s "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}/_output/bin/e2e.test" "${CSI_PROW_WORK}"
966+
ln -s "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}/_output/bin/e2e.test" "${CSI_PROW_WORK}" &&
967+
run_with_go "$go_version" make WHAT=vendor/github.com/onsi/ginkgo/ginkgo "-C${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" &&
968+
ln -s "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}/_output/bin/ginkgo" "${CSI_PROW_BIN}"
944969
else
945970
run_with_go "${CSI_PROW_GO_VERSION_E2E}" go test -c -o "${CSI_PROW_WORK}/e2e.test" "${CSI_PROW_E2E_IMPORT_PATH}/test/e2e"
946971
fi
@@ -988,8 +1013,13 @@ run_e2e () (
9881013
}
9891014
trap move_junit EXIT
9901015
991-
cd "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" &&
992-
run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo -v "$@" "${CSI_PROW_WORK}/e2e.test" -- -report-dir "${ARTIFACTS}" -storage.testdriver="${CSI_PROW_WORK}/test-driver.yaml"
1016+
if [ "${name}" == "local" ]; then
1017+
cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" &&
1018+
run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo -v "$@" "${CSI_PROW_WORK}/e2e-local.test" -- -report-dir "${ARTIFACTS}" -report-prefix local
1019+
else
1020+
cd "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" &&
1021+
run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo -v "$@" "${CSI_PROW_WORK}/e2e.test" -- -report-dir "${ARTIFACTS}" -storage.testdriver="${CSI_PROW_WORK}/test-driver.yaml"
1022+
fi
9931023
)
9941024
9951025
# Run csi-sanity against installed CSI driver.
@@ -1254,7 +1284,8 @@ main () {
12541284
fi
12551285
12561286
if tests_need_non_alpha_cluster; then
1257-
start_cluster || die "starting the non-alpha cluster failed"
1287+
# Need to (re)create the cluster.
1288+
start_cluster "${CSI_PROW_E2E_GATES}" || die "starting the non-alpha cluster failed"
12581289
12591290
# Install necessary snapshot CRDs and snapshot controller
12601291
install_snapshot_crds
@@ -1300,11 +1331,24 @@ main () {
13001331
ret=1
13011332
fi
13021333
fi
1334+
1335+
if sidecar_tests_enabled; then
1336+
if ! run_e2e local \
1337+
-focus="${CSI_PROW_SIDECAR_E2E_FOCUS}" \
1338+
-skip="$(regex_join "${CSI_PROW_E2E_SERIAL}")"; then
1339+
warn "E2E sidecar failed"
1340+
ret=1
1341+
fi
1342+
fi
13031343
fi
13041344
delete_cluster_inside_prow_job non-alpha
13051345
fi
13061346
1307-
if tests_need_alpha_cluster && [ "${CSI_PROW_E2E_ALPHA_GATES}" ]; then
1347+
# If the cluster for alpha tests doesn't need any feature gates, then we
1348+
# could reuse the same cluster as for the other tests. But that would make
1349+
# the flow in this script harder and wouldn't help in practice because
1350+
# we have separate Prow jobs for alpha and non-alpha tests.
1351+
if tests_need_alpha_cluster; then
13081352
# Need to (re)create the cluster.
13091353
start_cluster "${CSI_PROW_E2E_ALPHA_GATES}" || die "starting alpha cluster failed"
13101354

0 commit comments

Comments
 (0)