Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2e test deregistration cascading #1634

Merged
merged 11 commits into from
Jul 20, 2023
13 changes: 6 additions & 7 deletions test/e2e/cypress/e2e/clusters_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ context('Clusters Overview', () => {
});

describe('Deregistration', () => {
const hana_cluster_1 = {
const hanaCluster1 = {
name: 'hana_cluster_1',
hosts: [
{
Expand All @@ -165,13 +165,12 @@ context('Clusters Overview', () => {
],
};

before(() => {
cy.deregisterHost(hana_cluster_1.hosts[0].id);
cy.deregisterHost(hana_cluster_1.hosts[1].id);
});
before(() => {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, @rtorrero , you can remove it


it(`should not display '${hana_cluster_1.name}' after deregistering all its nodes`, () => {
cy.contains(hana_cluster_1.name).should('not.exist');
it(`should not display '${hanaCluster1.name}' after deregistering all its nodes`, () => {
cy.deregisterHost(hanaCluster1.hosts[0].id);
jamie-suse marked this conversation as resolved.
Show resolved Hide resolved
cy.deregisterHost(hanaCluster1.hosts[1].id);
cy.contains(hanaCluster1.name).should('not.exist');
});
});
});
8 changes: 4 additions & 4 deletions test/e2e/cypress/e2e/databases_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context('Databases Overview', () => {
});

describe('Deregistration', () => {
const hdq_database = {
const hdqDatabase = {
sid: 'HDQ',
hana_primary: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this in snake_case yet?

name: 'vmhdbqas01',
Expand All @@ -14,11 +14,11 @@ context('Databases Overview', () => {
};

before(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go in the test as well

cy.deregisterHost(hdq_database.hana_primary.id);
cy.deregisterHost(hdqDatabase.hana_primary.id);
});

it(`should not display DB ${hdq_database.hana_primary.name} after deregistering the primary instance`, () => {
cy.contains(hdq_database.sid).should('not.exist');
it(`should not display DB ${hdqDatabase.sid} after deregistering the primary instance`, () => {
cy.contains(hdqDatabase.sid).should('not.exist');
});
});
});
42 changes: 36 additions & 6 deletions test/e2e/cypress/e2e/sap_systems_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,20 +293,50 @@ context('SAP Systems Overview', () => {
});

describe('Deregistration', () => {
const sap_system_nwp = {
const sapSystemNwp = {
sid: 'NWP',
hana_primary: {
hanaPrimary: {
name: 'vmhdbprd01',
id: '9cd46919-5f19-59aa-993e-cf3736c71053',
},
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I miss a test here where we check that the SAP system is deregistered when the ASCS or PAS instances are deregistered

before(() => {
cy.deregisterHost(sap_system_nwp.hana_primary.id);
const sapSystemNwq = {
sid: 'NWQ',
messageserverInstance: {
name: 'vmnwqas01',
id: '25677e37-fd33-5005-896c-9275b1284534',
},
};

const sapSystemNwd = {
sid: 'NWD',
applicationInstances: [
{
name: 'vmnwdev03',
id: '9a3ec76a-dd4f-5013-9cf0-5eb4cf89898f',
},
{
name: 'vmnwdev04',
id: '1b0e9297-97dd-55d6-9874-8efde4d84c90',
},
],
};

it(`should not display SAP System ${sapSystemNwp.sid} after deregistering the primary instance`, () => {
arbulu89 marked this conversation as resolved.
Show resolved Hide resolved
cy.deregisterHost(sapSystemNwp.hanaPrimary.id);
cy.contains(sapSystemNwp.sid).should('not.exist');
});

it(`should not display SAP System ${sapSystemNwq.sid} after deregistering the instance running the messageserver`, () => {
cy.deregisterHost(sapSystemNwq.messageserverInstance.id);
cy.contains(sapSystemNwq.sid).should('not.exist');
});

it(`should not display SAP System ${sap_system_nwp.sid} after deregistering the primary instance`, () => {
cy.contains(sap_system_nwp.sid).should('not.exist');
it(`should not display SAP System ${sapSystemNwd.sid} after deregistering both application instances`, () => {
cy.deregisterHost(sapSystemNwd.applicationInstances[0].id);
cy.deregisterHost(sapSystemNwd.applicationInstances[1].id);
cy.contains(sapSystemNwd.sid).should('not.exist');
});
});
});
Loading