From c5638da4435b21c6f6a4c13105c4abb0ffaf0d3c Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 5 Dec 2024 21:10:54 -0600 Subject: [PATCH 1/5] Move upgrade test Signed-off-by: Nandini Chandra --- cypress/e2e/tests/upgrade/after_upgrade.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/tests/upgrade/after_upgrade.test.ts b/cypress/e2e/tests/upgrade/after_upgrade.test.ts index 4ac67830a..79ca9193e 100644 --- a/cypress/e2e/tests/upgrade/after_upgrade.test.ts +++ b/cypress/e2e/tests/upgrade/after_upgrade.test.ts @@ -84,8 +84,6 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { it("Validate Tackle CR", () => validateTackleCr()); - it("Validate MTA Operator Log", () => validateMtaOperatorLog()); - it("Controls - testing existence of instances created before upgrade", function () { const { sourceControlUsernameCredentialsName, @@ -221,4 +219,6 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { isEnabled(clearRepository, rwxEnabled); }); }); + + it("Validate MTA Operator Log", () => validateMtaOperatorLog()); }); From c24c6980efa6ba7be9f1b50bd17958992b246c39 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Wed, 11 Dec 2024 19:37:39 -0600 Subject: [PATCH 2/5] Add debug info Signed-off-by: Nandini Chandra --- cypress.config.ts | 8 +++++++- cypress/e2e/tests/upgrade/after_upgrade.test.ts | 2 +- cypress/support/commands.ts | 10 ++++++++++ cypress/utils/utils.ts | 7 ++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index 2dfbb2cba..b620788c4 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -21,7 +21,7 @@ export default defineConfig({ jira_atlassian_cloud_url: "", jira_atlassian_cloud_project: "Test", jira_stage_datacenter_project_id: 12335626, - tackleUrl: "https://tackle-konveyor-tackle.apps.mtv03.rhos-psi.cnv-qe.rhood.us", + tackleUrl: "https://mta-openshift-mta.apps.mig07.rhos-psi.cnv-qe.rhood.us/", rwx_enabled: true, logLevel: "ASSERT", mtaVersion: "", @@ -55,6 +55,12 @@ export default defineConfig({ on("file:preprocessor", tagify(config)); require("cypress-fail-fast/plugin")(on, config); require("cypress-fs/plugins")(on, config); + on("task", { + log(args) { + console.log(...args); + return null; + }, + }); return config; }, experimentalMemoryManagement: true, diff --git a/cypress/e2e/tests/upgrade/after_upgrade.test.ts b/cypress/e2e/tests/upgrade/after_upgrade.test.ts index 79ca9193e..9eced4adc 100644 --- a/cypress/e2e/tests/upgrade/after_upgrade.test.ts +++ b/cypress/e2e/tests/upgrade/after_upgrade.test.ts @@ -220,5 +220,5 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { }); }); - it("Validate MTA Operator Log", () => validateMtaOperatorLog()); + it.only("Validate MTA Operator Log", () => validateMtaOperatorLog()); }); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 43122fe4c..5e83c6925 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -52,3 +52,13 @@ Cypress.Commands.add( dropElement.realMouseMove(0, 0, { position: "topLeft" }).realMouseUp().wait(200); } ); +Cypress.Commands.overwrite("log", function (log, ...args) { + if (Cypress.browser.isHeadless) { + return cy.task("log", args, { log: false }).then(() => { + return log(...args); + }); + } else { + console.log(...args); + return log(...args); + } +}); diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 6bc9dcbe5..53830dd1f 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -1858,9 +1858,14 @@ export function validateTackleCr(): void { export function validateMtaOperatorLog(): void { cy.wait(30 * SEC); - let command = `oc logs $(oc get pods | grep mta-operator | cut -d " " -f 1) | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; + cy.pause(); + let command = `oc logs $(oc get pods -n openshift-mta| grep mta-operator | cut -d " " -f 1) + -n openshift-mta | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; + cy.log("COMMAND:", command); getCommandOutput(command).then((result) => { + cy.log("RESULT:", result); const failedCount = parseInt(result.stdout.trim()); + cy.log("FAILED COUNT IS", failedCount); if (Number.isNaN(failedCount)) { throw `Debugging output\n result.stdout: ${result.stdout}EOV\n From 60badb9d66dce10dda13172fa02c268e625511a1 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Wed, 11 Dec 2024 20:12:40 -0600 Subject: [PATCH 3/5] Add debug info Signed-off-by: Nandini Chandra --- cypress/utils/utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 53830dd1f..aaf0337df 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -1859,8 +1859,7 @@ export function validateTackleCr(): void { export function validateMtaOperatorLog(): void { cy.wait(30 * SEC); cy.pause(); - let command = `oc logs $(oc get pods -n openshift-mta| grep mta-operator | cut -d " " -f 1) - -n openshift-mta | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; + let command = `oc logs $(oc get pods -n openshift-mta| grep mta-operator | cut -d " " -f 1) -n openshift-mta | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; cy.log("COMMAND:", command); getCommandOutput(command).then((result) => { cy.log("RESULT:", result); From d713a1e0da94611cfc6e14b164937792c1f2e434 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Wed, 11 Dec 2024 20:42:56 -0600 Subject: [PATCH 4/5] Remove debug info Signed-off-by: Nandini Chandra --- cypress.config.ts | 8 +------- cypress/e2e/tests/upgrade/after_upgrade.test.ts | 4 ++-- cypress/support/commands.ts | 10 ---------- cypress/utils/utils.ts | 6 +----- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index b620788c4..2dfbb2cba 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -21,7 +21,7 @@ export default defineConfig({ jira_atlassian_cloud_url: "", jira_atlassian_cloud_project: "Test", jira_stage_datacenter_project_id: 12335626, - tackleUrl: "https://mta-openshift-mta.apps.mig07.rhos-psi.cnv-qe.rhood.us/", + tackleUrl: "https://tackle-konveyor-tackle.apps.mtv03.rhos-psi.cnv-qe.rhood.us", rwx_enabled: true, logLevel: "ASSERT", mtaVersion: "", @@ -55,12 +55,6 @@ export default defineConfig({ on("file:preprocessor", tagify(config)); require("cypress-fail-fast/plugin")(on, config); require("cypress-fs/plugins")(on, config); - on("task", { - log(args) { - console.log(...args); - return null; - }, - }); return config; }, experimentalMemoryManagement: true, diff --git a/cypress/e2e/tests/upgrade/after_upgrade.test.ts b/cypress/e2e/tests/upgrade/after_upgrade.test.ts index 9eced4adc..4ac67830a 100644 --- a/cypress/e2e/tests/upgrade/after_upgrade.test.ts +++ b/cypress/e2e/tests/upgrade/after_upgrade.test.ts @@ -84,6 +84,8 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { it("Validate Tackle CR", () => validateTackleCr()); + it("Validate MTA Operator Log", () => validateMtaOperatorLog()); + it("Controls - testing existence of instances created before upgrade", function () { const { sourceControlUsernameCredentialsName, @@ -219,6 +221,4 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { isEnabled(clearRepository, rwxEnabled); }); }); - - it.only("Validate MTA Operator Log", () => validateMtaOperatorLog()); }); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 5e83c6925..43122fe4c 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -52,13 +52,3 @@ Cypress.Commands.add( dropElement.realMouseMove(0, 0, { position: "topLeft" }).realMouseUp().wait(200); } ); -Cypress.Commands.overwrite("log", function (log, ...args) { - if (Cypress.browser.isHeadless) { - return cy.task("log", args, { log: false }).then(() => { - return log(...args); - }); - } else { - console.log(...args); - return log(...args); - } -}); diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index aaf0337df..7632725b6 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -1858,13 +1858,9 @@ export function validateTackleCr(): void { export function validateMtaOperatorLog(): void { cy.wait(30 * SEC); - cy.pause(); - let command = `oc logs $(oc get pods -n openshift-mta| grep mta-operator | cut -d " " -f 1) -n openshift-mta | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; - cy.log("COMMAND:", command); + let command = `oc logs $(oc get pods -n openshift-mta | grep mta-operator | cut -d " " -f 1) -n openshift-mta | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; getCommandOutput(command).then((result) => { - cy.log("RESULT:", result); const failedCount = parseInt(result.stdout.trim()); - cy.log("FAILED COUNT IS", failedCount); if (Number.isNaN(failedCount)) { throw `Debugging output\n result.stdout: ${result.stdout}EOV\n From acef76121fc45465e550c99da7b93c35f004cdd0 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 12 Dec 2024 15:42:27 -0600 Subject: [PATCH 5/5] Remove debug statements Signed-off-by: Nandini Chandra --- cypress/utils/utils.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 7632725b6..ffcbe3fb2 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -1857,15 +1857,11 @@ export function validateTackleCr(): void { } export function validateMtaOperatorLog(): void { + let namespace = getNamespace(); cy.wait(30 * SEC); - let command = `oc logs $(oc get pods -n openshift-mta | grep mta-operator | cut -d " " -f 1) -n openshift-mta | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; + let command = `oc logs $(oc get pods -n${namespace} | grep mta-operator | cut -d " " -f 1) -n${namespace} | grep failed | tail -n 1| awk -F 'failed=' '{print $2}'|cut -d " " -f 1`; getCommandOutput(command).then((result) => { const failedCount = parseInt(result.stdout.trim()); - if (Number.isNaN(failedCount)) { - throw `Debugging output\n - result.stdout: ${result.stdout}EOV\n - failedCount: ${failedCount}EOV`; - } expect(failedCount).equal(0); }); }