diff --git a/.github/workflows/pmm-upgrade-ui-tests-matrix.yml b/.github/workflows/pmm-upgrade-ui-tests-matrix.yml index 8bbaddf21..ca96b11c9 100644 --- a/.github/workflows/pmm-upgrade-ui-tests-matrix.yml +++ b/.github/workflows/pmm-upgrade-ui-tests-matrix.yml @@ -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}} diff --git a/.github/workflows/pmm-version-getter.yml b/.github/workflows/pmm-version-getter.yml index b66af4992..4bae98fee 100644 --- a/.github/workflows/pmm-version-getter.yml +++ b/.github/workflows/pmm-version-getter.yml @@ -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" diff --git a/tests/ia/alertRules_test.js b/tests/ia/alertRules_test.js index 1e39aaa79..1be7c310c 100644 --- a/tests/ia/alertRules_test.js +++ b/tests/ia/alertRules_test.js @@ -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', diff --git a/tests/ia/pages/alertRulesPage.js b/tests/ia/pages/alertRulesPage.js index bcd446cbc..a6252e744 100644 --- a/tests/ia/pages/alertRulesPage.js +++ b/tests/ia/pages/alertRulesPage.js @@ -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', @@ -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); @@ -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)); + }, }; diff --git a/tests/ia/pages/testData.js b/tests/ia/pages/testData.js index 2e988409f..182760c8c 100644 --- a/tests/ia/pages/testData.js +++ b/tests/ia/pages/testData.js @@ -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', diff --git a/tests/qa-integration/pmm_pgsm_integration_test.js b/tests/qa-integration/pmm_pgsm_integration_test.js index c42c083dd..6a0aad034 100644 --- a/tests/qa-integration/pmm_pgsm_integration_test.js +++ b/tests/qa-integration/pmm_pgsm_integration_test.js @@ -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)); @@ -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',