Skip to content

Commit

Permalink
Add debug info
Browse files Browse the repository at this point in the history
Signed-off-by: Nandini Chandra <nachandr@redhat.com>
  • Loading branch information
nachandr committed Dec 12, 2024
1 parent c5638da commit c24c698
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
8 changes: 7 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/tests/upgrade/after_upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,5 @@ describe(["@post-upgrade"], "Performing post-upgrade validations", () => {
});
});

it("Validate MTA Operator Log", () => validateMtaOperatorLog());
it.only("Validate MTA Operator Log", () => validateMtaOperatorLog());
});
10 changes: 10 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
7 changes: 6 additions & 1 deletion cypress/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c24c698

Please sign in to comment.