Skip to content

Commit

Permalink
Merge branch 'main' into PMM-T2269
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Yarosh authored Jul 30, 2023
2 parents 98fad9f + 157652b commit 87f14b3
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pmm-upgrade-ui-tests-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
upgrade_type: ${{ inputs.upgrade_type || 'Docker way' }}
pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }}
services_list: '--addclient=ps,1 --addclient=pdpgsql,1'
repository: ${{ inputs.repository }}
repository: ${{ inputs.repository || 'dev-latest'}}
version_string_from: ${{needs.get_versions.outputs.start_version}}
version_string_to: ${{needs.get_versions.outputs.finish_version}}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pmm-version-getter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ jobs:
array=$(wget -q https://registry.hub.docker.com/v2/repositories/percona/pmm-client/tags?page_size=50 -O - | jq -r .results[].name | grep -v latest | sort -V | grep -E '[[:digit:]]\.[[:digit:]]+\.[[:digit:]]' | tail -$((range)))
fi
jq -c -n '$ARGS.positional' --args ${array[@]}
echo "result=$(jq -c -n '$ARGS.positional' --args '2.11.0' ${array[@]})" >> "$GITHUB_OUTPUT"
echo "result=$(jq -c -n '$ARGS.positional' --args ${array[@]})" >> "$GITHUB_OUTPUT"
#echo "result=$(jq -c -n '$ARGS.positional' --args '2.11.0' ${array[@]})" >> "$GITHUB_OUTPUT"
29 changes: 28 additions & 1 deletion tests/ia/alertRules_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,38 @@ Scenario(
// FIXME: unskip after https://jira.percona.com/browse/PMM-11399 is fixed
// I.verifyPopUpMessage(alertRulesPage.messages.successRuleCreate(newRule.ruleName));
alertRulesPage.verifyRuleList(newRule.folder, newRule.ruleName);
I.seeTextEquals('Normal', alertRulesPage.elements.ruleState);
await alertRulesPage.verifyRuleState('Normal',60);
await rulesAPI.removeAlertRule(newRule.folder);
},
).retry(1);

Scenario(
'PMM-T2282 Verfied Alerting is able to monitor for "PMM Agent Down" @ia @alerting-fb',
async ({ I, alertRulesPage, rulesAPI }) => {
const rule = page.rules[29];
const newRule = page.rules[30];

alertRulesPage.openAlertRulesTab();
I.waitForEnabled(alertRulesPage.buttons.newAlertRule, 10);
I.click(alertRulesPage.buttons.newAlertRule);
await alertRulesPage.fillPerconaAlert(rule,newRule);
I.click(alertRulesPage.buttons.saveAndExit);
// FIXME: unskip after https://jira.percona.com/browse/PMM-11399 is fixed
// I.verifyPopUpMessage(alertRulesPage.messages.successRuleCreate(newRule.ruleName));
await alertRulesPage.verifyRuleList(newRule.folder, newRule.ruleName);
await I.verifyCommand('docker pause ms_pmm_8.0');
await alertRulesPage.verifyRuleState('Pending',180);
//await I.waitForText('Pending', 180, alertRulesPage.elements.ruleState1);
await alertRulesPage.verifyRuleState('Firing',180);
//await I.waitForText('Firing', 180, alertRulesPage.elements.ruleState2);
await I.verifyCommand('docker unpause ms_pmm_8.0');
//await I.waitForText('Normal', 180, alertRulesPage.elements.ruleState3);
await alertRulesPage.verifyRuleState('Normal',180);
await rulesAPI.removeAlertRule(newRule.folder);
},
).retry(1);


// TODO: check ovf failure
Scenario(
'PMM-T1430 Verify user can edit Percona templated alert @ia @not-ovf @alerting-fb',
Expand Down
11 changes: 9 additions & 2 deletions tests/ia/pages/alertRulesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
noRules: 'div.page-body > div',
columnHeaderLocator: (columnHeaderText) => locate('$header').withText(columnHeaderText),
ruleNameValue: 'div[data-column=\'Name\']',
ruleState: '//div[@data-column=\'State\']//div//span',
ruleState: (text) => `//span[contains(.,'${text}')]`,
ruleDetails: 'div[data-testid=\'expanded-content\']',
searchByDataSourceDropdown: '//div[@aria-label="Data source picker select container"]',
searchByLabel: '$input-wrapper',
Expand Down Expand Up @@ -79,7 +79,10 @@ module.exports = {
I.waitForElement(this.fields.templatesLoader);
this.searchAndSelectResult('template', template);
this.verifyAndReplaceInputField('ruleName', ruleName, editedRule.ruleName);
this.verifyAndReplaceInputField('threshold', threshold, editedRule.threshold);
const thresholdExists = await I.grabNumberOfVisibleElements(this.fields.resultsLocator(threshold));
if (thresholdExists >0 ) {
this.verifyAndReplaceInputField('threshold', threshold, editedRule.threshold);
}
this.verifyAndReplaceInputField('duration', duration, editedRule.duration);
I.see(severity, this.fields.searchDropdown('severity'));
this.searchAndSelectResult('severity', editedRule.severity);
Expand Down Expand Up @@ -146,4 +149,8 @@ module.exports = {
I.click(this.buttons.groupCollapseButton(folder));
I.seeTextEquals(ruleName, this.elements.ruleNameValue);
},

verifyRuleState(ruleName, timeOut) {
I.waitForText(ruleName, timeOut, this.elements.ruleState(ruleName));
},
};
14 changes: 14 additions & 0 deletions tests/ia/pages/testData.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@ module.exports = {
],
channels: [],
activate: true,
}, {
template: 'PMM agent down',
ruleName: 'pmm_agent_down Alerting Rule',
threshold: null,
duration: '60s',
severity: 'Critical',
folder: 'Experimental',
}, {
template: 'PMM agent down',
ruleName: 'Custom pmm_agent_down Alerting Rule',
threshold: null,
duration: '60s',
severity: 'Critical',
folder: 'Experimental',
}],
templates: [{
template: 'Memory used by MongoDB connections',
Expand Down
22 changes: 22 additions & 0 deletions tests/qa-integration/pmm_pgsm_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const version = process.env.PGSQL_VERSION ? `${process.env.PGSQL_VERSION}` : '14
const container = process.env.PGSQL_PGSM_CONTAINER ? `${process.env.PGSQL_PGSM_CONTAINER}` : 'pgsql_pgsm';
const database = `pgsm${Math.floor(Math.random() * 99) + 1}`;
const pgsm_service_name = `${container}_${version}_service`;
const pgsm_service_name_socket = `socket_${container}_${version}_service`;
const container_name = `${container}_${version}`;
const percentageDiff = (a, b) => (a - b === 0 ? 0 : 100 * Math.abs((a - b) / b));

Expand Down Expand Up @@ -175,6 +176,27 @@ Scenario(
},
);

Scenario(
'PMM-T2261 - Verify Postgresql Dashboard Instance Summary has Data with socket based service and Agent log @not-ui-pipeline @pgsm-pmm-integration',
async ({
I, dashboardPage, adminPage,
}) => {
I.amOnPage(dashboardPage.postgresqlInstanceSummaryDashboard.url);
dashboardPage.waitForDashboardOpened();
await dashboardPage.applyFilter('Service Name', pgsm_service_name_socket);
await dashboardPage.expandEachDashboardRow();
I.click(adminPage.fields.metricTitle);
adminPage.performPageDown(5);
adminPage.performPageUp(5);
dashboardPage.verifyMetricsExistence(dashboardPage.postgresqlInstanceSummaryDashboard.metrics);
await dashboardPage.verifyThereAreNoGraphsWithNA();
await dashboardPage.verifyThereAreNoGraphsWithoutData(1);
let log = await I.verifyCommand(`docker exec ${container_name} cat pmm-agent.log`);
I.assertFalse(log.includes('Error opening connection to database \(postgres'),
'The log wasn\'t supposed to contain errors regarding connection to postgress database but it does')
},
);

// The numbers don't entirely match, we need to find a way to track based on difference
Scenario(
'PMM-T1259 - Verifying data in Clickhouse and comparing with PGSM output @pgsm-pmm-integration @not-ui-pipeline',
Expand Down

0 comments on commit 87f14b3

Please sign in to comment.