-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
e639652
to
25bbde9
Compare
25bbde9
to
334494e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rtorrero The tests look good in general.
I think that we should apply the deregisterHost
command in the test itself, and not in the before
, as the deregistration is the most important part of the test itself, and not a "setup` thing.
Cypress.env('web_api_port'), | ||
]; | ||
|
||
const headers = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have this headers in a default constant.
Maybe food for a tech debt
], | ||
}; | ||
|
||
before(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this in a before?
This is the most important part of the test and it should be done in the test itself, right?
hosts: [ | ||
{ | ||
id: '13e8c25c-3180-5a9a-95c8-51ec38e50cfc', | ||
name: 'vmhdbdev01', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These name
s are not used, maybe we could remove them?
And have a list of ids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept them there for reference, so that when reading the test you at least know which host is being deregistered, what do you think? maybe better a comment or nothing at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you. If it was me I wouldn't have it, but if it helps you, it is not harmful at least
cy.deregisterHost(hdq_database.hana_primary.id); | ||
}); | ||
|
||
it(`should not display DB ${hdq_database.hana_primary.name} after deregistering the primary instance`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interpolation doesn't make much sense. This should be hdq_database.sid
I guess
}); | ||
|
||
describe('Deregistration', () => { | ||
const hdq_database = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hdq_database
-> hdqDatabase
@@ -291,4 +291,22 @@ context('SAP Systems Overview', () => { | |||
cy.get('table.table-fixed').should('not.contain', 'DAA'); | |||
}); | |||
}); | |||
|
|||
describe('Deregistration', () => { | |||
const sap_system_nwp = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sapSystemNwp
hanaPrimary
id: '9cd46919-5f19-59aa-993e-cf3736c71053', | ||
}, | ||
}; | ||
|
There was a problem hiding this comment.
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
}); | ||
}); | ||
}); | ||
|
||
describe('Deregistration', () => { | ||
const hana_cluster_1 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hanaCluster1
cy.deregisterHost(hana_cluster_1.hosts[0].id); | ||
cy.deregisterHost(hana_cluster_1.hosts[1].id); | ||
}); | ||
before(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @rtorrero
Some last nitpicks. Specially, move the deregisterHost
to the test, and we are ready to merge
cy.deregisterHost(hana_cluster_1.hosts[0].id); | ||
cy.deregisterHost(hana_cluster_1.hosts[1].id); | ||
}); | ||
before(() => {}); |
There was a problem hiding this comment.
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
hosts: [ | ||
{ | ||
id: '13e8c25c-3180-5a9a-95c8-51ec38e50cfc', | ||
name: 'vmhdbdev01', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you. If it was me I wouldn't have it, but if it helps you, it is not harmful at least
}, | ||
}; | ||
|
||
before(() => { |
There was a problem hiding this comment.
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
describe('Deregistration', () => { | ||
const hdqDatabase = { | ||
sid: 'HDQ', | ||
hana_primary: { |
There was a problem hiding this comment.
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?
before(() => { | ||
cy.visit(`/sap_systems/${selectedSystem.Id}`); | ||
cy.url().should('include', `/sap_systems/${selectedSystem.Id}`); | ||
cy.deregisterHost(hostToDeregister.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This to the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More things 😅
}; | ||
|
||
before(() => { | ||
cy.deregisterHost(hostToDeregister.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deregisterHost
move to the test
|
||
describe('Deregistration', () => { | ||
before(() => { | ||
cy.deregisterHost(attachedHosts[0].AgentId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to the test
cy.url().should('include', `/sap_systems/${selectedSystem.Id}`); | ||
}); | ||
|
||
it(`should not include ${hostToDeregister.name} in the list of hosts`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could improve this test (or add a new) to check that the SAP instance belonging to this SAP system is not there. @abravosuse reported some potential issue on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔝
Description
This PR adds tests to confirm that a deregistration of a host also removes the affected data from other views. Included in this PR are tests for: