]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: fix cephadm e2e failure
authorNizamudeen A <nia@redhat.com>
Fri, 31 Oct 2025 15:40:37 +0000 (21:10 +0530)
committerNizamudeen A <nia@redhat.com>
Wed, 5 Nov 2025 04:27:57 +0000 (09:57 +0530)
- fix add host failure because of cds-tag migration
- fix draining issue where start/stop toggle was not working properly
- supress an undefined class error in cypress which is raised in
  different place from table component

Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/grafana.feature.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts
src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/grafana/grafana.feature
src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts
src/pybind/mgr/dashboard/frontend/cypress/support/e2e.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts

index 402662c2c46ff27ab2beee73b01c92e32b7152bd..2591578de2f0b5ca7a4d45ce63b1f8ff3e7b9ce8 100644 (file)
@@ -95,7 +95,7 @@ export class HostsPageHelper extends PageHelper {
     this.getTableCell(this.columnIndex.hostname, hostname, true).as('row').click();
     cy.get('@row')
       .parent()
-      .find(`[cdstabledata]:nth-child(${this.columnIndex.labels}) .tag`)
+      .find(`[cdstabledata]:nth-child(${this.columnIndex.labels}) cds-tag span`)
       .should(($ele) => {
         const newLabels = $ele.toArray().map((v) => v.innerText);
         for (const label of labels) {
index d5ed9c26b11eac418af7e2914b978eb7a0bc6119..5286676634e3383c7c6ca3fcaade8adc5b2d38dd 100644 (file)
@@ -155,6 +155,7 @@ export class ServicesPageHelper extends PageHelper {
       }
 
       cy.get('cd-service-daemon-list').within(() => {
+        cy.wait(1000); // wait for the status to be updated
         this.getTableCell(daemonNameIndex, daemon, true)
           .parent()
           .find(`[cdstabledata]:nth-child(${statusIndex}) cds-tag`)
index 4f592fb2464e95275b04cbd0b242e997ecd37eb3..eb057fd34a67fb6b79df7da29d2b40f889e2b186 100644 (file)
@@ -26,8 +26,10 @@ When('I view the grafana panel {string}', (panels: string) => {
       cy.get('.grafana-app')
         .wait(WAIT_TO_LOAD)
         .within(() => {
-          cy.get(`[data-testid="data-testid Panel header ${panel}"]`).click();
-          cy.get(`[aria-label="Menu for panel with title ${panel}"]`).click();
+          cy.contains('[data-testid="data-testid header-container"] h2', panel)
+            .closest('[data-testid="data-testid header-container"]')
+            .click();
+          cy.get(`[data-testid="data-testid Panel menu ${panel}"]`).click();
         });
 
       cy.get('[data-testid="data-testid Panel menu item View"]').click();
index 91503335855ef200728f0ccc7afc15721c2e058a..b82916fb68a9651e31e4c0d187097f0a55ffeecd 100644 (file)
@@ -79,7 +79,7 @@ And('I should see row {string} have {string}', (row: string, options: string) =>
   if (options) {
     cy.get('.cds--search-input').first().clear().type(row);
     for (const option of options.split(',')) {
-      cy.contains(`[cdstablerow] [cdstabledata] .tag`, option).should('exist');
+      cy.contains(`[cdstablerow] [cdstabledata] cds-tag span`, option).should('exist');
     }
   }
 });
index fc023712ec2a15844a53b22e579267b38589a80c..9bc59f3266e44571b15cba4ea53b15e230f85448 100644 (file)
@@ -37,7 +37,6 @@ Feature: Grafana panels
             | Total Requests/sec by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 |
             | GET Latencies by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 |
             | Bandwidth by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 |
-            | PUT Latencies by RGW Instance | foo.ceph-node-00, foo.ceph-node-01, foo.ceph-node-02 |
             | Average GET/PUT Latencies by RGW Instance | GET, PUT |
             | Bandwidth Consumed by Type | GETs, PUTs |
 
index 78ef39682ab820765e5fc4fe98c0105a1501d6a3..1576b2d8eb7f8caaa8b27d404055c1ed3cf99f76 100644 (file)
@@ -316,7 +316,7 @@ export abstract class PageHelper {
       .find('[cdstabledata] [data-testid="table-action-btn"]')
       .click({ force: true });
     cy.wait(waitTime);
-    cy.get(`button.${action}`).click({ force: true });
+    cy.get(`button.${action}`).should('not.be.disabled').click({ force: true });
   }
 
   /**
index bfcdd775dcc48e92dc6472ce1ab19d1259ed4746..924fb8f4cfcd09fb67f9c018f186a1a0c8aa12e8 100644 (file)
@@ -8,11 +8,13 @@ afterEach(() => {
 });
 
 Cypress.on('uncaught:exception', (err: Error) => {
-  if (
-    err.message.includes('ResizeObserver loop limit exceeded') ||
-    err.message.includes('api/prometheus/rules') ||
-    err.message.includes('NG0100: ExpressionChangedAfterItHasBeenCheckedError')
-  ) {
+  const ignoredErrors = [
+    'ResizeObserver loop limit exceeded',
+    'api/prometheus/rules',
+    'NG0100: ExpressionChangedAfterItHasBeenCheckedError',
+    'NgClass can only toggle CSS classes'
+  ];
+  if (ignoredErrors.some((error) => err.message.includes(error))) {
     return false;
   }
   return true;
index e474fb854cde5671f341beef404e9b538a5a86c4..a48697bf7cc90b9985e5d247f8692142e050de5a 100644 (file)
@@ -72,7 +72,7 @@
 
 <ng-template #hostNameTpl
              let-row="data.row">
-  <span [ngClass]="row">
+  <span>
     {{ row.hostname }}
   </span><br>
   <span class="text-muted fst-italic"
index cb237f768f2cc751ec926fcc2eacd41bf705ec50..73d5f2e80d12a90f6aa426abbdc732319a70fb50 100644 (file)
@@ -97,7 +97,7 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
   isExecuting = false;
   errorMessage: string;
   enableMaintenanceBtn: boolean;
-  enableDrainBtn: boolean;
+  draining: boolean = false;
   bsModalRef: NgbModalRef;
 
   icons = Icons;
@@ -133,6 +133,9 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
   ) {
     super();
     this.permissions = this.authStorageService.getPermissions();
+  }
+
+  ngOnInit() {
     this.expandClusterActions = [
       {
         name: this.actionLabels.EXPAND_CLUSTER,
@@ -169,18 +172,14 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
         permission: 'update',
         icon: Icons.exit,
         click: () => this.hostDrain(),
-        disable: (selection: CdTableSelection) =>
-          this.getDisable('drain', selection) || !this.enableDrainBtn,
-        visible: () => !this.showGeneralActionsOnly && this.enableDrainBtn
+        visible: () => !this.showGeneralActionsOnly && !this.draining
       },
       {
         name: this.actionLabels.STOP_DRAIN,
         permission: 'update',
         icon: Icons.exit,
         click: () => this.hostDrain(true),
-        disable: (selection: CdTableSelection) =>
-          this.getDisable('drain', selection) || this.enableDrainBtn,
-        visible: () => !this.showGeneralActionsOnly && !this.enableDrainBtn
+        visible: () => !this.showGeneralActionsOnly && this.draining
       },
       {
         name: this.actionLabels.REMOVE,
@@ -212,9 +211,6 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
         visible: () => !this.showGeneralActionsOnly && this.enableMaintenanceBtn
       }
     ];
-  }
-
-  ngOnInit() {
     this.columns = [
       {
         name: $localize`Hostname`,
@@ -305,15 +301,14 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
   updateSelection(selection: CdTableSelection) {
     this.selection = selection;
     this.enableMaintenanceBtn = false;
-    this.enableDrainBtn = false;
     if (this.selection.hasSelection) {
       if (this.selection.first().status === 'maintenance') {
         this.enableMaintenanceBtn = true;
       }
 
-      if (!this.selection.first().labels.includes('_no_schedule')) {
-        this.enableDrainBtn = true;
-      }
+      this.selection.first().labels.includes('_no_schedule')
+        ? (this.draining = true)
+        : (this.draining = false);
     }
   }