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

PMM3 13601 Fix QA-integration tests #906

Merged
merged 4 commits into from
Dec 10, 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
12 changes: 5 additions & 7 deletions tests/qa-integration/pmm_pdpgsql_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ Scenario(
const grabServiceName = await I.grabTextFrom('//label[@for="var-service_name"]//following-sibling::*');
const partsServiceName = grabServiceName.split('_service');
const containerServiceName = partsServiceName[0];

I.wait(60);
await dashboardPage.expandEachDashboardRow();
adminPage.performPageDown(5);
adminPage.performPageUp(5);
await dashboardPage.verifyMetricsExistence(dashboardPage.postgresqlInstanceSummaryDashboard.metrics);
await dashboardPage.verifyThereAreNoGraphsWithoutData(1);
await I.verifyCommand('pmm-admin list | grep "postgresql_pgstatmonitor_agent" | grep "Running"');
await I.verifyCommand('pmm-admin list | grep "postgres_exporter" | grep "Running"');
await dashboardPage.verifyThereAreNoGraphsWithoutData();
await I.verifyCommand(`docker exec ${containerServiceName} pmm-admin list | grep "postgresql_pgstatmonitor_agent" | grep "Running"`);
await I.verifyCommand(`docker exec ${containerServiceName} pmm-admin list | grep "postgres_exporter" | grep "Running"`);
},
);
).retry(3);
17 changes: 10 additions & 7 deletions tests/qa-integration/pmm_ps_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Scenario(
I.amOnPage(remoteInstancesPage.url);
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage('mysql');
I.waitForElement(remoteInstancesPage.fields.hostName, 30);
remoteInstancesPage.selectDropdownOption('$nodes-selectbox', 'pmm-server');
I.fillField(remoteInstancesPage.fields.hostName, details.host);
I.clearField(remoteInstancesPage.fields.portNumber);
I.fillField(remoteInstancesPage.fields.portNumber, details.port);
Expand Down Expand Up @@ -73,7 +75,7 @@ Scenario(
const metricName = 'mysql_global_status_max_used_connections';

await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysqld_exporter" | grep "Running" | wc -l | grep "1"`);
await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysql_slowlog_agent" | grep "Running" | wc -l | grep "1"`);
await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep "mysql_perfschema_agent" | grep "Running" | wc -l | grep "1"`);

const clientServiceName = (await I.verifyCommand(`docker exec ${container_name} pmm-admin list | grep MySQL | head -1 | awk -F" " '{print $2}'`)).trim();

Expand All @@ -82,15 +84,15 @@ Scenario(

// verify metric for client container node instance
response = await grafanaAPI.checkMetricExist(metricName, { type: 'service_name', value: clientServiceName });
result = JSON.stringify(response.data.data.result);
result = JSON.stringify(response.data.results);

assert.ok(response.data.data.result.length !== 0, `Metrics ${metricName} from ${clientServiceName} should be available but got empty ${result}`);
assert.ok(response.data.results.A.frames[0].data.values.length !== 0, `Metrics ${metricName} from ${clientServiceName} should be available but got empty ${result}`);

// verify metric for remote instance
response = await grafanaAPI.checkMetricExist(metricName, { type: 'service_name', value: remoteServiceName });
result = JSON.stringify(response.data.data.result);
result = JSON.stringify(response.data.results);

assert.ok(response.data.data.result.length !== 0, `Metrics ${metricName} from ${remoteServiceName} should be available but got empty ${result}`);
assert.ok(response.data.results.A.frames[0].data.values.length !== 0, `Metrics ${metricName} from ${remoteServiceName} should be available but got empty ${result}`);
},
).retry(1);

Expand Down Expand Up @@ -175,12 +177,13 @@ Scenario(
await queryAnalyticsPage.filters.selectFilter(dbName);
queryAnalyticsPage.waitForLoaded();
for (let i = 0; i <= 24; i++) {
I.refreshPage();
const countOfQueries = parseInt((await I.grabTextFrom(queryAnalyticsPage.data.elements.totalItems)).split('of ')[1], 10);

I.wait(10);
if (countOfQueries === 17) continue;
if (countOfQueries <= 17) continue;

if (i === 24) assert.equal(countOfQueries, 17, 'Count of queries is incorrect');
if (i === 24) assert.ok(countOfQueries <= 17, 'Count of queries is incorrect');
}
},
).retry(1);
11 changes: 7 additions & 4 deletions tests/qa-integration/pmm_pxc_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Scenario(
I.amOnPage(remoteInstancesPage.url);
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage('mysql');
I.waitForElement(remoteInstancesPage.fields.hostName, 30);
remoteInstancesPage.selectDropdownOption('$nodes-selectbox', 'pmm-server');
I.fillField(remoteInstancesPage.fields.hostName, details.host);
I.clearField(remoteInstancesPage.fields.portNumber);
I.fillField(remoteInstancesPage.fields.portNumber, details.port);
Expand Down Expand Up @@ -81,15 +83,15 @@ Scenario(

// verify metric for client container node instance
response = await grafanaAPI.checkMetricExist(metricName, { type: 'service_name', value: clientServiceName });
result = JSON.stringify(response.data.data.result);
result = JSON.stringify(response.data.results);

assert.ok(response.data.data.result.length !== 0, `Metrics ${metricName} from ${clientServiceName} should be available but got empty ${result}`);
assert.ok(response.data.results.A.frames[0].data.values.length !== 0, `Metrics ${metricName} from ${clientServiceName} should be available but got empty ${result}`);

// verify metric for remote instance
response = await grafanaAPI.checkMetricExist(metricName, { type: 'service_name', value: remoteServiceName });
result = JSON.stringify(response.data.data.result);
result = JSON.stringify(response.data.results);

assert.ok(response.data.data.result.length !== 0, `Metrics ${metricName} from ${remoteServiceName} should be available but got empty ${result}`);
assert.ok(response.data.results.A.frames[0].data.values.length !== 0, `Metrics ${metricName} from ${remoteServiceName} should be available but got empty ${result}`);
},
).retry(1);

Expand All @@ -107,6 +109,7 @@ Scenario(
url = I.buildUrlWithParams(dashboardPage.mysqlPXCGaleraNodeSummaryDashboard.clearUrl, { from: 'now-15m', service_name: service });

I.amOnPage(url);
I.wait(30);
await dashboardPage.waitForDashboardOpened();
adminPage.performPageDown(5);
await dashboardPage.expandEachDashboardRow();
Expand Down
Loading