-
Notifications
You must be signed in to change notification settings - Fork 2.3k
INTEROP-9417: Add acm-tests-clc-smoke step for reduced CLC scope #83359
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
3460c4e
333b641
d41bafa
e48ff5c
e2cdf7b
717f7ef
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,9 @@ | ||
| approvers: | ||
| - cspi-qe-ocp-lp | ||
| - dtthuynh | ||
| - vboulos | ||
| options: {} | ||
| reviewers: | ||
| - cspi-qe-ocp-lp | ||
| - dtthuynh | ||
| - vboulos |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # acm-tests-clc-smoke-ref<!-- omit from toc --> | ||
|
|
||
| ## Table of Contents<!-- omit from toc --> | ||
| - [Purpose](#purpose) | ||
| - [Process](#process) | ||
| - [Requirements](#requirements) | ||
| - [Infrastructure](#infrastructure) | ||
| - [Environment Variables](#environment-variables) | ||
|
|
||
| ## Purpose | ||
|
|
||
| Smoke-scoped variant of [acm-tests-clc-create](../clc-create/README.md) with a right-sized timeout and strict failure handling for OPP interop. | ||
|
|
||
| The full `acm-tests-clc-create` step already creates only 1 AWS managed cluster (~50 min actual runtime) but carries a 28800s (8h) timeout and suppresses failures with `|| :`. This step: | ||
| - Reduces the timeout to 5400s (90 min), giving ~80% headroom over the observed average. | ||
| - Propagates failures so downstream steps (`acm-fetch-managed-clusters`, `acm-opp-app`) fail fast instead of running against a missing cluster. | ||
|
|
||
| > **IMPORTANT** | ||
| > You must use the [acm-tests-clc-destroy-ref](../clc-destroy/README.md) as a post step when using this step. If you do not and succeed in running this step then you will leave clusters running on the ACM QE team's cloud. | ||
|
|
||
| ## Process | ||
|
|
||
| - Copies secret options file needed for test execution. | ||
| - Injects AWS credentials from the cluster profile into options.yaml. | ||
| - Sets dynamic variables based on the provisioned hub cluster. | ||
| - Runs `execute_clc_interop_commands.sh` which invokes Cypress with tag filter `@create+aws+-sno+-@clusterpool` (controlled by `TEST_STAGE=OCPInterop-create` inside the image). | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### Infrastructure | ||
|
|
||
| - An existing OpenShift cluster to act as the target Hub. | ||
| - "advanced-cluster-management" operator installed (see [`install-operators`](../../../install-operators/README.md)). | ||
| - MCH custom resource installed (see [acm-mch step](../mch/README.md)). | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| - Please see [acm-tests-clc-smoke-ref.yaml](acm-tests-clc-smoke-ref.yaml) env section. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| set -euxo pipefail; shopt -s inherit_errexit | ||
|
|
||
| typeset secretsDir="/tmp/secrets" | ||
| typeset optionFile="./options.yaml" | ||
| typeset awsCredFile="${CLUSTER_PROFILE_DIR}/.awscred" | ||
|
|
||
| if [[ "${SKIP_OCP_DEPLOY:-false}" == "true" ]]; then | ||
| cp "${secretsDir}/ci/kubeconfig" "${SHARED_DIR}/kubeconfig" | ||
| cp "${secretsDir}/ci/kubeadmin-password" "${SHARED_DIR}/kubeadmin-password" | ||
| fi | ||
|
|
||
| cp "${secretsDir}/clc-interop/secret-options-yaml" "${optionFile}" | ||
|
|
||
| if [[ -f "${awsCredFile}" ]]; then | ||
| typeset awsAccKeyID= | ||
| typeset awsAccKeyToken= | ||
|
|
||
| set +x | ||
| awsAccKeyID="$(sed -nE 's/^\s*aws_access_key_id\s*=\s*//p;T;q' "${awsCredFile}")" | ||
| awsAccKeyToken="$(sed -nE 's/^\s*aws_secret_access_key\s*=\s*//p;T;q' "${awsCredFile}")" | ||
|
|
||
| if [[ -z "${awsAccKeyID}" ]] || [[ -z "${awsAccKeyToken}" ]]; then | ||
| echo "ERROR: Failed to extract AWS credentials from ${awsCredFile}" 1>&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| yq -o json eval . "${optionFile}" | | ||
| jq -c \ | ||
| --arg awsAccKeyID "${awsAccKeyID}" \ | ||
| --rawfile awsAccKeyToken <(printf '%s' "${awsAccKeyToken}") \ | ||
| ' | ||
| .options.connections.apiKeys.aws|=( | ||
| .awsAccessKeyID=$awsAccKeyID | | ||
| .awsSecretAccessKeyID=($awsAccKeyToken | rtrimstr("\n")) | ||
| ) | ||
| ' | | ||
| yq -p json -o yaml eval . > "${optionFile}.tmp" | ||
| mv -f "${optionFile}.tmp" "${optionFile}" | ||
| set -x | ||
|
|
||
| unset awsAccKeyID awsAccKeyToken | ||
| fi | ||
|
|
||
| set +x | ||
| export CYPRESS_OPTIONS_HUB_PASSWORD= | ||
| CYPRESS_OPTIONS_HUB_PASSWORD="$(cat "${SHARED_DIR}/kubeadmin-password")" | ||
|
|
||
| typeset clcStatus=0 | ||
|
|
||
| CYPRESS_BASE_URL="$(oc whoami --show-console)" \ | ||
| CYPRESS_HUB_API_URL="$(oc whoami --show-server)" \ | ||
| CYPRESS_CLC_OCP_IMAGE_VERSION="$(cat "${secretsDir}/clc/ocp_image_version")" \ | ||
| CLOUD_PROVIDERS="$(cat "${secretsDir}/clc/ocp_cloud_providers")" \ | ||
| bash +x ./execute_clc_interop_commands.sh || clcStatus=$? | ||
|
Comment on lines
+51
to
+55
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. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
file="ci-operator/step-registry/acm/tests/clc-smoke/acm-tests-clc-smoke-commands.sh"
printf '%s\n' '--- target script ---'
cat -n "$file"
printf '%s\n' '--- related files ---'
git ls-files 'ci-operator/step-registry/acm/tests/clc-smoke/*' \
'ci-operator/step-registry/acm/tests/**/*commands.sh' | sed -n '1,120p'
printf '%s\n' '--- relevant call sites and status handling ---'
rg -n -C 4 'execute_clc_interop_commands|clcStatus|ocp_image_version|ocp_cloud_providers|secretsDir|awscred' \
ci-operator/step-registry/acm ci-operator/step-registry 2>/dev/null | sed -n '1,240p'Repository: openshift/release Length of output: 31811 🏁 Script executed: #!/bin/bash
set -euo pipefail
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
mkdir -p "$tmp/bin" "$tmp/secrets/clc"
cat >"$tmp/bin/oc" <<'EOF'
#!/bin/bash
case "$1 $2" in
"whoami --show-console") exit "${FAKE_CONSOLE_STATUS:-0}" ;;
"whoami --show-server") exit "${FAKE_SERVER_STATUS:-0}" ;;
esac
EOF
chmod +x "$tmp/bin/oc"
cat >"$tmp/child.sh" <<'EOF'
#!/bin/bash
printf 'child-started\n'
printf 'console=<%s>\n' "${CYPRESS_BASE_URL-}"
printf 'server=<%s>\n' "${CYPRESS_HUB_API_URL-}"
printf 'version=<%s>\n' "${CYPRESS_CLC_OCP_IMAGE_VERSION-}"
printf 'providers=<%s>\n' "${CLOUD_PROVIDERS-}"
exit 0
EOF
chmod +x "$tmp/child.sh"
printf '%s\n' '--- failed command substitutions still start the child ---'
(
cd "$tmp"
set -euxo pipefail
shopt -s inherit_errexit
typeset clcStatus=0
CYPRESS_BASE_URL="$(FAKE_CONSOLE_STATUS=1 oc whoami --show-console)" \
CYPRESS_HUB_API_URL="$(FAKE_SERVER_STATUS=1 oc whoami --show-server)" \
CYPRESS_CLC_OCP_IMAGE_VERSION="$(cat "$tmp/missing-version")" \
CLOUD_PROVIDERS="$(cat "$tmp/missing-providers")" \
bash +x ./child.sh || clcStatus=$?
printf 'wrapper-status=%s\n' "$clcStatus"
)
printf '%s\n' '--- successful commands that return empty output also pass ---'
(
cd "$tmp"
set -euxo pipefail
shopt -s inherit_errexit
: > "$tmp/empty-version"
: > "$tmp/empty-providers"
typeset clcStatus=0
CYPRESS_BASE_URL="$(oc whoami --show-console)" \
CYPRESS_HUB_API_URL="$(oc whoami --show-server)" \
CYPRESS_CLC_OCP_IMAGE_VERSION="$(cat "$tmp/empty-version")" \
CLOUD_PROVIDERS="$(cat "$tmp/empty-providers")" \
bash +x ./child.sh || clcStatus=$?
printf 'wrapper-status=%s\n' "$clcStatus"
)
printf '%s\n' '--- clcStatus captures only the child status when preflight succeeds ---'
(
cd "$tmp"
set -euxo pipefail
shopt -s inherit_errexit
cat > ./child-fail.sh <<'EOF'
#!/bin/bash
exit 23
EOF
chmod +x ./child-fail.sh
typeset clcStatus=0
CYPRESS_BASE_URL="$(oc whoami --show-console)" \
CYPRESS_HUB_API_URL="$(oc whoami --show-server)" \
CYPRESS_CLC_OCP_IMAGE_VERSION="$(printf '%s' v)" \
CLOUD_PROVIDERS="$(printf '%s' aws)" \
bash +x ./child-fail.sh || clcStatus=$?
printf 'wrapper-status=%s\n' "$clcStatus"
)Repository: openshift/release Length of output: 1958 🏁 Script executed: #!/bin/bash
set -euo pipefail
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
mkdir -p "$tmp/bin"
export PATH="$tmp/bin:$PATH"
cat >"$tmp/bin/oc" <<'EOF'
#!/bin/bash
case "$1 $2" in
"whoami --show-console") exit "${FAKE_CONSOLE_STATUS:-0}" ;;
"whoami --show-server") exit "${FAKE_SERVER_STATUS:-0}" ;;
*) exit 2 ;;
esac
EOF
chmod +x "$tmp/bin/oc"
cat >"$tmp/child.sh" <<'EOF'
#!/bin/bash
printf 'child-started\n'
printf 'console=<%s>\n' "${CYPRESS_BASE_URL-}"
printf 'server=<%s>\n' "${CYPRESS_HUB_API_URL-}"
printf 'version=<%s>\n' "${CYPRESS_CLC_OCP_IMAGE_VERSION-}"
printf 'providers=<%s>\n' "${CLOUD_PROVIDERS-}"
exit 0
EOF
chmod +x "$tmp/child.sh"
printf '%s\n' '--- oc failures and missing files ---'
(
cd "$tmp"
set -euxo pipefail
shopt -s inherit_errexit
typeset clcStatus=0
CYPRESS_BASE_URL="$(FAKE_CONSOLE_STATUS=7 oc whoami --show-console)" \
CYPRESS_HUB_API_URL="$(FAKE_SERVER_STATUS=8 oc whoami --show-server)" \
CYPRESS_CLC_OCP_IMAGE_VERSION="$(cat "$tmp/missing-version")" \
CLOUD_PROVIDERS="$(cat "$tmp/missing-providers")" \
bash +x ./child.sh || clcStatus=$?
printf 'wrapper-status=%s\n' "$clcStatus"
)
printf '%s\n' '--- step requirements and input declarations ---'
for file in \
ci-operator/step-registry/acm/tests/clc-smoke/README.md \
ci-operator/step-registry/acm/tests/clc-smoke/acm-tests-clc-smoke-ref.yaml \
ci-operator/step-registry/acm/tests/clc-smoke/acm-tests-clc-smoke-ref.metadata.json; do
printf '\n--- %s ---\n' "$file"
cat -n "$file"
doneRepository: openshift/release Length of output: 6259 Validate preflight values before starting the child process. A failed 🤖 Prompt for AI Agents |
||
| set -x | ||
|
|
||
| unset CYPRESS_OPTIONS_HUB_PASSWORD | ||
|
|
||
| cp -r reports "${ARTIFACT_DIR}/" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| exit "${clcStatus}" | ||
|
Comment on lines
+60
to
+61
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. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
file="ci-operator/step-registry/acm/tests/clc-smoke/acm-tests-clc-smoke-commands.sh"
printf '%s\n' '--- file ---'
cat -n "$file"
printf '%s\n' '--- relevant references ---'
rg -n --glob '*.sh' 'clcStatus|reports|acm-tests-clc-smoke' ci-operator/step-registry ci-operator | head -200Repository: openshift/release Length of output: 36191 🏁 Script executed: #!/bin/bash
set -euo pipefail
file="ci-operator/step-registry/acm/tests/clc-smoke/acm-tests-clc-smoke-commands.sh"
cat -n "$file"
printf '\n--- related status/report handling ---\n'
rg -n --glob '*.sh' 'clcStatus|reports|acm-tests-clc-smoke' ci-operator/step-registry ci-operator | head -200Repository: openshift/release Length of output: 36433 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- CLC helper files ---'
fd -i 'execute_clc_interop_commands.sh' ci-operator/step-registry/acm
for file in $(fd -i 'execute_clc_interop_commands.sh' ci-operator/step-registry/acm); do
printf '\n--- %s ---\n' "$file"
wc -l "$file"
rg -n -C 3 'reports|mkdir|exit|return' "$file" | head -200
done
printf '%s\n' '--- synthetic status-flow probe ---'
bash -c '
set -euo pipefail
run_original() {
local clcStatus=17
cp() { return 23; }
cp -r reports /artifacts/
exit "${clcStatus}"
}
run_proposed() {
local clcStatus=17
local reportStatus=0
cp() { return 23; }
cp -r reports /artifacts/ || reportStatus=$?
if (( clcStatus != 0 )); then
return "${clcStatus}"
fi
return "${reportStatus}"
}
set +e
run_original
original=$?
run_proposed
proposed_failed_test=$?
printf "original_copy_failure=%d proposed_clc_failure=%d\n" "$original" "$proposed_failed_test"
run_proposed_pass() {
local clcStatus=0
local reportStatus=0
cp() { return 23; }
cp -r reports /artifacts/ || reportStatus=$?
if (( clcStatus != 0 )); then
return "${clcStatus}"
fi
return "${reportStatus}"
}
run_proposed_pass
proposed_report_failure=$?
printf "proposed_report_failure=%d\n" "$proposed_report_failure"
'Repository: openshift/release Length of output: 218 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- CLC helper files ---'
fd -i 'execute_clc_interop_commands.sh' ci-operator/step-registry/acm
for file in $(fd -i 'execute_clc_interop_commands.sh' ci-operator/step-registry/acm); do
printf '\n--- %s ---\n' "$file"
wc -l "$file"
rg -n -C 3 'reports|mkdir|exit|return' "$file" | head -200
done
printf '%s\n' '--- synthetic status-flow probe ---'
bash -c '
set -euo pipefail
run_original() {
local clcStatus=17
cp() { return 23; }
cp -r reports /artifacts/
exit "${clcStatus}"
}
run_proposed() {
local clcStatus=17
local reportStatus=0
cp() { return 23; }
cp -r reports /artifacts/ || reportStatus=$?
if (( clcStatus != 0 )); then
return "${clcStatus}"
fi
return "${reportStatus}"
}
set +e
run_original
original=$?
run_proposed
proposed_clc_failure=$?
printf "original_copy_failure=%d proposed_clc_failure=%d\n" "$original" "$proposed_clc_failure"
run_proposed_pass() {
local clcStatus=0
local reportStatus=0
cp() { return 23; }
cp -r reports /artifacts/ || reportStatus=$?
if (( clcStatus != 0 )); then
return "${clcStatus}"
fi
return "${reportStatus}"
}
run_proposed_pass
proposed_report_failure=$?
printf "proposed_report_failure=%d\n" "$proposed_report_failure"
'Repository: openshift/release Length of output: 218 🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- helper presence ---'
find ci-operator/step-registry/acm -type f -name 'execute_clc_interop_commands.sh' -print
printf '%s\n' '--- tracked files near clc-smoke ---'
git ls-files ci-operator/step-registry/acm/tests/clc-smoke
printf '%s\n' '--- status-flow probe ---'
run_case() {
local name="$1"
local script="$2"
set +e
bash -c "$script"
local rc=$?
set -e
printf '%s=%d\n' "$name" "$rc"
}
run_case original_copy_failure '
set -euo pipefail
clcStatus=17
cp -r /path/that/does/not/exist /tmp/
exit "$clcStatus"
'
run_case proposed_clc_and_copy_failure '
set -euo pipefail
clcStatus=17
reportStatus=0
cp -r /path/that/does/not/exist /tmp/ || reportStatus=$?
if (( clcStatus != 0 )); then
exit "$clcStatus"
fi
exit "$reportStatus"
'
run_case proposed_only_copy_failure '
set -euo pipefail
clcStatus=0
reportStatus=0
cp -r /path/that/does/not/exist /tmp/ || reportStatus=$?
if (( clcStatus != 0 )); then
exit "$clcStatus"
fi
exit "$reportStatus"
'
run_case original_successful_copy '
set -euo pipefail
tmpdir=$(mktemp -d)
trap "rm -rf \"$tmpdir\"" EXIT
mkdir "$tmpdir/reports"
clcStatus=17
cp -r "$tmpdir/reports" "$tmpdir/artifacts"
exit "$clcStatus"
'Repository: openshift/release Length of output: 915 🏁 Script executed: #!/bin/bash
set -u
run_case() {
local name="$1"
local script="$2"
set +e
bash -c "$script"
local rc=$?
set -e
printf '%s=%d\n' "$name" "$rc"
}
run_case original_copy_failure '
set -euo pipefail
clcStatus=17
cp -r /path/that/does/not/exist /tmp/
exit "$clcStatus"
'
run_case proposed_clc_and_copy_failure '
set -euo pipefail
clcStatus=17
reportStatus=0
cp -r /path/that/does/not/exist /tmp/ || reportStatus=$?
if (( clcStatus != 0 )); then
exit "$clcStatus"
fi
exit "$reportStatus"
'
run_case proposed_only_copy_failure '
set -euo pipefail
clcStatus=0
reportStatus=0
cp -r /path/that/does/not/exist /tmp/ || reportStatus=$?
if (( clcStatus != 0 )); then
exit "$clcStatus"
fi
exit "$reportStatus"
'Repository: openshift/release Length of output: 454 Preserve the CLC status when report collection fails. If 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "path": "acm/tests/clc-smoke/acm-tests-clc-smoke-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "cspi-qe-ocp-lp", | ||
| "dtthuynh", | ||
| "vboulos" | ||
| ], | ||
| "reviewers": [ | ||
| "cspi-qe-ocp-lp", | ||
| "dtthuynh", | ||
| "vboulos" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| ref: | ||
| as: acm-tests-clc-smoke | ||
| from: clc-ui-e2e | ||
| commands: acm-tests-clc-smoke-commands.sh | ||
| timeout: 5400s | ||
| best_effort: true | ||
| resources: | ||
| requests: | ||
| cpu: '2' | ||
| memory: 6Gi | ||
| credentials: | ||
| - namespace: test-credentials | ||
| name: opp-acm-clc-credentials | ||
| mount_path: /tmp/secrets/clc-interop | ||
| - namespace: test-credentials | ||
| name: acm-clc-credentials | ||
| mount_path: /tmp/secrets/clc | ||
| - namespace: test-credentials | ||
| name: acm-ci-credentials | ||
| mount_path: /tmp/secrets/ci | ||
| env: | ||
| - name: CYPRESS_OC_IDP | ||
| default: "kube:admin" | ||
| documentation: |- | ||
| Identity | ||
| - name: CYPRESS_OPTIONS_HUB_USER | ||
| default: "kubeadmin" | ||
| documentation: |- | ||
| Hub cluster username | ||
| - name: CYPRESS_SPOKE_CLUSTER | ||
| default: "" | ||
| documentation: |- | ||
| Identify spoke clusters | ||
| - name: BROWSER | ||
| default: "chrome" | ||
| documentation: |- | ||
| Set browser for cypress | ||
| - name: CUSTOMER_TAGS | ||
| default: "" | ||
| documentation: |- | ||
| Cypress grep tag filter (passed through to test execution) | ||
| - name: CYPRESS_CLC_OC_IDP | ||
| default: "clc-e2e-htpasswd" | ||
| documentation: |- | ||
| Serves tests RBAC settings | ||
| - name: CYPRESS_CLC_RBAC_PASS | ||
| default: "test-RBAC-4-e2e" | ||
| documentation: |- | ||
| Serves tests RBAC settings | ||
| - name: CYPRESS_CLC_OCP_IMAGE_REGISTRY | ||
| default: "quay.io/openshift-release-dev/ocp-release" | ||
| documentation: |- | ||
| Image registry | ||
| - name: CYPRESS_ACM_NAMESPACE | ||
| default: "ocm" | ||
| documentation: |- | ||
| Acm namespace | ||
| - name: CYPRESS_MCE_NAMESPACE | ||
| default: "multicluster-engine" | ||
| documentation: |- | ||
| Mce namespace | ||
| - name: IMPORT_KUBERNETES_CLUSTERS | ||
| default: "" | ||
| documentation: |- | ||
| Comma separated list of imports | ||
| - name: SKIP_OCP_DEPLOY | ||
| default: "false" | ||
| documentation: |- | ||
| When true, copies kubeconfig from CI secrets instead of using cluster profile | ||
| documentation: |- | ||
| Smoke-scoped ACM cluster lifecycle step that creates a single managed | ||
| cluster on AWS (~50 min). Runs with best_effort so that CLC failures | ||
| do not block independent downstream validations (ODF health, Quay smoke, | ||
| observability). JUnit results are still reported for failure visibility. |
Uh oh!
There was an error while loading. Please reload this page.