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

Angi architecture e2e tests and demo update #2770

Merged
merged 6 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ jobs:
photofinish run hana-scale-out -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"
photofinish run hana-diskless-sbd -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"
photofinish run multi-tenant -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"
photofinish run hana-scale-up-angi -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"

obs-commit-image:
name: Commit to OBS to generate container image
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,5 @@ jobs:
photofinish run healthy-27-node-SAP-cluster -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run hana-scale-out -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run hana-diskless-sbd -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run multi-tenant -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run multi-tenant -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run hana-scale-up-angi -u "https://$TRENTO_PR_ENV_URL/api/collect"
10 changes: 10 additions & 0 deletions .photofinish.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ directories = ["./test/fixtures/scenarios/hana-scale-out"]

directories = ["./test/fixtures/scenarios/hana-diskless-sbd"]

[hana-scale-up-angi]

directories = ["./test/fixtures/scenarios/hana-scale-up-angi"]

[aws-landscape]

directories = ["./test/fixtures/scenarios/aws-landscape"]
Expand Down Expand Up @@ -212,6 +216,12 @@ files = [
"./test/fixtures/scenarios/hana-cluster-details/b767b3e9-e802-587e-a442-541d093b86b9_ha_cluster_discovery_nutanix_provider.json",
]

[cluster-hana-scale-up-angi-failover]

files = [
"./test/fixtures/scenarios/hana-cluster-details/4b67842f-ccf7-46a4-a344-9e918648b117_ha_cluster_discovery_angi_failover.json",
]

[host-details-vmhdbprd01]

files = [
Expand Down
113 changes: 112 additions & 1 deletion test/e2e/cypress/e2e/hana_cluster_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import {
createUserRequestFactory,
} from '@lib/test-utils/factories';
import { capitalize } from 'lodash';
import { availableHanaCluster } from '../fixtures/hana-cluster-details/available_hana_cluster';
import {
availableHanaCluster,
availableAngiCluster,
} from '../fixtures/hana-cluster-details/available_hana_cluster';

context('HANA cluster details', () => {
const lastExecutionURL = `**/api/v2/checks/groups/**/executions/last`;
Expand Down Expand Up @@ -60,6 +63,18 @@ context('HANA cluster details', () => {
.contains(availableHanaCluster.clusterType);
});

it(`should have architecture type ${availableHanaCluster.clusterType}`, () => {
cy.get('.tn-cluster-details')
.contains('Cluster type')
.next()
.find('svg')
.trigger('mouseover');

cy.contains('span', availableHanaCluster.architectureType).should(
'exist'
);
});

it(`should have log replication mode ${availableHanaCluster.hanaSystemReplicationMode}`, () => {
cy.get('.tn-cluster-details')
.contains('HANA log replication mode')
Expand Down Expand Up @@ -215,6 +230,102 @@ context('HANA cluster details', () => {
});
});

describe('Angi architecture', () => {
before(() => {
cy.loadScenario('hana-scale-up-angi');
cy.visit(`/clusters/${availableAngiCluster.id}`);
});

after(() => {
availableAngiCluster.hosts.forEach(({ id }) => {
cy.deregisterHost(id);
});
});

it('should discover and display properly Angi architecture HANA scale up cluster', () => {
cy.get('h1').contains(availableAngiCluster.name);

cy.get('.tn-cluster-details')
.contains('Provider')
.next()
.contains(availableAngiCluster.provider);

cy.get('.tn-cluster-details')
.contains('SID')
.next()
.contains(availableAngiCluster.sid)
.should(
'have.attr',
'href',
`/databases/${availableAngiCluster.systemID}`
);

cy.get('.tn-cluster-details')
.contains('Cluster type')
.next()
.contains(availableAngiCluster.clusterType);

cy.get('.tn-cluster-details')
.contains('Cluster type')
.next()
.find('svg')
.trigger('mouseover');

cy.contains('span', availableAngiCluster.architectureType).should(
'exist'
);

cy.get('.tn-cluster-details')
.contains('HANA log replication mode')
.next()
.contains(availableAngiCluster.hanaSystemReplicationMode);

cy.get('.tn-cluster-details')
.contains('Fencing type')
.next()
.contains(availableAngiCluster.fencingType);

cy.get('.tn-cluster-details')
.contains('HANA secondary sync state')
.next()
.contains(availableAngiCluster.hanaSecondarySyncState);

cy.get('.tn-cluster-details')
.contains('Cluster maintenance')
.next()
.contains('False');

cy.get('.tn-cluster-details')
.contains('HANA log operation mode')
.next()
.contains(availableAngiCluster.hanaSystemReplicationOperationMode);

cy.get('.tn-cluster-details')
.contains('CIB last written')
.next()
.contains(availableAngiCluster.cibLastWritten);

const site1 = availableAngiCluster.sites[0];
const site2 = availableAngiCluster.sites[1];
cy.get(`.tn-site-details-${site1.name}`).contains(site1.state);
cy.get(`.tn-site-details-${site2.name}`).contains(site2.state);
});

it('should discover a Angi cluster with failover', () => {
cy.loadScenario('cluster-hana-scale-up-angi-failover');

cy.get('.tn-cluster-details')
.contains('HANA secondary sync state')
.next()
.contains('SFAIL');

const site1 = availableAngiCluster.sites[0];
const site2 = availableAngiCluster.sites[1];
cy.get(`.tn-site-details-${site1.name}`).contains('Failed');
cy.get(`.tn-site-details-${site2.name}`).contains(site1.state);
});
});

describe.skip('Check Selection should allow to enable checks from the checks catalog', () => {
it('should take me to the cluster settings when pressing the settings button', () => {
cy.get('button').contains('Check Selection').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const availableHanaCluster = {
sid: 'HDP',
systemID: '6c9208eb-a5bb-57ef-be5c-6422dedab602',
clusterType: 'HANA Scale Up',
architectureType: 'Classic',
provider: 'Azure',
hanaSystemReplicationMode: 'sync',
fencingType: 'external/sbd',
Expand Down Expand Up @@ -216,3 +217,37 @@ export const availableHanaCluster = {
},
],
};

export const availableAngiCluster = {
id: '69851bfe-5364-5ea8-93e1-cbe14268ccaf',
name: 'hana_angi',
sid: 'HN9',
systemID: '3daab481-1f21-5e32-84bc-0014bda8efdf',
clusterType: 'HANA Scale Up',
architectureType: 'Angi',
provider: 'Azure',
hanaSystemReplicationMode: 'sync',
fencingType: 'external/sbd',
maintenanceMode: false,
hanaSecondarySyncState: 'SOK',
cibLastWritten: 'Mon Jun 10 13:03:57 2024',
hanaSystemReplicationOperationMode: 'logreplay',
hosts: [
{
id: '851a4dd3-9693-44c3-a40b-b32d22872e74',
},
{
id: '4b67842f-ccf7-46a4-a344-9e918648b117',
},
],
sites: [
{
name: 'WDF',
state: 'Primary',
},
{
name: 'ROT',
state: 'Secondary',
},
],
};
Loading
Loading