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

[release-4.4] Bug 1805230: Re-enable monitoring tests in CI #4384

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions frontend/integration-tests/tests/alertmanager.scenario.ts
Expand Up @@ -15,6 +15,7 @@ import * as horizontalnavView from '../views/horizontal-nav.view';
import { execSync } from 'child_process';

const replaceInput = async (fieldName: string, value: string) => {
await browser.wait(until.elementToBeClickable(firstElementByTestID(fieldName)));
await firstElementByTestID(fieldName).clear();
await firstElementByTestID(fieldName).sendKeys(value);
};
Expand All @@ -28,7 +29,7 @@ const getGlobalsAndReceiverConfig = (configName: string, yamlStr: string) => {
};
};

xdescribe('Alertmanager: PagerDuty Receiver Form', () => {
describe('Alertmanager: PagerDuty Receiver Form', () => {
afterAll(() => {
execSync(
`kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`,
Expand Down Expand Up @@ -125,7 +126,7 @@ xdescribe('Alertmanager: PagerDuty Receiver Form', () => {
});
});

xdescribe('Alertmanager: Email Receiver Form', () => {
describe('Alertmanager: Email Receiver Form', () => {
afterAll(() => {
execSync(
`kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`,
Expand Down Expand Up @@ -235,7 +236,7 @@ xdescribe('Alertmanager: Email Receiver Form', () => {
});
});

xdescribe('Alertmanager: Slack Receiver Form', () => {
describe('Alertmanager: Slack Receiver Form', () => {
afterAll(() => {
execSync(
`kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`,
Expand Down Expand Up @@ -304,7 +305,7 @@ xdescribe('Alertmanager: Slack Receiver Form', () => {
});
});

xdescribe('Alertmanager: Webhook Receiver Form', () => {
describe('Alertmanager: Webhook Receiver Form', () => {
afterAll(() => {
execSync(
`kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`,
Expand Down
31 changes: 18 additions & 13 deletions frontend/integration-tests/tests/monitoring.scenario.ts
@@ -1,6 +1,6 @@
import { browser, ExpectedConditions as until } from 'protractor';

import { checkLogs, checkErrors, firstElementByTestID } from '../protractor.conf';
import { checkLogs, checkErrors, firstElementByTestID, appHost } from '../protractor.conf';
import { dropdownMenuForTestID } from '../views/form.view';
import * as crudView from '../views/crud.view';
import * as yamlView from '../views/yaml.view';
Expand All @@ -20,7 +20,7 @@ const testDetailsPage = (subTitle, alertName, expectLabel = true) => {
}
};

xdescribe('Monitoring: Alerts', () => {
describe('Monitoring: Alerts', () => {
afterEach(() => {
checkLogs();
checkErrors();
Expand Down Expand Up @@ -106,7 +106,7 @@ xdescribe('Monitoring: Alerts', () => {
});
});

xdescribe('Monitoring: Silences', () => {
describe('Monitoring: Silences', () => {
afterEach(() => {
checkLogs();
checkErrors();
Expand Down Expand Up @@ -186,7 +186,7 @@ xdescribe('Monitoring: Silences', () => {
});
});

xdescribe('Alertmanager: YAML', () => {
describe('Alertmanager: YAML', () => {
afterEach(() => {
checkLogs();
checkErrors();
Expand Down Expand Up @@ -214,7 +214,7 @@ xdescribe('Alertmanager: YAML', () => {
});
});

xdescribe('Alertmanager: Configuration', () => {
describe('Alertmanager: Configuration', () => {
afterAll(() => {
execSync(
`kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`,
Expand All @@ -227,13 +227,7 @@ xdescribe('Alertmanager: Configuration', () => {
});

it('displays the Alermanager Configuration Details page', async () => {
await sidenavView.clickNavLink(['Administration', 'Cluster Settings']);
await crudView.isLoaded();
await horizontalnavView.clickHorizontalTab('Global Configuration');
await crudView.isLoaded();
await monitoringView.wait(until.elementToBeClickable(firstElementByTestID('alertmanager')));
expect(firstElementByTestID('alertmanager').getText()).toContain('Alertmanager');
await firstElementByTestID('alertmanager').click();
await browser.get(`${appHost}/monitoring/alertmanagerconfig`);
await crudView.isLoaded();
expect(monitoringView.alertRoutingHeader.getText()).toContain('Alert Routing');
});
Expand Down Expand Up @@ -291,7 +285,18 @@ xdescribe('Alertmanager: Configuration', () => {
expect(monitoringView.saveButton.isEnabled()).toBe(true); // subform valid, save should be enabled at this point

// labels
expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(false);
await firstElementByTestID('label-name-0').sendKeys('9abcgo'); // invalid, cannot start with digit
expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(true);
await firstElementByTestID('label-name-0').clear();
await firstElementByTestID('label-name-0').sendKeys('_abcd'); // valid, can start with and contain '_'
expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(false);
await firstElementByTestID('label-name-0').clear();
await firstElementByTestID('label-name-0').sendKeys('abcd@#$R@T%'); // invalid chars
expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(true);
await firstElementByTestID('label-name-0').clear();
await firstElementByTestID('label-name-0').sendKeys('severity');
expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(false);
await firstElementByTestID('label-value-0').sendKeys('warning');

await monitoringView.saveButton.click();
Expand Down Expand Up @@ -333,7 +338,7 @@ xdescribe('Alertmanager: Configuration', () => {
});

it('deletes a receiver correctly', async () => {
await horizontalnavView.clickHorizontalTab('Overview');
await horizontalnavView.clickHorizontalTab('Details');
await crudView.isLoaded();
expect(crudView.resourceRows.count()).toBe(2);

Expand Down
Expand Up @@ -60,7 +60,7 @@ export const RoutingLabelEditor = ({ formValues, dispatchFormChange, isDefaultRe
};

const InvalidLabelName = () => (
<span data-test-id="invalidLabelNameError">
<span data-test-id="invalid-label-name-error">
Invalid name
<Tooltip
content={
Expand Down