diff --git a/cypress/e2e/tests/upgrade/after_upgrade.test.ts b/cypress/e2e/tests/upgrade/after_upgrade.test.ts index 516472f8b..03bc11a76 100644 --- a/cypress/e2e/tests/upgrade/after_upgrade.test.ts +++ b/cypress/e2e/tests/upgrade/after_upgrade.test.ts @@ -23,7 +23,7 @@ import { getRandomApplicationData, isEnabled, login, - getPodsList, + getMtaPodsList, } from "../../../utils/utils"; import { UpgradeData } from "../../types/types"; import { Credentials } from "../../models/administration/credentials/credentials"; @@ -57,14 +57,14 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { it("Getting pods and their statuses", function () { const projectName = "openshift-mta"; - getPodsList(projectName).then((pods: Pod[]) => { + getMtaPodsList(projectName).then((pods: string[]) => { pods.forEach((pod) => { - cy.log(pod.name); + cy.log(pod); }); }); }); - it("Controls - testing existence of instances created before upgrade", function () { + it.skip("Controls - testing existence of instances created before upgrade", function () { const { sourceControlUsernameCredentialsName, mavenUsernameCredentialName, @@ -99,7 +99,7 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { exists(tagName); }); - it("Applications - testing existence of instances created before upgrade", function () { + it.skip("Applications - testing existence of instances created before upgrade", function () { const { sourceApplicationName, binaryApplicationName, uploadBinaryApplicationName } = this.upgradeData; @@ -143,7 +143,7 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => { sourceApplication.selectApplication(); }); - it("Enabling RWX, validating it works, disabling it", function () { + it.skip("Enabling RWX, validating it works, disabling it", function () { MavenConfiguration.open(); let rwxEnabled = false; isEnabled(clearRepository, rwxEnabled); diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index f94db7dec..640ae05c3 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -1798,23 +1798,32 @@ export function validateSortBy(sortBy: string, tdSelector?: string) { verifySortDesc(afterDescSortList, unsortedList); } -export const getPodsList = (projectName: string): Cypress.Chainable => { - const command = `oc get pods -o json -n ${projectName}`; - +// export const getMtaPodsList = (projectName: string): Cypress.Chainable => { +// const command = `oc get pods -o json -n ${projectName}`; +// +// return cy.task("exec", command).then((result: any) => { +// console.log(result.stdout); +// cy.log(result.stdout); +// const pods: Pod[] = Array.prototype.slice +// .call(JSON.parse(result.stdout)) +// .map((podData: any) => { +// const podStatus = podData.status.conditions.find( +// (condition: any) => condition.type === "Ready" +// ); +// const status = podStatus ? "Running" : "Pending"; // TODO: Check if more statuses should be added +// +// return { +// name: podData.metadata.name, +// status: status, +// }; +// }); +// return pods; +// }); +// }; + +export const getMtaPodsList = (projectName: string): Cypress.Chainable => { + const command = `oc get pods -n ${projectName} --no-headers -o custom-columns=:metadata.name | grep -v task`; return cy.task("exec", command).then((result: any) => { - console.log(result.stdout); - cy.log(result.stdout); - const pods: Pod[] = result.stdout.map((podData: any) => { - const podStatus = podData.status.conditions.find( - (condition: any) => condition.type === "Ready" - ); - const status = podStatus ? "Running" : "Pending"; // TODO: Check if more statuses should be added - - return { - name: podData.metadata.name, - status: status, - }; - }); - return pods; + return result; }); };