Skip to content

Commit 961b063

Browse files
committed
fix(cypress): Operator and Monitoring Plugin Setup Commands Fixes
Add 'cy.visit('/') needed for the correct flow of session reconstruction. Fix failure on MCP delete when no resource exists yet.
1 parent 68e7788 commit 961b063

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

web/cypress/support/commands/auth-commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ declare global {
8181
}
8282

8383
Cypress.Commands.add('validateLogin', () => {
84+
cy.visit('/');
8485
cy.wait(2000);
8586
cy.byTestID("username", {timeout: 120000}).should('be.visible');
8687
guidedTour.close();

web/cypress/support/commands/operator-commands.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,16 @@ const operatorUtils = {
420420
`sleep 15 && oc wait --for=condition=Ready pods --selector=app.kubernetes.io/name=monitoring-plugin -n ${MP.namespace} --timeout=60s --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
421421
{
422422
timeout: readyTimeoutMilliseconds,
423-
failOnNonZeroExit: true
423+
failOnNonZeroExit: false
424424
}
425425
).then((result) => {
426-
expect(result.code).to.eq(0);
427-
cy.log(`Monitoring plugin pod is now running in namespace: ${MP.namespace}`);
426+
if (result.code === 0) {
427+
cy.log(`Monitoring plugin pod is now running in namespace: ${MP.namespace}`);
428+
} else if (result.stderr.includes('no matching resources found')) {
429+
cy.log(`No monitoring-plugin pods found in namespace ${MP.namespace} - this is expected on fresh clusters`);
430+
} else {
431+
throw new Error(`Failed to wait for monitoring-plugin pods: ${result.stderr}`);
432+
}
428433
});
429434

430435
cy.reload(true);

0 commit comments

Comments
 (0)