diff --git a/integration-tests/pipelines/e2e-main-pipeline.yaml b/integration-tests/pipelines/e2e-main-pipeline.yaml index 26d3dab72..be4219908 100644 --- a/integration-tests/pipelines/e2e-main-pipeline.yaml +++ b/integration-tests/pipelines/e2e-main-pipeline.yaml @@ -27,6 +27,10 @@ spec: description: 'The number of replicas for the cluster nodes.' default: "3" type: string + - name: cluster-provider + description: 'Cluster provider to use for testing. Valid values: "rosa" or "hive"' + type: string + default: "hive" tasks: - name: test-metadata taskRef: @@ -65,9 +69,9 @@ spec: resolver: git params: - name: url - value: https://github.com/redhat-appstudio/tssc-cli.git + value: https://github.com/rhopp/tssc-cli.git - name: revision - value: main + value: hive-try3 - name: pathInRepo value: integration-tests/tasks/start-pipelines.yaml params: @@ -87,6 +91,8 @@ spec: value: $(params.ocp-instance-type) - name: ocp-replicas value: $(params.ocp-replicas) + - name: cluster-provider + value: $(params.cluster-provider) - name: context-pipeline-run-name value: $(context.pipelineRun.name) finally: diff --git a/integration-tests/pipelines/tssc-cli-e2e-hive.yaml b/integration-tests/pipelines/tssc-cli-e2e-hive.yaml new file mode 100644 index 000000000..962a720e8 --- /dev/null +++ b/integration-tests/pipelines/tssc-cli-e2e-hive.yaml @@ -0,0 +1,275 @@ +--- +apiVersion: tekton.dev/v1 +kind: Pipeline +metadata: + name: tssc-install-e2e +spec: + description: |- + This pipeline automates the process of running end-to-end tests for TSSC + using Hive cluster provisioning. The pipeline provisions the cluster, + installs TSSC using the installer, runs the tests, collects artifacts, + and finally deprovisions the cluster. + params: + - name: test-name + description: 'The name of the test corresponding to a defined Konflux integration test.' + default: '' + type: string + - name: ocp-version + description: 'The OpenShift version to use for the ephemeral cluster deployment (for future use).' + type: string + default: "" + - name: job-spec + type: string + - name: konflux-test-infra-secret + description: The name of secret where testing infrastructures credentials are stored. + type: string + - name: rhads-config + type: string + description: "The rhads-config file in string format." + - name: tssc-image + type: string + description: "Image from where the `tssc` binary will be extracted (from path /usr/local/bin)." + default: "quay.io/redhat-user-workloads/rhtap-shared-team-tenant/tssc-cli:latest" + - name: tssc-test-image + type: string + description: "Image from where the `tssc-test` binary will be extracted (from path /usr/local/bin)." + default: "quay.io/redhat-user-workloads/rhtap-shared-team-tenant/tssc-test:latest" + - name: testplan + type: string + description: 'Optional testplan.json content encoded in base64 format. If not provided, testplan will be downloaded from the repository.' + default: "" + - name: ui-error-strategy + type: string + description: 'Error handling strategy for UI tests' + default: "continue" + - name: install-params + type: string + description: 'Additional parameters for installation testing (e.g., PRE_RELEASE=TAS TAS_VERSION=1.3.2). When empty, does not alter normal installation.' + default: "" + tasks: + - name: provision-hive + taskRef: + resolver: git + params: + - name: url + value: https://github.com/rhopp/tssc-cli.git + - name: revision + value: hive-try3 + - name: pathInRepo + value: integration-tests/tasks/provision-hive.yaml + params: + - name: cluster-name + value: "$(context.pipelineRun.name)" + - name: ocp-version + value: "$(params.ocp-version)" + - name: tssc-install + runAfter: + - provision-hive + taskRef: + resolver: git + params: + - name: url + value: https://github.com/rhopp/tssc-cli.git + - name: revision + value: hive-try3 + - name: pathInRepo + value: integration-tests/tasks/tssc-install.yaml + params: + - name: ocp-login-command + value: "$(tasks.provision-hive.results.ocp-login-command)" + - name: job-spec + value: "$(params.job-spec)" + - name: rhads-config + value: $(params.rhads-config) + - name: tssc-image + value: $(params.tssc-image) + - name: install-params + value: $(params.install-params) + - name: sprayproxy-provision + runAfter: + - tssc-install + taskRef: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/tekton-integration-catalog.git + - name: revision + value: main + - name: pathInRepo + value: tasks/sprayproxy/sprayproxy-provision/0.1/sprayproxy-provision.yaml + params: + - name: ocp-login-command + value: "$(tasks.provision-hive.results.ocp-login-command)" + - name: tssc-e2e-tests + runAfter: + - sprayproxy-provision + taskRef: + resolver: git + params: + - name: url + value: https://github.com/redhat-appstudio/tssc-test.git + - name: revision + value: main + - name: pathInRepo + value: integration-tests/tasks/tssc-e2e.yaml + params: + - name: job-spec + value: $(params.job-spec) + - name: ocp-login-command + value: "$(tasks.provision-hive.results.ocp-login-command)" + - name: oci-container + value: "quay.io/konflux-test-storage/rhtap-team/rhtap-cli:$(context.pipelineRun.name)" + - name: tssc-test-image + value: $(params.tssc-test-image) + - name: testplan + value: $(params.testplan) + - name: rhtap-ui-tests + runAfter: + - tssc-e2e-tests + onError: $(params.ui-error-strategy) + taskRef: + resolver: git + params: + - name: url + value: https://github.com/redhat-appstudio/tssc-test.git + - name: revision + value: main + - name: pathInRepo + value: integration-tests/tasks/tssc-ui.yaml + params: + - name: job-spec + value: $(params.job-spec) + - name: ocp-login-command + value: "$(tasks.provision-hive.results.ocp-login-command)" + - name: oci-container + value: "quay.io/konflux-test-storage/rhtap-team/rhtap-cli:$(context.pipelineRun.name)" + - name: tssc-test-image + value: "$(params.tssc-test-image)" + - name: testplan + value: $(params.testplan) + finally: + - name: deprovision-hive + taskSpec: + params: + - name: cluster-name + type: string + description: "Name of the cluster claim to delete" + volumes: + - name: hive-creds-volume + secret: + secretName: rhopp-test + - name: credentials + emptyDir: {} + steps: + - name: deprovision-hive + image: registry.redhat.io/openshift4/ose-cli@sha256:15da03b04318bcc842060b71e9dd6d6c2595edb4e8fdd11b0c6781eeb03ca182 + volumeMounts: + - name: hive-creds-volume + mountPath: /usr/local/hive-creds + script: | + #!/usr/bin/bash + set -x + oc login $(cat /usr/local/hive-creds/kube_api_url) -u cluster-admin -p $(cat /usr/local/hive-creds/password) + oc whoami + echo "/me Acting like I'm deleting a clusterclaim. tehehe" + oc delete clusterclaims.hive.openshift.io $(params.cluster-name) -n hive + params: + - name: cluster-name + value: "$(context.pipelineRun.name)" + - name: sprayproxy-deprovision + when: + - input: "$(tasks.sprayproxy-provision.status)" + operator: in + values: + - "Succeeded" + taskRef: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/tekton-integration-catalog.git + - name: revision + value: main + - name: pathInRepo + value: tasks/sprayproxy/sprayproxy-deprovision/0.1/sprayproxy-deprovision.yaml + params: + - name: ocp-login-command + value: "$(tasks.provision-hive.results.ocp-login-command)" + - name: pull-request-status-message + taskRef: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/tekton-integration-catalog.git + - name: revision + value: main + - name: pathInRepo + value: tasks/pull-request-comment/0.2/pull-request-comment.yaml + params: + - name: test-name + value: "$(context.pipelineRun.name)" + - name: oci-container + value: "quay.io/konflux-test-storage/rhtap-team/rhtap-cli:$(context.pipelineRun.name)" + - name: pipeline-aggregate-status + value: "$(tasks.status)" + - name: job-spec + value: "$(params.job-spec)" + - name: store-pipeline-status + taskRef: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/tekton-integration-catalog.git + - name: revision + value: main + - name: pathInRepo + value: tasks/store-pipeline-status/0.1/store-pipeline-status.yaml + params: + - name: oci-ref + value: "quay.io/konflux-test-storage/rhtap-team/rhtap-cli:$(context.pipelineRun.name)" + - name: credentials-secret-name + value: "$(params.konflux-test-infra-secret)" + - name: pipeline-aggregate-status + value: $(tasks.status) + - name: pipelinerun-name + value: $(context.pipelineRun.name) + - name: collect-hive-artifacts + taskSpec: + volumes: + - name: konflux-test-infra-volume + secret: + secretName: "$(params.konflux-test-infra-secret)" + steps: + - name: collect-hive-artifacts + workingDir: /workspace/cluster-artifacts + onError: continue + image: quay.io/konflux-qe-incubator/konflux-qe-tools:latest + script: | + #!/bin/sh + $(tasks.provision-hive.results.ocp-login-command) + + curl -sSL https://raw.githubusercontent.com/konflux-ci/konflux-qe-definitions/main/scripts/gather-extra.sh | bash + when: + - input: $(tasks.status) + operator: notin + values: ["Succeeded"] + - name: secure-push-oci + ref: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/tekton-integration-catalog.git + - name: revision + value: main + - name: pathInRepo + value: stepactions/secure-push-oci/0.1/secure-push-oci.yaml + params: + - name: workdir-path + value: /workspace + - name: oci-ref + value: "quay.io/konflux-test-storage/rhtap-team/rhtap-cli:$(context.pipelineRun.name)" + - name: credentials-volume-name + value: konflux-test-infra-volume + when: + - input: $(tasks.status) + operator: notin + values: ["Succeeded"] diff --git a/integration-tests/pipelines/tssc-cli-e2e.yaml b/integration-tests/pipelines/tssc-cli-e2e-rosa.yaml similarity index 94% rename from integration-tests/pipelines/tssc-cli-e2e.yaml rename to integration-tests/pipelines/tssc-cli-e2e-rosa.yaml index 8fdbee1b3..72e9ae6e4 100644 --- a/integration-tests/pipelines/tssc-cli-e2e.yaml +++ b/integration-tests/pipelines/tssc-cli-e2e-rosa.yaml @@ -1,5 +1,5 @@ --- -apiVersion: tekton.dev/v1 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: tssc-install-e2e @@ -46,14 +46,6 @@ spec: type: string description: 'Optional testplan.json content encoded in base64 format. If not provided, testplan will be downloaded from the repository.' default: "" - - name: ui-error-strategy - type: string - description: 'Error handling strategy for UI tests' - default: "continue" - - name: install-params - type: string - description: 'Additional parameters for installation testing (e.g., PRE_RELEASE=TAS TAS_VERSION=1.3.2). When empty, does not alter normal installation.' - default: "" tasks: - name: rosa-hcp-metadata taskRef: @@ -113,8 +105,6 @@ spec: value: $(params.rhads-config) - name: tssc-image value: $(params.tssc-image) - - name: install-params - value: $(params.install-params) - name: sprayproxy-provision runAfter: - tssc-install @@ -156,7 +146,7 @@ spec: - name: rhtap-ui-tests runAfter: - tssc-e2e-tests - onError: $(params.ui-error-strategy) + onError: continue taskRef: resolver: git params: diff --git a/integration-tests/scripts/install.sh b/integration-tests/scripts/install.sh index b76d598dd..718e16a04 100755 --- a/integration-tests/scripts/install.sh +++ b/integration-tests/scripts/install.sh @@ -436,6 +436,43 @@ configure_integrations() { kubectl -n tssc get secret 2>/dev/null | grep -E "(github|gitlab|bitbucket|acs|trustification)" || echo " (some secrets may not exist yet)" } +wait_for() { + local command="${1}" + local description="${2}" + local timeout="${3}" + local interval="${4}" + printf "Waiting for %s for %s...\n" "${description}" "${timeout}" + timeout --foreground "${timeout}" bash -c " + set -x + until ${command} + do + printf \"Waiting for %s... Trying again in ${interval}s\n\" \"${description}\" + sleep ${interval} + done + set +x + " || return 1 + printf "%s finished!\n" "${description}" +} + +updateCert() { + set -x + kubectl create configmap root-ca -n openshift-config --from-literal=ca-bundle.crt="$(kubectl get configmap "kube-root-ca.crt" -o=json |jq -r '.data["ca.crt"]')" + BASE_DOMAIN=$(oc get ingress.config.openshift.io cluster -o jsonpath='{.spec.domain}') + REGISTRY_URL="rhtap-quay-quay-rhtap-quay.$BASE_DOMAIN" + # REGISTRY=$(oc get routes/rhtap-quay-quay -n rhtap-quay -o jsonpath="{.spec.host}") + kubectl create configmap root-ca-image -n openshift-config --from-literal="$REGISTRY_URL"="$(kubectl get configmap "kube-root-ca.crt" -o=json |jq -r '.data["ca.crt"]')" + kubectl get cm root-ca -n openshift-config + oc patch proxy/cluster --type=merge --patch='{"spec":{"trustedCA":{"name":"root-ca"}}}' + oc patch image.config/cluster --type=merge --patch='{"spec":{"additionalTrustedCA":{"name":"root-ca-image"}}}' + + sleep 5 + oc get co + wait_for "kubectl get clusteroperators -A" "cluster operators to be accessible" "10m" "30" + echo "[INFO] Cluster operators were updated." + set +x +} + + install_tssc() { echo "[INFO] Start installing TSSC" if [[ -n "${PRE_RELEASE:-}" ]]; then @@ -449,6 +486,19 @@ install_tssc() { cat "$tpl_file" set +x + updateCert + + jenkins_integration + azure_integration + tpa_integration + acs_integration + github_integration + gitlab_integration + bitbucket_integration + quay_integration + artifactory_integration + nexus_integration + echo "[INFO] Running 'tssc deploy' command..." set -x "${TSSC_BINARY}" deploy --timeout 35m --values-template "$tpl_file" --kube-config "$KUBECONFIG" diff --git a/integration-tests/tasks/provision-hive.yaml b/integration-tests/tasks/provision-hive.yaml new file mode 100644 index 000000000..1db210423 --- /dev/null +++ b/integration-tests/tasks/provision-hive.yaml @@ -0,0 +1,323 @@ +--- +apiVersion: tekton.dev/v1 +kind: Task +metadata: + name: provision-hive +spec: + params: + - name: cluster-name + type: string + description: "Name to use for the cluster claim" + - name: ocp-version + type: string + description: "OpenShift version in format 4.xx (e.g., 4.18)" + results: + - name: ocp-login-command + description: "OCP login command for accessing the provisioned cluster" + volumes: + - name: hive-creds-volume + secret: + secretName: rhopp-test + - name: credentials + emptyDir: {} + steps: + - name: claim-cluster + image: registry.redhat.io/openshift4/ose-cli@sha256:15da03b04318bcc842060b71e9dd6d6c2595edb4e8fdd11b0c6781eeb03ca182 + volumeMounts: + - name: hive-creds-volume + mountPath: /usr/local/hive-creds + script: | + #!/usr/bin/bash + # Convert ocp-version format (4.xx) to clusterpool name (clusterpool4xx) + CLUSTERPOOL_NAME="clusterpool$(echo $(params.ocp-version) | tr -d '.')" + echo "Using cluster pool: $CLUSTERPOOL_NAME" + + oc login $(cat /usr/local/hive-creds/kube_api_url) -u cluster-admin -p $(cat /usr/local/hive-creds/password) + oc whoami + oc get clusterpool "$CLUSTERPOOL_NAME" -n hive + oc create -f - < $(results.ocp-login-command.path) + + kubeconfig_secret=$(oc get clusterdeployment -n $cp_namespace $cp_namespace -o jsonpath={.spec.clusterMetadata.adminKubeconfigSecretRef.name}) + + oc get secret -n $cp_namespace $kubeconfig_secret -o jsonpath={.data.kubeconfig} |base64 -d > /tmp/ephemereal.config + export KUBECONFIG=/tmp/ephemereal.config + + # --- Cluster Provisioning Retry Loop --- + provisioning_max_retries=3 + provisioning_successful=false + + for ((provisioning_attempt=1; provisioning_attempt<=provisioning_max_retries; provisioning_attempt++)); do + echo "=== Cluster Provisioning Attempt $provisioning_attempt of $provisioning_max_retries ===" + + # Reset flags for this attempt + csr_max_retries=5 + csr_sleep_duration=10 + approved_csrs=false + + console_max_retries=30 + console_sleep_duration=10 + console_connect_timeout=10 + console_accessible=false + + echo "--- Starting CSR Approval Process ---" + for ((i=1; i<=csr_max_retries; i++)); do + echo "CSR Attempt $i of $csr_max_retries: Checking for pending CSRs..." + if ! oc get csr 2>/dev/null | grep -i Pending; then + echo "No pending CSRs found. Continuing" + approved_csrs=true + break + else + echo "There are pending CSRs. That probably means cluster was hibernated for more than 24 hours. Need to approve them (until OCPBUGS-55339 is resolved)" + if oc get csr -oname | xargs oc adm certificate approve; then + echo "Successfully submitted approval for CSRs on attempt $i." + sleep 60 # Small delay for changes to propagate + if ! oc get csr 2>/dev/null | grep -i Pending; then + echo "Confirmed no pending CSRs after approval." + approved_csrs=true + break + else + echo "Pending CSRs still exist after approval attempt $i." + fi + else + echo "Failed to run approval command for CSRs on attempt $i." + fi + fi + + if [[ "$i" -lt "$csr_max_retries" ]]; then + echo "Sleeping for $csr_sleep_duration seconds before next CSR retry..." + sleep "$csr_sleep_duration" + fi + done + + if [[ "$approved_csrs" == "false" ]]; then + echo "Failed to ensure all pending CSRs were approved after $csr_max_retries attempts." + if [[ "$provisioning_attempt" -lt "$provisioning_max_retries" ]]; then + echo "Will retry entire provisioning process..." + continue + else + echo "All provisioning attempts exhausted. Exiting." + exit 1 + fi + fi + echo "CSR check and approval process completed successfully." + echo "--- CSR Approval Process Finished ---" + + # --- Console URL Accessibility Check --- + echo "--- Starting Console Accessibility Check ---" + + oc whoami + console_url=$(oc whoami --show-console) + echo "Console URL: $console_url" + + if [[ -z "$console_url" ]]; then + echo "Error: Could not retrieve OpenShift console URL." + if [[ "$provisioning_attempt" -lt "$provisioning_max_retries" ]]; then + echo "Will retry entire provisioning process..." + continue + else + echo "All provisioning attempts exhausted. Exiting." + exit 1 + fi + else + echo "Console URL found: $console_url" + for ((j=1; j<=console_max_retries; j++)); do + echo "Console Check Attempt $j of $console_max_retries: Checking console URL accessibility..." + if curl -k --silent --output /dev/null --head --fail --connect-timeout "$console_connect_timeout" "$console_url"; then + echo "Console URL $console_url is accessible (HTTP 2xx)." + console_accessible=true + break + else + curl_exit_code=$? + echo "Console URL $console_url not accessible on attempt $j (curl exit code: $curl_exit_code)." + fi + + if [[ "$j" -lt "$console_max_retries" ]]; then + echo "Sleeping for $console_sleep_duration seconds before next console check retry..." + sleep "$console_sleep_duration" + fi + done + + if [[ "$console_accessible" == "false" ]]; then + echo "Failed to access console URL $console_url after $console_max_retries attempts." + if [[ "$provisioning_attempt" -lt "$provisioning_max_retries" ]]; then + echo "Will retry entire provisioning process..." + continue + else + echo "All provisioning attempts exhausted. Exiting." + exit 1 + fi + fi + fi + echo "Console is ready. Continuing." + echo "--- Console Accessibility Check Finished ---" + + # --- OC Login Retry Loop --- + echo "--- Starting OC Login Process ---" + login_max_retries=30 # 5 minutes with 10-second intervals + login_sleep_duration=10 + login_successful=false + + for ((k=1; k<=login_max_retries; k++)); do + echo "OC Login Attempt $k of $login_max_retries: Attempting to login with kubeadmin..." + if oc login --insecure-skip-tls-verify=true "$api_url" -u kubeadmin -p "$kubeadminpass" 2>&1; then + echo "Successfully logged in as kubeadmin on attempt $k." + # Wait a moment for the authentication to fully propagate + sleep 2 + # Verify login with whoami and capture the output + whoami_output=$(oc whoami 2>&1) + whoami_exit_code=$? + if [[ "$whoami_exit_code" -eq 0 ]] && [[ -n "$whoami_output" ]]; then + echo "Confirmed login - current user: $whoami_output" + # Additional verification: try a simple cluster command that requires authentication + if oc get namespaces >/dev/null 2>&1; then + echo "Login verification successful - can execute cluster commands." + login_successful=true + break + else + echo "Login succeeded but cannot execute cluster commands on attempt $k." + fi + else + echo "Login succeeded but 'oc whoami' failed on attempt $k (exit code: $whoami_exit_code, output: '$whoami_output')." + fi + else + oc_login_exit_code=$? + echo "OC login failed on attempt $k (exit code: $oc_login_exit_code)." + fi + + if [[ "$k" -lt "$login_max_retries" ]]; then + echo "Sleeping for $login_sleep_duration seconds before next login retry..." + sleep "$login_sleep_duration" + fi + done + + if [[ "$login_successful" == "false" ]]; then + echo "Failed to login with kubeadmin after $login_max_retries attempts." + if [[ "$provisioning_attempt" -lt "$provisioning_max_retries" ]]; then + echo "Will retry entire provisioning process..." + continue + else + echo "All provisioning attempts exhausted. Exiting." + exit 1 + fi + fi + echo "OC login completed successfully." + echo "--- OC Login Process Finished ---" + + # If we reach here, CSR approval, console accessibility, and OC login all succeeded + provisioning_successful=true + echo "=== Cluster Provisioning Completed Successfully on Attempt $provisioning_attempt ===" + break + done + + if [[ "$provisioning_successful" == "false" ]]; then + echo "Cluster provisioning failed after $provisioning_max_retries attempts." + exit 1 + fi + + # --- Cluster Stability Observation --- + echo "--- Starting Cluster Stability Observation ---" + observation_duration=60 # 10 minutes + observation_interval=5 # Check every 5 seconds + observation_iterations=$((observation_duration / observation_interval)) + + co_success=0 + co_failure=0 + console_success=0 + console_failure=0 + api_success=0 + api_failure=0 + + co_pattern="" + console_pattern="" + api_pattern="" + + echo "Will perform $observation_iterations observations over $observation_duration seconds" + echo "Observation interval: ${observation_interval}s" + echo "" + + for ((obs=1; obs<=observation_iterations; obs++)); do + timestamp=$(date '+%Y-%m-%d %H:%M:%S') + + # Test 1: Cluster Operators + if oc get co >/dev/null 2>&1; then + ((co_success++)) + co_pattern="${co_pattern}S" + else + ((co_failure++)) + co_pattern="${co_pattern}F" + echo "[$timestamp] Observation $obs: FAILURE - oc get co failed" + fi + + # Test 2: Console URL accessibility + if curl -k --silent --output /dev/null --head --fail --connect-timeout 5 "$console_url"; then + ((console_success++)) + console_pattern="${console_pattern}S" + else + ((console_failure++)) + console_pattern="${console_pattern}F" + echo "[$timestamp] Observation $obs: FAILURE - console URL not accessible" + fi + + # Test 3: API server (namespaces) + if oc get namespaces >/dev/null 2>&1; then + ((api_success++)) + api_pattern="${api_pattern}S" + else + ((api_failure++)) + api_pattern="${api_pattern}F" + echo "[$timestamp] Observation $obs: FAILURE - oc get namespaces failed" + fi + + # Print progress every 20 observations (approximately every 100 seconds) + if (( obs % 20 == 0 )); then + echo "[$timestamp] Progress: $obs/$observation_iterations observations completed" + fi + + # Sleep between observations (except on the last iteration) + if [[ "$obs" -lt "$observation_iterations" ]]; then + sleep "$observation_interval" + fi + done + + echo "" + echo "=== Cluster Stability Observation Results ===" + echo "Total observations: $observation_iterations" + echo "" + echo "Cluster Operators (oc get co):" + echo " Success: $co_success, Failures: $co_failure" + echo " Pattern: $co_pattern" + echo "" + echo "Console URL accessibility:" + echo " Success: $console_success, Failures: $console_failure" + echo " Pattern: $console_pattern" + echo "" + echo "API Server (oc get namespaces):" + echo " Success: $api_success, Failures: $api_failure" + echo " Pattern: $api_pattern" + echo "" + echo "--- Cluster Stability Observation Finished ---" + + # Show current cluster operator status for reference + echo "" + echo "Final cluster operator status:" + oc get co diff --git a/integration-tests/tasks/start-pipelines.yaml b/integration-tests/tasks/start-pipelines.yaml index 311e8b3e8..5c839b122 100644 --- a/integration-tests/tasks/start-pipelines.yaml +++ b/integration-tests/tasks/start-pipelines.yaml @@ -44,6 +44,10 @@ spec: description: "Additional parameters for installation testing (e.g., PRE_RELEASE=TAS TAS_VERSION=1.3.2). When empty, does not alter normal installation." type: string default: "" + - name: cluster-provider + description: 'Cluster provider to use for testing. Valid values: "rosa" or "hive"' + type: string + default: "hive" - name: context-pipeline-run-name description: "Context pipeline run name for labeling" type: string @@ -75,6 +79,8 @@ spec: value: $(params.ocp-replicas) - name: INSTALL_PARAMS value: $(params.install-params) + - name: CLUSTER_PROVIDER + value: $(params.cluster-provider) - name: KONFLUX_NAMESPACE valueFrom: fieldRef: @@ -153,9 +159,6 @@ spec: "--param" "konflux-test-infra-secret=$KONFLUX_TEST_INFRA_SECRET" "--param" "rhads-config=$config" "--param" "testplan=${testplan_b64:-}" - "--param" "cloud-credential-key=$CLOUD_CREDENTIAL_KEY" - "--param" "machine-type=$OCP_INSTANCE_TYPE" - "--param" "replicas=$OCP_REPLICAS" ) # Add install params if provided @@ -163,6 +166,15 @@ spec: tkn_params+=("--param" "install-params=$INSTALL_PARAMS") fi + # Add ROSA-specific parameters only when using ROSA + if [[ "$CLUSTER_PROVIDER" == "rosa" ]]; then + tkn_params+=( + "--param" "cloud-credential-key=$CLOUD_CREDENTIAL_KEY" + "--param" "machine-type=$OCP_INSTANCE_TYPE" + "--param" "replicas=$OCP_REPLICAS" + ) + fi + # Add optional image parameters if [[ "${tssc_image}" != "" ]]; then tkn_params+=("--param" "tssc-image=${tssc_image}") @@ -196,7 +208,17 @@ spec: echo "Starting pipeline with testplan (${#testplan_b64} chars): ${testplan_b64:0:50}..." - pipeline_run=$(tkn pipeline start -f https://raw.githubusercontent.com/$REPO_ORG/$REPO/refs/heads/$BRANCH/integration-tests/pipelines/tssc-cli-e2e.yaml "${tkn_params[@]}") + # Choose pipeline file based on cluster provider + if [[ "$CLUSTER_PROVIDER" == "rosa" ]]; then + PIPELINE_FILE="tssc-cli-e2e-rosa.yaml" + elif [[ "$CLUSTER_PROVIDER" == "hive" ]]; then + PIPELINE_FILE="tssc-cli-e2e-hive.yaml" + else + echo "ERROR: Invalid cluster-provider value: '$CLUSTER_PROVIDER'. Valid values are 'rosa' or 'hive'." + exit 1 + fi + echo "Using pipeline file: $PIPELINE_FILE for cluster provider: $CLUSTER_PROVIDER" + pipeline_run=$(tkn pipeline start -f https://raw.githubusercontent.com/$REPO_ORG/$REPO/refs/heads/$BRANCH/integration-tests/pipelines/$PIPELINE_FILE "${tkn_params[@]}") #Verifying Timeout pipeline_timeout=$(oc get pipelinerun "${pipeline_run}" -n "${KONFLUX_NAMESPACE}" -o jsonpath='{.spec.timeouts.pipeline}') echo "Pipeline run timeout set to ${pipeline_timeout}" diff --git a/integration-tests/tasks/tssc-install.yaml b/integration-tests/tasks/tssc-install.yaml index 46b76545c..98a496d16 100644 --- a/integration-tests/tasks/tssc-install.yaml +++ b/integration-tests/tasks/tssc-install.yaml @@ -106,14 +106,15 @@ spec: echo "export pipeline_config=\"$PIPELINE_CONFIG\"" >> ${env_file} echo "export auth_config=\"$AUTH_CONFIG\"" >> ${env_file} - # Check if GIT_REPO is tssc-dev-multi-ci and update Developer Hub catalog url based on PR changes - if [[ "${GIT_REPO}" = "tssc-dev-multi-ci" ]]; then + + # Check if GIT_REPO is tssc-sample-templates and update Developer Hub catalog url based on PR changes + # if [[ "${GIT_REPO}" = "tssc-sample-templates" ]]; then GIT_REVISION="${GIT_REVISION:-$(echo "$JOB_SPEC" | jq -r '.git.commit_sha')}" GIT_URL="${GIT_URL:-$(echo "$JOB_SPEC" | jq -r '.git.source_repo_url')}" - TEST_DH_CATALOG_URL="$GIT_URL/blob/$GIT_REVISION/samples/all.yaml" + TEST_DH_CATALOG_URL="$GIT_URL/blob/$GIT_REVISION/all.yaml" # Update DEVELOPER_HUB_CATALOG_URL value in .ci-env - sed -i "s|^export DEVELOPER_HUB_CATALOG_URL.*|export DEVELOPER_HUB_CATALOG_URL=${TEST_DH_CATALOG_URL}|" "${env_file}" - fi + sed -i "s|^export DEVELOPER_HUB_CATALOG_URL.*|export DEVELOPER_HUB_CATALOG_URL=https://github.com/redhat-appstudio/tssc-sample-templates/blob/main/all.yaml|" "${env_file}" + # fi echo "INFO: .env file for tssc installation" cat ${env_file}