From f5def5aadfecd9755c5172960c1832ed27802940 Mon Sep 17 00:00:00 2001 From: Gustavo Lira e Silva Date: Tue, 17 Dec 2024 17:00:00 -0300 Subject: [PATCH] chore(e2): rhidp-5296 e2e - main nightly job failing on runtime configuration change step (#2117) * RHIDP-5296 e2e - main nightly job failing on runtime configuration change step Signed-off-by: Gustavo Lira * RHIDP-5296 lint format Signed-off-by: Gustavo Lira --------- Signed-off-by: Gustavo Lira --- .../playwright/e2e/configuration-test/config-map.spec.ts | 5 ++++- e2e-tests/playwright/utils/kube-client.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/e2e-tests/playwright/e2e/configuration-test/config-map.spec.ts b/e2e-tests/playwright/e2e/configuration-test/config-map.spec.ts index 45ed55e946..58f57654b1 100644 --- a/e2e-tests/playwright/e2e/configuration-test/config-map.spec.ts +++ b/e2e-tests/playwright/e2e/configuration-test/config-map.spec.ts @@ -9,7 +9,7 @@ test.describe("Change app-config at e2e test runtime", () => { test.setTimeout(300000); // Increasing to 5 minutes const configMapName = "app-config-rhdh"; - const namespace = process.env.NAME_SPACE; + const namespace = process.env.NAME_SPACE || "showcase-ci-nightly"; const deploymentName = "rhdh-backstage"; const kubeUtils = new KubeClient(); @@ -29,6 +29,9 @@ test.describe("Change app-config at e2e test runtime", () => { await kubeUtils.restartDeployment(deploymentName, namespace); const common = new Common(page); + await page.context().clearCookies(); + await page.context().clearPermissions(); + await page.reload({ waitUntil: "domcontentloaded" }); await common.loginAsGuest(); await new UIhelper(page).openSidebar("Home"); await uiHelper.verifyHeading("Welcome back!"); diff --git a/e2e-tests/playwright/utils/kube-client.ts b/e2e-tests/playwright/utils/kube-client.ts index f1523a9d3d..2bac334e24 100644 --- a/e2e-tests/playwright/utils/kube-client.ts +++ b/e2e-tests/playwright/utils/kube-client.ts @@ -52,7 +52,7 @@ export class KubeClient { namespace, ); } catch (e) { - LOGGER.error(e.body.message); + LOGGER.error(e.body?.message); throw e; } } @@ -99,6 +99,9 @@ export class KubeClient { patch: object, ) { try { + console.log("updateConfigMap called"); + console.log("Namespace: ", namespace); + console.log("ConfigMap: ", configmapName); const options = { headers: { "Content-type": k8s.PatchUtils.PATCH_FORMAT_JSON_PATCH }, }; @@ -321,6 +324,7 @@ export class KubeClient { async restartDeployment(deploymentName: string, namespace: string) { try { console.log(`Scaling down deployment ${deploymentName} to 0 replicas.`); + console.log(`Deployment: ${deploymentName}, Namespace: ${namespace}`); await this.logPodConditions(namespace); await this.scaleDeployment(deploymentName, namespace, 0);