]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: stabilizing the cephadm dashboard e2e 44468/head
authorNizamudeen A <nia@redhat.com>
Thu, 30 Dec 2021 08:28:58 +0000 (13:58 +0530)
committerNizamudeen A <nia@redhat.com>
Wed, 5 Jan 2022 14:18:56 +0000 (19:48 +0530)
Reordering the tests and adding some more tests to verify the cluster is
healthy before proceeding to do some complex tasks like maintenance and
drain host

Fixes: https://tracker.ceph.com/issues/53742
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit fbc9f46459537d0799c448e27f80623d7d4805c8)

src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts [deleted file]
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts [deleted file]
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts

index 0b70e90b6563b436f18ebe03d0c73f767fcae448..2d1969b75bd0aa0f0235d9f1cb60e0675a3734d5 100644 (file)
@@ -70,12 +70,12 @@ export class ServicesPageHelper extends PageHelper {
     }
   }
 
-  editService(name: string, count: string) {
+  editService(name: string, daemonCount: string) {
     this.navigateEdit(name, true, false);
     cy.get(`${this.pages.create.id}`).within(() => {
       cy.get('#service_type').should('be.disabled');
       cy.get('#service_id').should('be.disabled');
-      cy.get('#count').clear().type(count);
+      cy.get('#count').clear().type(daemonCount);
       cy.get('cd-submit-button').click();
     });
   }
diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts
deleted file mode 100644 (file)
index c8d93b4..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
-import { OSDsPageHelper } from 'cypress/integration/cluster/osds.po';
-
-const osds = new OSDsPageHelper();
-
-describe('Create cluster create osds page', () => {
-  const createCluster = new CreateClusterWizardHelper();
-
-  beforeEach(() => {
-    cy.login();
-    Cypress.Cookies.preserveOnce('token');
-    createCluster.navigateTo();
-    createCluster.createCluster();
-    cy.get('.nav-link').contains('Create OSDs').click();
-  });
-
-  it('should check if title contains Create OSDs', () => {
-    cy.get('.title').should('contain.text', 'Create OSDs');
-  });
-
-  describe('when Orchestrator is available', () => {
-    it('should create OSDs', () => {
-      osds.navigateTo();
-      osds.getTableCount('total').as('initOSDCount');
-
-      createCluster.navigateTo();
-      createCluster.createCluster();
-      cy.get('.nav-link').contains('Create OSDs').click();
-
-      createCluster.createOSD('hdd');
-
-      // Go to the Review section and Expand the cluster
-      // because the drive group spec is only stored
-      // in frontend and will be lost when refreshed
-      cy.get('.nav-link').contains('Review').click();
-      cy.get('button[aria-label="Next"]').click();
-      cy.get('cd-dashboard').should('exist');
-    });
-  });
-});
diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts
new file mode 100644 (file)
index 0000000..e1b33fe
--- /dev/null
@@ -0,0 +1,51 @@
+import {
+  CreateClusterServicePageHelper,
+  CreateClusterWizardHelper
+} from 'cypress/integration/cluster/create-cluster.po';
+
+describe('Create cluster create services page', () => {
+  const createCluster = new CreateClusterWizardHelper();
+  const createClusterServicePage = new CreateClusterServicePageHelper();
+
+  const createService = (serviceType: string, serviceName: string, count?: string) => {
+    cy.get('.btn.btn-accent').first().click({ force: true });
+    createClusterServicePage.addService(serviceType, false, count);
+    createClusterServicePage.checkExist(serviceName, true);
+  };
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    createCluster.navigateTo();
+    createCluster.createCluster();
+    cy.get('.nav-link').contains('Create Services').click();
+  });
+
+  it('should check if title contains Create Services', () => {
+    cy.get('.title').should('contain.text', 'Create Services');
+  });
+
+  describe('when Orchestrator is available', () => {
+    const serviceName = 'rgw.foo';
+
+    it('should create an rgw service', () => {
+      createService('rgw', serviceName, '2');
+    });
+
+    it('should delete the service and add it back', () => {
+      createClusterServicePage.deleteService(serviceName);
+
+      createService('rgw', serviceName, '2');
+    });
+
+    it('should edit a service', () => {
+      const daemonCount = '4';
+      createClusterServicePage.editService(serviceName, daemonCount);
+      createClusterServicePage.expectPlacementCount(serviceName, daemonCount);
+    });
+
+    it('should create an ingress service', () => {
+      createService('ingress', 'ingress.rgw.foo', '2');
+    });
+  });
+});
diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts
new file mode 100644 (file)
index 0000000..c8d93b4
--- /dev/null
@@ -0,0 +1,40 @@
+import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
+import { OSDsPageHelper } from 'cypress/integration/cluster/osds.po';
+
+const osds = new OSDsPageHelper();
+
+describe('Create cluster create osds page', () => {
+  const createCluster = new CreateClusterWizardHelper();
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    createCluster.navigateTo();
+    createCluster.createCluster();
+    cy.get('.nav-link').contains('Create OSDs').click();
+  });
+
+  it('should check if title contains Create OSDs', () => {
+    cy.get('.title').should('contain.text', 'Create OSDs');
+  });
+
+  describe('when Orchestrator is available', () => {
+    it('should create OSDs', () => {
+      osds.navigateTo();
+      osds.getTableCount('total').as('initOSDCount');
+
+      createCluster.navigateTo();
+      createCluster.createCluster();
+      cy.get('.nav-link').contains('Create OSDs').click();
+
+      createCluster.createOSD('hdd');
+
+      // Go to the Review section and Expand the cluster
+      // because the drive group spec is only stored
+      // in frontend and will be lost when refreshed
+      cy.get('.nav-link').contains('Review').click();
+      cy.get('button[aria-label="Next"]').click();
+      cy.get('cd-dashboard').should('exist');
+    });
+  });
+});
diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts
deleted file mode 100644 (file)
index 266983d..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-import {
-  CreateClusterServicePageHelper,
-  CreateClusterWizardHelper
-} from 'cypress/integration/cluster/create-cluster.po';
-
-describe('Create cluster create services page', () => {
-  const createCluster = new CreateClusterWizardHelper();
-  const createClusterServicePage = new CreateClusterServicePageHelper();
-
-  const createService = (serviceType: string, serviceName: string, count?: string) => {
-    cy.get('.btn.btn-accent').first().click({ force: true });
-    createClusterServicePage.addService(serviceType, false, count);
-    createClusterServicePage.checkExist(serviceName, true);
-  };
-
-  beforeEach(() => {
-    cy.login();
-    Cypress.Cookies.preserveOnce('token');
-    createCluster.navigateTo();
-    createCluster.createCluster();
-    cy.get('.nav-link').contains('Create Services').click();
-  });
-
-  it('should check if title contains Create Services', () => {
-    cy.get('.title').should('contain.text', 'Create Services');
-  });
-
-  describe('when Orchestrator is available', () => {
-    const serviceName = 'rgw.foo';
-
-    it('should create an rgw service', () => {
-      createService('rgw', serviceName, '2');
-    });
-
-    it('should delete the service and add it back', () => {
-      createClusterServicePage.deleteService(serviceName);
-
-      createService('rgw', serviceName, '2');
-    });
-
-    it('should edit a service', () => {
-      const count = '3';
-      createClusterServicePage.editService(serviceName, count);
-      createClusterServicePage.expectPlacementCount(serviceName, count);
-    });
-
-    it('should create an ingress service', () => {
-      createService('ingress', 'ingress.rgw.foo', '2');
-    });
-  });
-});
index 633d9733c99b5bad73c778bae3f3facaf5496c10..ff6017559f2e6ff9013a5bbdecb06696000fedc4 100644 (file)
@@ -55,11 +55,13 @@ describe('when cluster creation is completed', () => {
       });
     });
 
-    it('should check if rgw service is running', () => {
-      hosts.clickTab('cd-host-details', hostnames[3], 'Daemons');
-      cy.get('cd-host-details').within(() => {
-        services.checkServiceStatus('rgw');
-      });
+    it('should check if mon daemon is running on all hosts', () => {
+      for (const hostname of hostnames) {
+        hosts.clickTab('cd-host-details', hostname, 'Daemons');
+        cy.get('cd-host-details').within(() => {
+          services.checkServiceStatus('mon');
+        });
+      }
     });
   });
 
@@ -71,7 +73,7 @@ describe('when cluster creation is completed', () => {
     });
 
     it('should check if osds are created', { retries: 1 }, () => {
-      osds.getTableCount('total').should('be.gte', 1);
+      osds.getTableCount('total').should('be.gte', 2);
     });
   });
 
@@ -90,6 +92,13 @@ describe('when cluster creation is completed', () => {
       hosts.navigateTo();
     });
 
+    it('should check if rgw daemon is running', () => {
+      hosts.clickTab('cd-host-details', hostnames[3], 'Daemons');
+      cy.get('cd-host-details').within(() => {
+        services.checkServiceStatus('rgw');
+      });
+    });
+
     it('should force maintenance and exit', { retries: 1 }, () => {
       hosts.maintenance(hostnames[3], true, true);
     });