Squashed 'release-tools/' changes from e4dab7f..d29a2e7
https://github.com/kubernetes-csi/csi-release-tools/commit/d29a2e7 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/198 from pohly/csi-test-5.0.0 https://github.com/kubernetes-csi/csi-release-tools/commit/41cb70d prow.sh: sanity testing with csi-test v5.0.0 https://github.com/kubernetes-csi/csi-release-tools/commit/c85a63f Merge https://github.com/kubernetes-csi/csi-release-tools/pull/197 from pohly/fix-alpha-testing https://github.com/kubernetes-csi/csi-release-tools/commit/b86d8e9 support Kubernetes 1.25 + Ginkgo v2 https://github.com/kubernetes-csi/csi-release-tools/commit/ab0b0a3 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/192 from andyzhangx/patch-1 https://github.com/kubernetes-csi/csi-release-tools/commit/7bbab24 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/196 from humblec/non-alpha https://github.com/kubernetes-csi/csi-release-tools/commit/e51ff2c introduce control variable for non alpha feature gate configuration https://github.com/kubernetes-csi/csi-release-tools/commit/ca19ef5 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/195 from pohly/fix-alpha-testing https://github.com/kubernetes-csi/csi-release-tools/commit/3948331 fix testing with latest Kubernetes https://github.com/kubernetes-csi/csi-release-tools/commit/9a0260c fix boilerplate header git-subtree-dir: release-tools git-subtree-split: d29a2e7547822371ebf3e61f7d2249c244879f85
This commit is contained in:
		
							parent
							
								
									30ffcb5009
								
							
						
					
					
						commit
						58e6b4e969
					
				|  | @ -35,10 +35,18 @@ var ( | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| /* | /* | ||||||
|  * TestSuite represents a JUnit file. Due to how encoding/xml works, we have |  * TestResults represents a JUnit file. Due to how encoding/xml works, we have | ||||||
|  * represent all fields that we want to be passed through. It's therefore |  * represent all fields that we want to be passed through. It's therefore | ||||||
|  * not a complete solution, but good enough for Ginkgo + Spyglass. |  * not a complete solution, but good enough for Ginkgo + Spyglass. | ||||||
|  |  * | ||||||
|  |  * Before Kubernetes 1.25 and ginkgo v2, we directly had <testsuite> in the | ||||||
|  |  * JUnit file. Now we get <testsuites> and inside it the <testsuite>. | ||||||
|  */ |  */ | ||||||
|  | type TestResults struct { | ||||||
|  | 	XMLName   string    `xml:"testsuites"` | ||||||
|  | 	TestSuite TestSuite `xml:"testsuite"` | ||||||
|  | } | ||||||
|  | 
 | ||||||
| type TestSuite struct { | type TestSuite struct { | ||||||
| 	XMLName   string     `xml:"testsuite"` | 	XMLName   string     `xml:"testsuite"` | ||||||
| 	TestCases []TestCase `xml:"testcase"` | 	TestCases []TestCase `xml:"testcase"` | ||||||
|  | @ -93,8 +101,16 @@ func main() { | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		if err := xml.Unmarshal(data, &junit); err != nil { | 		if err := xml.Unmarshal(data, &junit); err != nil { | ||||||
|  | 			if err.Error() != "expected element type <testsuite> but have <testsuites>" { | ||||||
| 				panic(err) | 				panic(err) | ||||||
| 			} | 			} | ||||||
|  | 			// Fall back to Ginkgo v2 format.
 | ||||||
|  | 			var junitv2 TestResults | ||||||
|  | 			if err := xml.Unmarshal(data, &junitv2); err != nil { | ||||||
|  | 				panic(err) | ||||||
|  | 			} | ||||||
|  | 			junit = junitv2.TestSuite | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// Keep only matching testcases. Testcases skipped in all test runs are only stored once.
 | 	// Keep only matching testcases. Testcases skipped in all test runs are only stored once.
 | ||||||
|  |  | ||||||
|  | @ -13,7 +13,7 @@ | ||||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
| # See the License for the specific language governing permissions and | # See the License for the specific language governing permissions and | ||||||
| # limitations under the License. | # limitations under the License. | ||||||
| # | 
 | ||||||
| # This script can be used while converting a repo from "dep" to "go mod" | # This script can be used while converting a repo from "dep" to "go mod" | ||||||
| # by calling it after "go mod init" or to update the Kubernetes packages | # by calling it after "go mod init" or to update the Kubernetes packages | ||||||
| # in a repo that has already been converted. Only packages that are | # in a repo that has already been converted. Only packages that are | ||||||
|  |  | ||||||
							
								
								
									
										31
									
								
								prow.sh
								
								
								
								
							
							
						
						
									
										31
									
								
								prow.sh
								
								
								
								
							|  | @ -93,7 +93,10 @@ configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version fo | ||||||
| configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building ginkgo" # depends on CSI_PROW_GINKGO_VERSION below | configvar CSI_PROW_GO_VERSION_GINKGO "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building ginkgo" # depends on CSI_PROW_GINKGO_VERSION below | ||||||
| 
 | 
 | ||||||
| # ginkgo test runner version to use. If the pre-installed version is | # ginkgo test runner version to use. If the pre-installed version is | ||||||
| # different, the desired version is built from source. | # different, the desired version is built from source. For Kubernetes, | ||||||
|  | # the version built via "make WHAT=vendor/github.com/onsi/ginkgo/ginkgo" is | ||||||
|  | # used, which is guaranteed to match what the Kubernetes e2e.test binary | ||||||
|  | # needs. | ||||||
| configvar CSI_PROW_GINKGO_VERSION v1.7.0 "Ginkgo" | configvar CSI_PROW_GINKGO_VERSION v1.7.0 "Ginkgo" | ||||||
| 
 | 
 | ||||||
| # Ginkgo runs the E2E test in parallel. The default is based on the number | # Ginkgo runs the E2E test in parallel. The default is based on the number | ||||||
|  | @ -196,7 +199,7 @@ kindest/node:v1.14.10@sha256:f8a66ef82822ab4f7569e91a5bccaf27bceee135c1457c512e5 | ||||||
| # If the deployment script is called with CSI_PROW_TEST_DRIVER=<file name> as | # If the deployment script is called with CSI_PROW_TEST_DRIVER=<file name> as | ||||||
| # environment variable, then it must write a suitable test driver configuration | # environment variable, then it must write a suitable test driver configuration | ||||||
| # into that file in addition to installing the driver. | # into that file in addition to installing the driver. | ||||||
| configvar CSI_PROW_DRIVER_VERSION "v1.3.0" "CSI driver version" | configvar CSI_PROW_DRIVER_VERSION "v1.8.0" "CSI driver version" | ||||||
| configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo" | configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo" | ||||||
| configvar CSI_PROW_DEPLOYMENT "" "deployment" | configvar CSI_PROW_DEPLOYMENT "" "deployment" | ||||||
| configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[suffix].yaml files" | configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[suffix].yaml files" | ||||||
|  | @ -234,7 +237,7 @@ configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package" | ||||||
| # of the cluster. The alternative would have been to (cross-)compile csi-sanity | # of the cluster. The alternative would have been to (cross-)compile csi-sanity | ||||||
| # and install it inside the cluster, which is not necessarily easier. | # and install it inside the cluster, which is not necessarily easier. | ||||||
| configvar CSI_PROW_SANITY_REPO https://github.com/kubernetes-csi/csi-test "csi-test repo" | configvar CSI_PROW_SANITY_REPO https://github.com/kubernetes-csi/csi-test "csi-test repo" | ||||||
| configvar CSI_PROW_SANITY_VERSION v4.3.0 "csi-test version" | configvar CSI_PROW_SANITY_VERSION v5.0.0 "csi-test version" | ||||||
| configvar CSI_PROW_SANITY_PACKAGE_PATH github.com/kubernetes-csi/csi-test "csi-test package" | configvar CSI_PROW_SANITY_PACKAGE_PATH github.com/kubernetes-csi/csi-test "csi-test package" | ||||||
| configvar CSI_PROW_SANITY_SERVICE "hostpath-service" "Kubernetes TCP service name that exposes csi.sock" | configvar CSI_PROW_SANITY_SERVICE "hostpath-service" "Kubernetes TCP service name that exposes csi.sock" | ||||||
| configvar CSI_PROW_SANITY_POD "csi-hostpathplugin-0" "Kubernetes pod with CSI driver" | configvar CSI_PROW_SANITY_POD "csi-hostpathplugin-0" "Kubernetes pod with CSI driver" | ||||||
|  | @ -346,9 +349,12 @@ configvar CSI_PROW_E2E_ALPHA "$(get_versioned_variable CSI_PROW_E2E_ALPHA "${csi | ||||||
| # kubernetes-csi components must be updated, either by disabling | # kubernetes-csi components must be updated, either by disabling | ||||||
| # the failing test for "latest" or by updating the test and not running | # the failing test for "latest" or by updating the test and not running | ||||||
| # it anymore for older releases. | # it anymore for older releases. | ||||||
| configvar CSI_PROW_E2E_ALPHA_GATES_LATEST 'GenericEphemeralVolume=true,CSIStorageCapacity=true' "alpha feature gates for latest Kubernetes" | configvar CSI_PROW_E2E_ALPHA_GATES_LATEST '' "alpha feature gates for latest Kubernetes" | ||||||
| configvar CSI_PROW_E2E_ALPHA_GATES "$(get_versioned_variable CSI_PROW_E2E_ALPHA_GATES "${csi_prow_kubernetes_version_suffix}")" "alpha E2E feature gates" | configvar CSI_PROW_E2E_ALPHA_GATES "$(get_versioned_variable CSI_PROW_E2E_ALPHA_GATES "${csi_prow_kubernetes_version_suffix}")" "alpha E2E feature gates" | ||||||
| 
 | 
 | ||||||
|  | configvar CSI_PROW_E2E_GATES_LATEST '' "non alpha feature gates for latest Kubernetes" | ||||||
|  | configvar CSI_PROW_E2E_GATES "$(get_versioned_variable CSI_PROW_E2E_GATES "${csi_prow_kubernetes_version_suffix}")" "non alpha E2E feature gates" | ||||||
|  | 
 | ||||||
| # Which external-snapshotter tag to use for the snapshotter CRD and snapshot-controller deployment | # Which external-snapshotter tag to use for the snapshotter CRD and snapshot-controller deployment | ||||||
| default_csi_snapshotter_version () { | default_csi_snapshotter_version () { | ||||||
| 	if [ "${CSI_PROW_KUBERNETES_VERSION}" = "latest" ] || [ "${CSI_PROW_DRIVER_CANARY}" = "canary" ]; then | 	if [ "${CSI_PROW_KUBERNETES_VERSION}" = "latest" ] || [ "${CSI_PROW_DRIVER_CANARY}" = "canary" ]; then | ||||||
|  | @ -437,6 +443,10 @@ install_kind () { | ||||||
| 
 | 
 | ||||||
| # Ensure that we have the desired version of the ginkgo test runner. | # Ensure that we have the desired version of the ginkgo test runner. | ||||||
| install_ginkgo () { | install_ginkgo () { | ||||||
|  |     if [ -e "${CSI_PROW_BIN}/ginkgo" ]; then | ||||||
|  |         return | ||||||
|  |     fi | ||||||
|  | 
 | ||||||
|     # CSI_PROW_GINKGO_VERSION contains the tag with v prefix, the command line output does not. |     # CSI_PROW_GINKGO_VERSION contains the tag with v prefix, the command line output does not. | ||||||
|     if [ "v$(ginkgo version 2>/dev/null | sed -e 's/.* //')" = "${CSI_PROW_GINKGO_VERSION}" ]; then |     if [ "v$(ginkgo version 2>/dev/null | sed -e 's/.* //')" = "${CSI_PROW_GINKGO_VERSION}" ]; then | ||||||
|         return |         return | ||||||
|  | @ -940,7 +950,9 @@ install_e2e () { | ||||||
|         patch_kubernetes "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_WORK}" && |         patch_kubernetes "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_WORK}" && | ||||||
|         go_version="${CSI_PROW_GO_VERSION_E2E:-$(go_version_for_kubernetes "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_E2E_VERSION}")}" && |         go_version="${CSI_PROW_GO_VERSION_E2E:-$(go_version_for_kubernetes "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" "${CSI_PROW_E2E_VERSION}")}" && | ||||||
|         run_with_go "$go_version" make WHAT=test/e2e/e2e.test "-C${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" && |         run_with_go "$go_version" make WHAT=test/e2e/e2e.test "-C${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" && | ||||||
|         ln -s "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}/_output/bin/e2e.test" "${CSI_PROW_WORK}" |         ln -s "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}/_output/bin/e2e.test" "${CSI_PROW_WORK}" && | ||||||
|  |         run_with_go "$go_version" make WHAT=vendor/github.com/onsi/ginkgo/ginkgo "-C${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" && | ||||||
|  |         ln -s "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}/_output/bin/ginkgo" "${CSI_PROW_BIN}" | ||||||
|     else |     else | ||||||
|         run_with_go "${CSI_PROW_GO_VERSION_E2E}" go test -c -o "${CSI_PROW_WORK}/e2e.test" "${CSI_PROW_E2E_IMPORT_PATH}/test/e2e" |         run_with_go "${CSI_PROW_GO_VERSION_E2E}" go test -c -o "${CSI_PROW_WORK}/e2e.test" "${CSI_PROW_E2E_IMPORT_PATH}/test/e2e" | ||||||
|     fi |     fi | ||||||
|  | @ -1254,7 +1266,8 @@ main () { | ||||||
|         fi |         fi | ||||||
| 
 | 
 | ||||||
|         if tests_need_non_alpha_cluster; then |         if tests_need_non_alpha_cluster; then | ||||||
|             start_cluster || die "starting the non-alpha cluster failed" |             # Need to (re)create the cluster. | ||||||
|  |             start_cluster "${CSI_PROW_E2E_GATES}" || die "starting the non-alpha cluster failed" | ||||||
| 
 | 
 | ||||||
|             # Install necessary snapshot CRDs and snapshot controller |             # Install necessary snapshot CRDs and snapshot controller | ||||||
|             install_snapshot_crds |             install_snapshot_crds | ||||||
|  | @ -1304,7 +1317,11 @@ main () { | ||||||
|             delete_cluster_inside_prow_job non-alpha |             delete_cluster_inside_prow_job non-alpha | ||||||
|         fi |         fi | ||||||
| 
 | 
 | ||||||
|         if tests_need_alpha_cluster && [ "${CSI_PROW_E2E_ALPHA_GATES}" ]; then |         # If the cluster for alpha tests doesn't need any feature gates, then we | ||||||
|  |         # could reuse the same cluster as for the other tests. But that would make | ||||||
|  |         # the flow in this script harder and wouldn't help in practice because | ||||||
|  |         # we have separate Prow jobs for alpha and non-alpha tests. | ||||||
|  |         if tests_need_alpha_cluster; then | ||||||
|             # Need to (re)create the cluster. |             # Need to (re)create the cluster. | ||||||
|             start_cluster "${CSI_PROW_E2E_ALPHA_GATES}" || die "starting alpha cluster failed" |             start_cluster "${CSI_PROW_E2E_ALPHA_GATES}" || die "starting alpha cluster failed" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue