-
Notifications
You must be signed in to change notification settings - Fork 2.2k
openstack-test: migrate CI config to OTE (openshift-tests-extension) #79487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| approvers: | ||
| - openstack-approvers | ||
| reviewers: | ||
| - openstack-reviewers |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,56 @@ | ||||||
| #!/usr/bin/env bash | ||||||
|
|
||||||
| set -Eeuo pipefail | ||||||
|
|
||||||
| export OS_CLIENT_CONFIG_FILE="${SHARED_DIR}/clouds.yaml" | ||||||
| export PATH=/usr/libexec/origin:$PATH | ||||||
|
|
||||||
| declare TEST_ARGS='' | ||||||
|
|
||||||
| # Force the IPv6 endpoint | ||||||
| if [[ "${CONFIG_TYPE}" == *"singlestackv6"* ]]; then | ||||||
| export OS_CLOUD="${OS_CLOUD}-ipv6" | ||||||
| fi | ||||||
|
|
||||||
| # For disconnected or otherwise unreachable environments, we want to | ||||||
| # have steps use an HTTP(S) proxy to reach the API server. This proxy | ||||||
| # configuration file should export HTTP_PROXY, HTTPS_PROXY, and NO_PROXY | ||||||
| # environment variables, as well as their lowercase equivalents (note | ||||||
| # that libcurl doesn't recognize the uppercase variables). | ||||||
| if test -f "${SHARED_DIR}/proxy-conf.sh" | ||||||
| then | ||||||
| # shellcheck disable=SC1090 | ||||||
| source "${SHARED_DIR}/proxy-conf.sh" | ||||||
| fi | ||||||
|
|
||||||
| # Set up the test provider for OpenStack | ||||||
| if test -n "${HTTP_PROXY:-}" -o -n "${HTTPS_PROXY:-}"; then | ||||||
| export TEST_PROVIDER='{"type":"openstack","disconnected":true}' | ||||||
| else | ||||||
| export TEST_PROVIDER='{"type":"openstack"}' | ||||||
| fi | ||||||
|
|
||||||
| # In order for openshift-tests to pull external binary images from the | ||||||
| # payload, we need access enabled to the images on the build farm. In | ||||||
| # order to do that, we need to unset the KUBECONFIG so we talk to the | ||||||
| # build farm, not the cluster under test. | ||||||
| echo "Granting access for image pulling from the build farm..." | ||||||
| KUBECONFIG_BAK=$KUBECONFIG | ||||||
| unset KUBECONFIG | ||||||
| oc adm policy add-role-to-group system:image-puller system:unauthenticated --namespace "${NAMESPACE}" || echo "Warning: Failed to grant image puller access, continuing..." | ||||||
| export KUBECONFIG=$KUBECONFIG_BAK | ||||||
|
|
||||||
| TEST_SUITE="openstack-test/all" | ||||||
|
|
||||||
| if [[ -n "${OPENSTACK_TEST_SKIPS}" ]]; then | ||||||
| TESTS="$(openshift-tests run --dry-run --provider "${TEST_PROVIDER}" "${TEST_SUITE}")" | ||||||
| echo "${TESTS}" | grep -v "${OPENSTACK_TEST_SKIPS}" >/tmp/tests | ||||||
| echo "Skipping tests:" | ||||||
| echo "${TESTS}" | grep "${OPENSTACK_TEST_SKIPS}" || { exit_code=$?; echo 'Error: no tests were found matching the OPENSTACK_TEST_SKIPS regex:'; echo "$OPENSTACK_TEST_SKIPS"; return $exit_code; } | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Line 49 uses 🐛 Proposed fix- echo "${TESTS}" | grep "${OPENSTACK_TEST_SKIPS}" || { exit_code=$?; echo 'Error: no tests were found matching the OPENSTACK_TEST_SKIPS regex:'; echo "$OPENSTACK_TEST_SKIPS"; return $exit_code; }
+ echo "${TESTS}" | grep "${OPENSTACK_TEST_SKIPS}" || { exit_code=$?; echo 'Error: no tests were found matching the OPENSTACK_TEST_SKIPS regex:'; echo "$OPENSTACK_TEST_SKIPS"; exit $exit_code; }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| TEST_ARGS="${TEST_ARGS:-} --file /tmp/tests" | ||||||
| fi | ||||||
|
|
||||||
| openshift-tests run "${TEST_SUITE}" ${TEST_ARGS:-} \ | ||||||
| --provider "${TEST_PROVIDER}" \ | ||||||
| --junit-dir "${ARTIFACT_DIR}/junit" \ | ||||||
| -o "${ARTIFACT_DIR}/e2e.log" | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "path": "openstack/test/openstack-ote/openstack-test-openstack-ote-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "openstack-approvers" | ||
| ], | ||
| "reviewers": [ | ||
| "openstack-reviewers" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| ref: | ||
| as: openstack-test-openstack-ote | ||
| from: tests | ||
| cli: latest | ||
| commands: openstack-test-openstack-ote-commands.sh | ||
| resources: | ||
| requests: | ||
| cpu: "3" | ||
| memory: 600Mi | ||
| limits: | ||
| memory: 10Gi | ||
| env: | ||
| - name: OS_CLOUD | ||
| default: "openstack" | ||
| documentation: Name of cloud to use from ${SHARED_DIR}/clouds.yaml file | ||
| - name: OPENSTACK_TEST_SKIPS | ||
| default: "" | ||
| documentation: | | ||
| Regular expression (POSIX basic regular expression) of tests to skip. | ||
| It is suggested to test the regex to make sure that it matches with the available tests. | ||
| Tests can be listed by using 'openshift-tests run --dry-run (...)'. Sometimes, the tests | ||
| that are printed in Prow won't exactly match the list returned by openshift-tests. | ||
| - name: CONFIG_TYPE | ||
| default: '' | ||
| documentation: | | ||
| The type of config for the environment to deploy. | ||
|
|
||
| * 'dualstack' - Configure the install-config to enable dualstack clusters. | ||
| * 'singlestackv6' - Configure the install-config to enable single-stack v6 clusters. | ||
| documentation: |- | ||
| Runs the OpenShift OpenStack-specific tests using the OTE (OpenShift Tests Extension) | ||
| framework. Tests are discovered and run through openshift-tests which loads the | ||
| openstack-test extension from the release payload. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/release
Length of output: 3188
🏁 Script executed:
Repository: openshift/release
Length of output: 326
🏁 Script executed:
Repository: openshift/release
Length of output: 4353
🏁 Script executed:
Repository: openshift/release
Length of output: 3930
🏁 Script executed:
Repository: openshift/release
Length of output: 43
🏁 Script executed:
Repository: openshift/release
Length of output: 2389
🏁 Script executed:
Repository: openshift/release
Length of output: 920
🏁 Script executed:
Repository: openshift/release
Length of output: 2240
🏁 Script executed:
Repository: openshift/release
Length of output: 3280
🏁 Script executed:
Repository: openshift/release
Length of output: 5674
🏁 Script executed:
Repository: openshift/release
Length of output: 1362
🏁 Script executed:
Repository: openshift/release
Length of output: 709
🏁 Script executed:
Repository: openshift/release
Length of output: 43
🏁 Script executed:
Repository: openshift/release
Length of output: 110
🌐 Web query:
openshift-tests extension binary format discovery💡 Result:
The OpenShift Tests Extension (OTE) framework is a standardized system designed to allow external repositories to contribute tests to the main OpenShift test suite [1]. It does not rely on a specific proprietary binary format for the extension itself; rather, it utilizes standard, executable Go binaries that implement a specific interface provided by the openshift-tests-extension Go module [1][2]. Key aspects of the OTE binary format and discovery include: 1. Binary Structure: An OTE-compatible extension is a standalone Go binary (e.g., cluster-etcd-operator-tests-ext, oc-tests-ext) [3][4]. These binaries are typically built using the Go toolchain and are often packaged within container images for CI/CD integration [3][4][5]. 2. Framework Integration: The binary uses the openshift-tests-extension framework, specifically the registry pattern, to register itself [3][6]. Developers use the extension.NewRegistry and extension.NewExtension functions to define the extension's identity (e.g., "openshift", "payload", "component-name") [3][7]. 3. Discovery and Execution: The OTE framework provides a standardized interface for test discovery and execution [1]. The binary must support commands such as listing available test suites and individual tests, as well as executing them and reporting results in standardized formats like JUnit XML [3][5][2]. 4. Admission and Extraction: Recent developments have introduced infrastructure for the discovery and extraction of non-payload OTE binaries [8]. This includes the TestExtensionAdmission CRD (testextension.redhat.io/v1), which allows the system to manage, classify, and validate permitted versus unpermitted extensions [8]. In summary, there is no unique binary format; OTE extensions are standard executable binaries that adhere to the OTE framework's Go-based API for registration, discovery, and execution [1][2].
Citations:
🏁 Script executed:
Repository: openshift/release
Length of output: 50374
Extract the extension binary for delivery instead of packaging as tarball.
The OTE framework expects executable Go binaries, not tarballs. The current build commands create a tarball (
openstack-test-test-extension.tar.gz) and copy it to/usr/bin/, but this needs to be the extracted binary instead. Either extract the tarball before copying to/usr/bin/:Or copy the binary directly without creating the tarball intermediate:
🤖 Prompt for AI Agents