From 9dc4651bcc3f3ee8ac976fd69f2ebb0c6468caf3 Mon Sep 17 00:00:00 2001 From: Kashish Mittal Date: Thu, 5 Dec 2024 17:55:02 -0500 Subject: [PATCH 1/5] chore(e2e): [release-1.4] enable tech radar tests Signed-off-by: Kashish Mittal --- .ibm/pipelines/auth/secrets-rhdh-secrets.yaml | 4 ++-- .ibm/pipelines/env_variables.sh | 4 ++-- .ibm/pipelines/openshift-ci-tests.sh | 4 +++- .../resources/config_map/app-config-rhdh.yaml | 12 ++++++------ .ibm/pipelines/value_files/values_showcase.yaml | 4 ++-- .../dynamic-plugins-info.spec.ts | 6 +++--- .../e2e/plugins/quick-access-and-tech-radar.spec.ts | 2 +- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.ibm/pipelines/auth/secrets-rhdh-secrets.yaml b/.ibm/pipelines/auth/secrets-rhdh-secrets.yaml index 0ec98ab1ed..6f2e592adc 100644 --- a/.ibm/pipelines/auth/secrets-rhdh-secrets.yaml +++ b/.ibm/pipelines/auth/secrets-rhdh-secrets.yaml @@ -29,7 +29,7 @@ data: KEYCLOAK_CLIENT_ID: bXljbGllbnQ= KEYCLOAK_CLIENT_SECRET: dGVtcA== ACR_SECRET: dGVtcA== - DH_TARGET_URL: aHR0cDovL3Rlc3QtYmFja3N0YWdlLWN1c3RvbWl6YXRpb24tcHJvdmlkZXItc2hvd2Nhc2UtY2kucmhkaC1wci1vcy1hOTgwNTY1MDgzMGIyMmMzYWVlMjQzZTUxZDc5NTY1ZC0wMDAwLnVzLWVhc3QuY29udGFpbmVycy5hcHBkb21haW4uY2xvdWQ= + DH_TARGET_URL: dGVzdC1iYWNrc3RhZ2UtY3VzdG9taXphdGlvbi1wcm92aWRlci1zaG93Y2FzZS1jaS5yaGRoLXByLW9zLWE5ODA1NjUwODMwYjIyYzNhZWUyNDNlNTFkNzk1NjVkLTAwMDAudXMtZWFzdC5jb250YWluZXJzLmFwcGRvbWFpbi5jbG91ZA== GOOGLE_CLIENT_ID: dGVtcA== GOOGLE_CLIENT_SECRET: dGVtcA== -type: Opaque +type: Opaque \ No newline at end of file diff --git a/.ibm/pipelines/env_variables.sh b/.ibm/pipelines/env_variables.sh index 7674874619..62460f0620 100755 --- a/.ibm/pipelines/env_variables.sh +++ b/.ibm/pipelines/env_variables.sh @@ -67,7 +67,7 @@ KEYCLOAK_REALM='myrealm' KEYCLOAK_CLIENT_ID='myclient' KEYCLOAK_CLIENT_SECRET=$(cat /tmp/secrets/KEYCLOAK_CLIENT_SECRET) ACR_SECRET=$(cat /tmp/secrets/ACR_SECRET) -DH_TARGET_URL=aHR0cDovL3Rlc3QtYmFja3N0YWdlLWN1c3RvbWl6YXRpb24tcHJvdmlkZXItc2hvd2Nhc2UtY2kucmhkaC1wci1vcy1hOTgwNTY1MDgzMGIyMmMzYWVlMjQzZTUxZDc5NTY1ZC0wMDAwLnVzLWVhc3QuY29udGFpbmVycy5hcHBkb21haW4uY2xvdWQ= +DH_TARGET_URL=dGVzdC1iYWNrc3RhZ2UtY3VzdG9taXphdGlvbi1wcm92aWRlci1zaG93Y2FzZS1jaS5yaGRoLXByLW9zLWE5ODA1NjUwODMwYjIyYzNhZWUyNDNlNTFkNzk1NjVkLTAwMDAudXMtZWFzdC5jb250YWluZXJzLmFwcGRvbWFpbi5jbG91ZA== GOOGLE_CLIENT_ID=$(cat /tmp/secrets/GOOGLE_CLIENT_ID) GOOGLE_CLIENT_SECRET=$(cat /tmp/secrets/GOOGLE_CLIENT_SECRET) GOOGLE_ACC_COOKIE=$(cat /tmp/secrets/GOOGLE_ACC_COOKIE) @@ -107,4 +107,4 @@ GKE_SERVICE_ACCOUNT_NAME=$(cat /tmp/secrets/GKE_SERVICE_ACCOUNT_NAME) GKE_CERT_NAME=$(cat /tmp/secrets/GKE_CERT_NAME) GOOGLE_CLOUD_PROJECT=$(cat /tmp/secrets/GOOGLE_CLOUD_PROJECT) -set +a # Stop automatically exporting variables +set +a # Stop automatically exporting variables \ No newline at end of file diff --git a/.ibm/pipelines/openshift-ci-tests.sh b/.ibm/pipelines/openshift-ci-tests.sh index 3c62cb891a..2ef57af21c 100755 --- a/.ibm/pipelines/openshift-ci-tests.sh +++ b/.ibm/pipelines/openshift-ci-tests.sh @@ -213,6 +213,8 @@ apply_yaml_files() { GITHUB_APP_CLIENT_SECRET=$(cat /tmp/secrets/GITHUB_APP_4_CLIENT_SECRET) fi + DH_TARGET_URL=$(echo -n "test-backstage-customization-provider-${project}.${K8S_CLUSTER_ROUTER_BASE}" | base64 -w 0) + for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN; do sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml" done @@ -512,4 +514,4 @@ main() { exit "${OVERALL_RESULT}" } -main +main \ No newline at end of file diff --git a/.ibm/pipelines/resources/config_map/app-config-rhdh.yaml b/.ibm/pipelines/resources/config_map/app-config-rhdh.yaml index ca054ba60a..ad49b0850c 100644 --- a/.ibm/pipelines/resources/config_map/app-config-rhdh.yaml +++ b/.ibm/pipelines/resources/config_map/app-config-rhdh.yaml @@ -53,6 +53,10 @@ dynamicPlugins: title: Dark Dynamic variant: dark backend: + reading: + allow: + - host: 'github.com' + - host: ${DH_TARGET_URL} auth: keys: - secret: temp @@ -101,17 +105,13 @@ auth: development: clientId: ${GOOGLE_CLIENT_ID} clientSecret: ${GOOGLE_CLIENT_SECRET} +techRadar: + url: "http://${DH_TARGET_URL}/tech-radar" proxy: skipInvalidProxies: true # endpoints: {} endpoints: # Other Proxies - # customize developer hub instance - '/developer-hub': - target: ${DH_TARGET_URL} - changeOrigin: true - # Change to "false" in case of using self hosted cluster with a self-signed certificate - secure: false '/acr/api': target: 'https://rhdhqetest.azurecr.io/acr/v1/' changeOrigin: true diff --git a/.ibm/pipelines/value_files/values_showcase.yaml b/.ibm/pipelines/value_files/values_showcase.yaml index cb5268bf28..d4ad325217 100644 --- a/.ibm/pipelines/value_files/values_showcase.yaml +++ b/.ibm/pipelines/value_files/values_showcase.yaml @@ -94,11 +94,11 @@ global: disabled: false - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import disabled: false - # Enable tech-radar plugin. + # Enable tech-radar plugins. - package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-backend-dynamic - disabled: true + disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-acr disabled: false - package: ./dynamic-plugins/dist/roadiehq-scaffolder-backend-module-http-request-dynamic diff --git a/e2e-tests/playwright/e2e/plugins/dynamic-plugins-info/dynamic-plugins-info.spec.ts b/e2e-tests/playwright/e2e/plugins/dynamic-plugins-info/dynamic-plugins-info.spec.ts index 16b05ae243..1ca59c8b68 100644 --- a/e2e-tests/playwright/e2e/plugins/dynamic-plugins-info/dynamic-plugins-info.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/dynamic-plugins-info/dynamic-plugins-info.spec.ts @@ -38,14 +38,14 @@ test.describe("dynamic-plugins-info UI tests", () => { await uiHelper.verifyRowsInTable(["backstage-plugin-techdocs"], true); }); - test.skip("it should have a backstage-plugin-tech-radar plugin which is Enabled and Preinstalled", async ({ + test("it should have a plugin-tech-radar plugin which is Enabled and Preinstalled", async ({ page, }) => { await page .getByPlaceholder("Filter") - .pressSequentially("backstage-plugin-tech-radar\n", { delay: 300 }); + .pressSequentially("plugin-tech-radar\n", { delay: 300 }); const row = await page.locator( - UIhelperPO.rowByText("backstage-plugin-tech-radar"), + UIhelperPO.rowByText("backstage-community-plugin-tech-radar"), ); expect(await row.locator("td").nth(2).innerText()).toBe("Yes"); // enabled expect(await row.locator("td").nth(3).innerText()).toBe("Yes"); // preinstalled diff --git a/e2e-tests/playwright/e2e/plugins/quick-access-and-tech-radar.spec.ts b/e2e-tests/playwright/e2e/plugins/quick-access-and-tech-radar.spec.ts index ac16669451..981d53e213 100644 --- a/e2e-tests/playwright/e2e/plugins/quick-access-and-tech-radar.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/quick-access-and-tech-radar.spec.ts @@ -6,7 +6,7 @@ import { TechRadar } from "../../support/pages/TechRadar"; // Pre-req: Enable backstage-plugin-tech-radar and backstage-plugin-tech-radar-backend Plugin -test.describe.skip("Test Customized Quick Access and tech-radar plugin", () => { +test.describe("Test Customized Quick Access and tech-radar plugin", () => { test.beforeEach(async ({ page }) => { const common = new Common(page); await common.loginAsGuest(); From 1626017189757a1cd410dd08dc4a429871adb91b Mon Sep 17 00:00:00 2001 From: Kashish Mittal <113269381+04kash@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:00:15 -0500 Subject: [PATCH 2/5] Update openshift-ci-tests.sh --- .ibm/pipelines/openshift-ci-tests.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.ibm/pipelines/openshift-ci-tests.sh b/.ibm/pipelines/openshift-ci-tests.sh index 2ef57af21c..b1af69af23 100755 --- a/.ibm/pipelines/openshift-ci-tests.sh +++ b/.ibm/pipelines/openshift-ci-tests.sh @@ -215,8 +215,7 @@ apply_yaml_files() { DH_TARGET_URL=$(echo -n "test-backstage-customization-provider-${project}.${K8S_CLUSTER_ROUTER_BASE}" | base64 -w 0) - for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN; do - sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml" + for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do done oc apply -f "$dir/resources/service_account/service-account-rhdh.yaml" --namespace="${project}" @@ -514,4 +513,4 @@ main() { exit "${OVERALL_RESULT}" } -main \ No newline at end of file +main From 5668a5182d8b18ef8d6a9e9620da6c850863d538 Mon Sep 17 00:00:00 2001 From: Kashish Mittal <113269381+04kash@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:46:07 -0500 Subject: [PATCH 3/5] Update openshift-ci-tests.sh --- .ibm/pipelines/openshift-ci-tests.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.ibm/pipelines/openshift-ci-tests.sh b/.ibm/pipelines/openshift-ci-tests.sh index b1af69af23..a49fb6b4ac 100755 --- a/.ibm/pipelines/openshift-ci-tests.sh +++ b/.ibm/pipelines/openshift-ci-tests.sh @@ -12,13 +12,11 @@ cleanup() { echo "Cleaning up before exiting" if [[ "$JOB_NAME" == *aks* ]]; then az_aks_stop "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}" - else + elif [[ "$JOB_NAME" == *pull-*-main-e2e-tests* ]]; then # Cleanup namespaces after main branch PR e2e tests execution. delete_namespace "${NAME_SPACE}" delete_namespace "${NAME_SPACE_POSTGRES_DB}" delete_namespace "${NAME_SPACE_RBAC}" - delete_namespace "${NAME_SPACE_RDS}" - delete_namespace "${NAME_SPACE_RUNTIME}" fi rm -rf ~/tmpbin } @@ -36,7 +34,7 @@ set_cluster_info() { export K8S_CLUSTER_URL=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_URL) export K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_TOKEN) - if [[ "$JOB_NAME" == *ocp-v4-14 ]]; then + if [[ "$JOB_NAME" == *ocp-v4-16 ]]; then K8S_CLUSTER_URL=$(cat /tmp/secrets/RHDH_OS_1_CLUSTER_URL) K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/RHDH_OS_1_CLUSTER_TOKEN) elif [[ "$JOB_NAME" == *ocp-v4-15 ]]; then @@ -50,14 +48,14 @@ set_cluster_info() { set_namespace() { if [[ "$JOB_NAME" == *periodic-* ]]; then - NAME_SPACE="showcase-ci-nightly-1-4" - NAME_SPACE_RBAC="showcase-rbac-nightly-1-4" - NAME_SPACE_POSTGRES_DB="postgress-external-db-nightly-1-4" + NAME_SPACE="showcase-ci-nightly" + NAME_SPACE_RBAC="showcase-rbac-nightly" + NAME_SPACE_POSTGRES_DB="postgress-external-db-nightly" NAME_SPACE_K8S="showcase-k8s-ci-nightly" NAME_SPACE_RBAC_K8S="showcase-rbac-k8s-ci-nightly" - elif [[ "$JOB_NAME" == *pull-*-release-1.4-e2e-tests* ]]; then + elif [[ "$JOB_NAME" == *pull-*-main-e2e-tests* ]]; then # Enable parallel PR testing for main branch by utilizing a pool of namespaces - local namespaces_pool=("pr-1-4-1" "pr-1-4-2" "pr-1-4-3") + local namespaces_pool=("pr-1" "pr-2" "pr-3") local namespace_found=false # Iterate through namespace pool to find an available set for ns in "${namespaces_pool[@]}"; do @@ -215,7 +213,8 @@ apply_yaml_files() { DH_TARGET_URL=$(echo -n "test-backstage-customization-provider-${project}.${K8S_CLUSTER_ROUTER_BASE}" | base64 -w 0) - for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do + for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do + sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml" done oc apply -f "$dir/resources/service_account/service-account-rhdh.yaml" --namespace="${project}" @@ -261,7 +260,6 @@ apply_yaml_files() { run_tests() { local release_name=$1 local project=$2 - project=${project%-pr-*} # Remove -pr- suffix if any set for main branchs pr's. cd "${DIR}/../../e2e-tests" yarn install @@ -286,7 +284,11 @@ run_tests() { cp -a /tmp/backstage-showcase/e2e-tests/${JUNIT_RESULTS} "${ARTIFACT_DIR}/${project}/${JUNIT_RESULTS}" if [ -d "/tmp/backstage-showcase/e2e-tests/screenshots" ]; then - cp -a /tmp/backstage-showcase/e2e-tests/screenshots/* "${ARTIFACT_DIR}/${project}/attachments/screenshots/" + cp -a /tmp/backstage-showcase/e2e-tests/screenshots/* "${ARTIFACT_DIR}/${project}/attachments/screenshots/" + fi + + if [ -d "/tmp/backstage-showcase/e2e-tests/auth-providers-logs" ]; then + cp -a /tmp/backstage-showcase/e2e-tests/auth-providers-logs/* "${ARTIFACT_DIR}/${project}/" fi ansi2html <"/tmp/${LOGFILE}" >"/tmp/${LOGFILE}.html" @@ -491,6 +493,8 @@ main() { initiate_rbac_gke_deployment check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}" delete_namespace "${NAME_SPACE_RBAC_K8S}" + elif [[ "$JOB_NAME" == *auth-providers* ]]; then + run_tests "${AUTH_PROVIDERS_RELEASE}" "${AUTH_PROVIDERS_NAMESPACE}" else initiate_deployments check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" From 2314e09f0606458b17a038c6ea6d2dfd5f6d5f26 Mon Sep 17 00:00:00 2001 From: Kashish Mittal <113269381+04kash@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:48:47 -0500 Subject: [PATCH 4/5] Update openshift-ci-tests.sh --- .ibm/pipelines/openshift-ci-tests.sh | 31 +++++++++++++--------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.ibm/pipelines/openshift-ci-tests.sh b/.ibm/pipelines/openshift-ci-tests.sh index a49fb6b4ac..8f45e8821a 100755 --- a/.ibm/pipelines/openshift-ci-tests.sh +++ b/.ibm/pipelines/openshift-ci-tests.sh @@ -12,11 +12,13 @@ cleanup() { echo "Cleaning up before exiting" if [[ "$JOB_NAME" == *aks* ]]; then az_aks_stop "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}" - elif [[ "$JOB_NAME" == *pull-*-main-e2e-tests* ]]; then + else # Cleanup namespaces after main branch PR e2e tests execution. delete_namespace "${NAME_SPACE}" delete_namespace "${NAME_SPACE_POSTGRES_DB}" delete_namespace "${NAME_SPACE_RBAC}" + delete_namespace "${NAME_SPACE_RDS}" + delete_namespace "${NAME_SPACE_RUNTIME}" fi rm -rf ~/tmpbin } @@ -34,7 +36,7 @@ set_cluster_info() { export K8S_CLUSTER_URL=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_URL) export K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/RHDH_PR_OS_CLUSTER_TOKEN) - if [[ "$JOB_NAME" == *ocp-v4-16 ]]; then + if [[ "$JOB_NAME" == *ocp-v4-14 ]]; then K8S_CLUSTER_URL=$(cat /tmp/secrets/RHDH_OS_1_CLUSTER_URL) K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/RHDH_OS_1_CLUSTER_TOKEN) elif [[ "$JOB_NAME" == *ocp-v4-15 ]]; then @@ -48,14 +50,14 @@ set_cluster_info() { set_namespace() { if [[ "$JOB_NAME" == *periodic-* ]]; then - NAME_SPACE="showcase-ci-nightly" - NAME_SPACE_RBAC="showcase-rbac-nightly" - NAME_SPACE_POSTGRES_DB="postgress-external-db-nightly" + NAME_SPACE="showcase-ci-nightly-1-4" + NAME_SPACE_RBAC="showcase-rbac-nightly-1-4" + NAME_SPACE_POSTGRES_DB="postgress-external-db-nightly-1-4" NAME_SPACE_K8S="showcase-k8s-ci-nightly" NAME_SPACE_RBAC_K8S="showcase-rbac-k8s-ci-nightly" - elif [[ "$JOB_NAME" == *pull-*-main-e2e-tests* ]]; then + elif [[ "$JOB_NAME" == *pull-*-release-1.4-e2e-tests* ]]; then # Enable parallel PR testing for main branch by utilizing a pool of namespaces - local namespaces_pool=("pr-1" "pr-2" "pr-3") + local namespaces_pool=("pr-1-4-1" "pr-1-4-2" "pr-1-4-3") local namespace_found=false # Iterate through namespace pool to find an available set for ns in "${namespaces_pool[@]}"; do @@ -213,9 +215,9 @@ apply_yaml_files() { DH_TARGET_URL=$(echo -n "test-backstage-customization-provider-${project}.${K8S_CLUSTER_ROUTER_BASE}" | base64 -w 0) - for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do - sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml" - done + for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do + sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml" + done oc apply -f "$dir/resources/service_account/service-account-rhdh.yaml" --namespace="${project}" oc apply -f "$dir/auth/service-account-rhdh-secret.yaml" --namespace="${project}" @@ -260,6 +262,7 @@ apply_yaml_files() { run_tests() { local release_name=$1 local project=$2 + project=${project%-pr-*} # Remove -pr- suffix if any set for main branchs pr's. cd "${DIR}/../../e2e-tests" yarn install @@ -284,11 +287,7 @@ run_tests() { cp -a /tmp/backstage-showcase/e2e-tests/${JUNIT_RESULTS} "${ARTIFACT_DIR}/${project}/${JUNIT_RESULTS}" if [ -d "/tmp/backstage-showcase/e2e-tests/screenshots" ]; then - cp -a /tmp/backstage-showcase/e2e-tests/screenshots/* "${ARTIFACT_DIR}/${project}/attachments/screenshots/" - fi - - if [ -d "/tmp/backstage-showcase/e2e-tests/auth-providers-logs" ]; then - cp -a /tmp/backstage-showcase/e2e-tests/auth-providers-logs/* "${ARTIFACT_DIR}/${project}/" + cp -a /tmp/backstage-showcase/e2e-tests/screenshots/* "${ARTIFACT_DIR}/${project}/attachments/screenshots/" fi ansi2html <"/tmp/${LOGFILE}" >"/tmp/${LOGFILE}.html" @@ -493,8 +492,6 @@ main() { initiate_rbac_gke_deployment check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}" delete_namespace "${NAME_SPACE_RBAC_K8S}" - elif [[ "$JOB_NAME" == *auth-providers* ]]; then - run_tests "${AUTH_PROVIDERS_RELEASE}" "${AUTH_PROVIDERS_NAMESPACE}" else initiate_deployments check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" From 688860819ac3e092d3f697cd6a2b1018c3fdfa72 Mon Sep 17 00:00:00 2001 From: Kashish Mittal <113269381+04kash@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:54:13 -0500 Subject: [PATCH 5/5] Update openshift-ci-tests.sh --- .ibm/pipelines/openshift-ci-tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ibm/pipelines/openshift-ci-tests.sh b/.ibm/pipelines/openshift-ci-tests.sh index 8f45e8821a..2cc521681c 100755 --- a/.ibm/pipelines/openshift-ci-tests.sh +++ b/.ibm/pipelines/openshift-ci-tests.sh @@ -215,9 +215,9 @@ apply_yaml_files() { DH_TARGET_URL=$(echo -n "test-backstage-customization-provider-${project}.${K8S_CLUSTER_ROUTER_BASE}" | base64 -w 0) - for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do - sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml" - done + for key in GITHUB_APP_APP_ID GITHUB_APP_CLIENT_ID GITHUB_APP_PRIVATE_KEY GITHUB_APP_CLIENT_SECRET GITHUB_APP_JANUS_TEST_APP_ID GITHUB_APP_JANUS_TEST_CLIENT_ID GITHUB_APP_JANUS_TEST_CLIENT_SECRET GITHUB_APP_JANUS_TEST_PRIVATE_KEY GITHUB_APP_WEBHOOK_URL GITHUB_APP_WEBHOOK_SECRET KEYCLOAK_CLIENT_SECRET ACR_SECRET GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET K8S_CLUSTER_TOKEN_ENCODED OCM_CLUSTER_URL GITLAB_TOKEN DH_TARGET_URL; do + sed -i "s|${key}:.*|${key}: ${!key}|g" "$dir/auth/secrets-rhdh-secrets.yaml" + done oc apply -f "$dir/resources/service_account/service-account-rhdh.yaml" --namespace="${project}" oc apply -f "$dir/auth/service-account-rhdh-secret.yaml" --namespace="${project}"