Skip to content

Commit

Permalink
PMM-13316 Update mongo usage for nightly tests (#835)
Browse files Browse the repository at this point in the history
* Updates for MongoDB service name changes
  • Loading branch information
saikumar-vs authored Aug 27, 2024
1 parent 8951cc0 commit 023bf02
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions tests/QAN/details_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ Scenario(
Scenario(
'PMM-T13 - Check Explain and Example for supported DBs - mongodb @qan',
async ({
I, qanPage, qanOverview, qanFilters, qanDetails,
I, qanPage, qanOverview, qanFilters, qanDetails, inventoryAPI,
}) => {
I.amOnPage(I.buildUrlWithParams(qanPage.clearUrl, { service_name: 'rs101', from: 'now-1h' }));
const service_response = await inventoryAPI.apiGetNodeInfoByServiceName('MONGODB_SERVICE', 'rs1_1');

I.amOnPage(I.buildUrlWithParams(qanPage.clearUrl, { service_name: service_response.service_name, from: 'now-1h' }));
I.waitForElement(qanOverview.elements.querySelector, 30);
qanOverview.selectRow(1);
qanFilters.waitForFiltersToLoad();
Expand All @@ -128,7 +130,7 @@ Scenario(
qanOverview.selectRow(1);
qanFilters.waitForFiltersToLoad();
qanDetails.checkExplainTab();
await qanFilters.applyFilter('rs101');
await qanFilters.applyFilter('rs1_1');
I.waitForElement(qanOverview.elements.querySelector, 30);
qanOverview.selectRow(1);

Expand Down
4 changes: 2 additions & 2 deletions tests/QAN/filters_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ const assert = require('assert');

const shortCutTests = new DataTable(['type', 'dashboard', 'shortcutLink', 'filter']);

shortCutTests.add(['Cluster', 'MongoDB Cluster Summary', 'graph/d/mongodb-cluster-summary/mongodb-cluster-summary', 'replicaset']);
shortCutTests.add(['Replication Set', 'MySQL Replication Summary', 'graph/d/mysql-replicaset-summary/mysql-replication-summary', 'ps-repl1']);
shortCutTests.add(['Node Name', 'Node Summary', 'graph/d/node-instance-summary/node-summary?var-node_name=pmm-server', 'pmm-server']);
shortCutTests.add(['Service Name', 'MongoDB Instance Summary', 'graph/d/mongodb-instance-summary/mongodb-instance-summary', 'rs101']);
shortCutTests.add(['Service Name', 'MongoDB ReplSet Summary', 'graph/d/mongodb-replicaset-summary/mongodb-replset-summary', 'rs1']);

Feature('QAN filters').retry(1);
// filterToApply - filter witch we check, searchValue - value to get zero search result
Expand Down Expand Up @@ -250,6 +249,7 @@ Data(shortCutTests).Scenario(
I, qanFilters, dashboardPage, current, adminPage, qanOverview, qanPage,
}) => {
const shortCutLink = current.shortcutLink;

const header = current.dashboard;
const filterValue = current.filter;
const timeRangeValue = 'from=now-3h&to=now';
Expand Down
4 changes: 2 additions & 2 deletions tests/QAN/pages/qanFiltersFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ module.exports = {
async verifyShortcutAttributes(href, filterValue, timeRangeValue) {
let shortCutLocator = locate(`$filter-checkbox-${filterValue}`).find('a');

if (filterValue === 'mongodb_rs1_2') {
shortCutLocator = '//div[contains(@data-testid, "filter-checkbox-mongodb_rs1_2")]//a';
if (filterValue === 'mongodb_rs1') {
shortCutLocator = '//div[contains(@data-testid, "filter-checkbox-mongodb_rs1")]//a';
}

await I.waitForVisible(shortCutLocator, 20);
Expand Down
2 changes: 1 addition & 1 deletion tests/configuration/pages/pmmInventoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
inventoryTableRows: locate('tr').after('table'),
inventoryTableRowCount: (count) => locate('span').withText(`${count}`),
kebabMenu: (serviceName) => `${service(serviceName)}//ancestor::tr//button[@data-testid="dropdown-menu-toggle"]`,
mongoServiceName: locate('td').withText('rs10'),
mongoServiceName: locate('td').withText('rs1'),
mysqlServiceName: locate('td').withText('ms-single'),
// cannot be changed to locate because it's failing in I.waitForVisible()
nodesLink: locate('[role="tablist"] a').withText('Nodes').withAttr({ 'aria-label': 'Tab Nodes' }),
Expand Down
2 changes: 1 addition & 1 deletion tests/verifyAnnotations_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');
const annotation = new DataTable(['annotationName', 'service', 'dashboard', 'service_type']);

annotation.add(['annotation-for-postgres-server', 'pmm-server', dashboardPage.postgresqlInstanceSummaryDashboard.url, 'POSTGRESQL_SERVICE']);
annotation.add(['annotation-for-mongo', 'rs10', dashboardPage.mongoDbInstanceSummaryDashboard.url, 'MONGODB_SERVICE']);
annotation.add(['annotation-for-mongo', 'rs1', dashboardPage.mongoDbInstanceSummaryDashboard.url, 'MONGODB_SERVICE']);
annotation.add(['annotation-for-postgres', 'PGSQL', dashboardPage.postgresqlInstanceSummaryDashboard.url, 'POSTGRESQL_SERVICE']);
annotation.add(['annotation-for-mysql', 'ms-', dashboardPage.mysqlInstanceSummaryDashboard.url, 'MYSQL_SERVICE']);
annotation.add(['mysql-node-name', 'ms-', dashboardPage.nodesCompareDashboard.url, 'MYSQL_SERVICE']);
Expand Down

0 comments on commit 023bf02

Please sign in to comment.