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

PMM-7 matrix tweaks #895

Draft
wants to merge 14 commits into
base: v3
Choose a base branch
from
7 changes: 2 additions & 5 deletions docker-compose-disconnect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ services:
- '8143:8443'
environment:
- PMM_DEBUG=1
- PERCONA_TEST_SAAS_HOST=check-dev.percona.com:443
- PERCONA_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
- PERCONA_TEST_VERSION_SERVICE_URL=https://check-dev.percona.com/versions/v1
- PERCONA_TEST_TELEMETRY_INTERVAL=10s
- PERCONA_TEST_TELEMETRY_RETRY_BACKOFF=10s
- PMM_DEV_PERCONA_PLATFORM_ADDRESS=check-dev.percona.com:443
- PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX
networks:
- server-network

Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ services:
image: perconalab/sysbench
container_name: pmm-agent_sysbench
depends_on:
- mysql
- mysql8
networks:
- pmm-network
command: >
bash -c "
set -o xtrace
sleep 20
mysql \
--host=mysql \
--host=mysql8 \
--port=3306 \
--user=root \
--password=^O6VrIoC1@9b \
Expand All @@ -175,14 +175,14 @@ services:
/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua \
prepare
sysbench \
--rate=200 \
--rate=100 \
--threads=64 \
--report-interval=10 \
--time=0 \
--events=0 \
--rand-type=pareto \
--db-driver=mysql \
--mysql-host=mysql \
--mysql-host=mysql8 \
--mysql-port=3306 \
--mysql-user=root \
--mysql-password=^O6VrIoC1@9b \
Expand Down
8 changes: 3 additions & 5 deletions tests/configuration/verifyPMMInventory_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ Scenario(
remoteInstancesPage.openAddRemotePage('external');
const inputs = await remoteInstancesPage.fillRemoteFields(externalExporterServiceName);

I.waitForVisible(remoteInstancesPage.fields.addService, 30);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName);
const newLabels = {
environment: `${inputs.environment} edited` || `${externalExporterServiceName} environment edited`,
Expand Down Expand Up @@ -411,8 +410,7 @@ Scenario(
remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port,
);
I.scrollPageToBottom();
I.waitForVisible(remoteInstancesPage.fields.addService, 30);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName);
const newLabels = {
environment: `${remoteInstancesHelper.remote_instance.haproxy.environment} edited` || `${haproxyServiceName} environment edited`,
Expand Down Expand Up @@ -476,7 +474,7 @@ Data(azureServices).Scenario(
remoteInstancesPage.verifyAddInstancePageOpened();
const inputs = await remoteInstancesPage.fillRemoteRDSFields(serviceName);

I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName);
const newLabels = {
environment: `${inputs.environment} edited` || `${serviceName} environment edited`,
Expand Down
5 changes: 1 addition & 4 deletions tests/configuration/verifyPMMServerDisconnect_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ let clientServerNetwork = 'pmm-ui-tests_server-network';
const serverImage = process.env.DOCKER_VERSION || 'perconalab/pmm-server:3-dev-latest';

BeforeSuite(async ({ I }) => {
await I.verifyCommand(`PMM_SERVER_IMAGE=${serverImage} docker compose -f docker-compose-disconnect.yml up -d pmm-server-disconnect`);
await I.asyncWaitFor(async () => await I.verifyCommand(`echo $(curl -s -o /dev/null -w '%{http_code}' 127.0.0.1:${pmmServerPort}/ping)`) === '200', 60);
await I.verifyCommand('docker compose -f docker-compose-disconnect.yml up -d pmm-client');
await I.verifyCommand('docker compose -f docker-compose-disconnect.yml up -d ps8');
await I.verifyCommand(`PMM_SERVER_IMAGE=${serverImage} docker compose -f docker-compose-disconnect.yml up -d`);
clientServerNetwork = await I.verifyCommand('docker inspect pmm-client-disconnect -f \'{{range $k, $v := .NetworkSettings.Networks}}{{printf "%s\\n" $k}}{{end}}\' | grep -o \'.*server-network\'');
I.wait(20);
await I.verifyCommand('docker exec pmm-client-disconnect pmm-admin add mysql --username=root --password=7B*53@lCdflR --host=ps8 --port=3306 --query-source=perfschema ps8');
Expand Down
2 changes: 1 addition & 1 deletion tests/dashboards/verifyGCRemoteInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Data(instances).Scenario(
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage(instanceType);
await remoteInstancesPage.addRemoteDetails(instanceDetails);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(instanceDetails.serviceName);
await pmmInventoryPage.verifyAgentHasStatusRunning(instanceDetails.serviceName);
// Waiting for metrics to start hitting PMM-Server
Expand Down
2 changes: 1 addition & 1 deletion tests/ia/alerts_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Scenario(
await rulesAPI.removeAllAlertRules();

I.amOnPage(alertsPage.url);
I.seeElement(alertsPage.elements.noAlerts);
I.waitForElement(alertsPage.elements.noAlerts, 20);
},
);

Expand Down
28 changes: 26 additions & 2 deletions tests/pages/remoteInstancesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ module.exports = {

createRemoteInstance(serviceName) {
I.waitForVisible(this.fields.skipTLSL, 30);
I.waitForVisible(this.fields.addService, 30);
I.checkOption(this.fields.skipTLSL);
// eslint-disable-next-line default-case
switch (serviceName) {
Expand All @@ -521,12 +520,37 @@ module.exports = {
I.click(this.fields.disableBasicMetrics);
break;
}
I.click(this.fields.addService);

this.clickAddInstanceAndWaitForSuccess();
I.waitForVisible(pmmInventoryPage.fields.serviceRow(serviceName), 30);

return pmmInventoryPage;
},

async clickAddInstanceAndWaitForSuccess() {
I.waitForVisible(this.fields.addService, 30);

await I.usePlaywrightTo('click Add service and wait for response', async ({ page }) => {
await Promise.all([
page.waitForResponse(
async (response) => {
if (response.url().includes('v1/management/services')) {
if (response.status() === 200) {
return true;
}

throw new Error(`Expected status 200 but received ${response.status()}. Response: ${await response.text()}`);
}

return false;
},
{ timeout: 5000 },
),
page.click(this.fields.addService),
]);
});
},

openAddAzure() {
I.waitForVisible(this.fields.addAzureMySQLPostgreSQL, 10);
I.click(this.fields.addAzureMySQLPostgreSQL);
Expand Down
2 changes: 1 addition & 1 deletion tests/qa-integration/pmm_ps_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Scenario(
I.fillField(remoteInstancesPage.fields.password, details.password);
I.fillField(remoteInstancesPage.fields.environment, details.environment);
I.fillField(remoteInstancesPage.fields.cluster, details.cluster);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
// I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30);
I.wait(10);
await inventoryAPI.verifyServiceExistsAndHasRunningStatus(
Expand Down
2 changes: 1 addition & 1 deletion tests/qa-integration/pmm_psmdb_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Scenario(
I.fillField(remoteInstancesPage.fields.environment, details.environment);
I.fillField(remoteInstancesPage.fields.cluster, details.cluster);
I.click(remoteInstancesPage.fields.useQANMongoDBProfiler);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30);
await inventoryAPI.verifyServiceExistsAndHasRunningStatus(
{
Expand Down
2 changes: 1 addition & 1 deletion tests/qa-integration/pmm_pxc_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Scenario(
I.fillField(remoteInstancesPage.fields.password, details.password);
I.fillField(remoteInstancesPage.fields.environment, details.environment);
I.fillField(remoteInstancesPage.fields.cluster, details.cluster);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
// I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30);
await inventoryAPI.verifyServiceExistsAndHasRunningStatus(
{
Expand Down
8 changes: 4 additions & 4 deletions tests/remoteInstances/remoteInstancesHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ module.exports = {

// Used for Adding Remote Instance during Upgrade Tests runs for AMI and Docker via API
instanceTypes: {
mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'MySQL' : undefined),
mysql: (remoteInstanceStatus.mysql.ps_8_0.enabled ? 'MySQL' : undefined),
postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'PostgreSQL' : undefined),
mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'MongoDB' : undefined),
proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'ProxySQL' : undefined),
Expand All @@ -402,7 +402,7 @@ module.exports = {
// Generic object for each service type, used by both UI/Upgrade jobs depending on the service being used - don't add RDS here
serviceTypes: {
mysql: (
remoteInstanceStatus.mysql.ps_5_7.enabled ? {
remoteInstanceStatus.mysql.ps_8_0.enabled ? {
serviceType: SERVICE_TYPE.MYSQL,
service: 'mysql',
} : undefined
Expand Down Expand Up @@ -453,7 +453,7 @@ module.exports = {

// General Remote Instances Service List, this is what UI-tests job uses to run remote instances tests.
services: {
mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'mysql_remote_new' : undefined),
mysql: (remoteInstanceStatus.mysql.ps_8_0.enabled ? 'mysql_remote_new' : undefined),
mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'mongodb_remote_new' : undefined),
postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgresql_remote_new' : undefined),
proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_remote_new' : undefined),
Expand All @@ -465,7 +465,7 @@ module.exports = {

// Only add a service here when you want to include it as part of Upgrade tests cycle for AMI and Docker
upgradeServiceNames: {
mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'mysql_upgrade_service' : undefined),
mysql: (remoteInstanceStatus.mysql.ps_8_0.enabled ? 'mysql_upgrade_service' : undefined),
mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'psmdb_upgrade_scervice' : undefined),
proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_upgrade_service' : undefined),
postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgres_upgrade_service' : undefined),
Expand Down
8 changes: 4 additions & 4 deletions tests/verifyAWSRDSPostgreSQLInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Scenario(
remoteInstancesPage.startMonitoringOfInstance(serviceName);
remoteInstancesPage.verifyAddInstancePageOpened();
I.seeInField(remoteInstancesPage.fields.serviceName, serviceName);
remoteInstancesPage.fillRemoteRDSFields(serviceName);
await remoteInstancesPage.fillRemoteRDSFields(serviceName);
I.click(remoteInstancesPage.fields.customAutoDiscoveryButton);
I.clearField(remoteInstancesPage.fields.customAutoDiscoveryfield);
I.fillField(remoteInstancesPage.fields.customAutoDiscoveryfield, '1');
Expand Down Expand Up @@ -79,16 +79,16 @@ Scenario(

assert.ok(grabbedHostname.startsWith(serviceName), `Hostname is incorrect: ${grabbedHostname}`);
I.seeInField(remoteInstancesPage.fields.serviceName, serviceName);
remoteInstancesPage.fillRemoteRDSFields(serviceName);
await remoteInstancesPage.fillRemoteRDSFields(serviceName);
remoteInstancesPage.createRemoteInstance(serviceName);
pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName);
// Skipping due to QAN Setup part on AWS
// await pmmInventoryPage.verifyAgentHasStatusRunning(serviceName);

// await pmmInventoryPage.verifyMetricsFlags(serviceName);
const logs = await I.verifyCommand('docker exec pmm-server cat /srv/logs/pmm-agent.log | awk \'/ERRO/ && /rdsadmin/\'');
const logs = await I.verifyCommand('docker exec pmm-server cat /srv/logs/pmm-agent.log | awk \'/postgres_exporter/ && /ERRO/ && /opening connection/ && /rdsadmin/\'');

assert.ok(logs, `Logs contains errors about rdsadmin database being used! \n The lines are: \n ${logs}`);
assert.ok(!logs, `Logs contains errors about rdsadmin database being used! \n The lines are: \n ${logs}`);
},
);

Expand Down
2 changes: 1 addition & 1 deletion tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Data(azureServices).Scenario(
remoteInstancesPage.startMonitoringOfInstance(current.instanceToMonitor);
remoteInstancesPage.verifyAddInstancePageOpened();
await remoteInstancesPage.fillRemoteRDSFields(serviceName);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName);

if (serviceName === 'azure-MySQL') {
Expand Down
16 changes: 9 additions & 7 deletions tests/verifyRemoteInstances_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ for (const [key, value] of Object.entries(remoteInstancesHelper.services)) {

Feature('Remote DB Instances');

BeforeSuite(async ({ I }) => {
await I.verifyCommand('docker compose -f docker-compose.yml up -d');
});

Before(async ({ I }) => {
await I.Authorize();
});
Expand All @@ -75,8 +79,7 @@ Scenario(
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage('external');
await remoteInstancesPage.fillRemoteFields(externalExporterServiceName);
I.waitForVisible(remoteInstancesPage.fields.addService, 30);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName);
await I.click(pmmInventoryPage.fields.showServiceDetails(externalExporterServiceName));
await I.click(pmmInventoryPage.fields.agentsLinkNew);
Expand Down Expand Up @@ -206,8 +209,7 @@ Scenario(
remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port,
);
I.scrollPageToBottom();
I.waitForVisible(remoteInstancesPage.fields.addService, 30);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName);

await I.click(pmmInventoryPage.fields.showServiceDetails(haproxyServiceName));
Expand Down Expand Up @@ -260,10 +262,10 @@ Data(remotePostgreSQL).Scenario(
I.waitForVisible(remoteInstancesPage.fields.skipTLSL, 30);
I.click(remoteInstancesPage.fields.skipTLSL);
I.click(current.trackingOption);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(current.instanceName);
await pmmInventoryPage.verifyAgentHasStatusRunning(current.instanceName);
pmmInventoryPage.checkExistingAgent(current.checkAgent);
await pmmInventoryPage.checkExistingAgent(current.checkAgent);
},
);

Expand Down Expand Up @@ -336,7 +338,7 @@ Scenario(
I.click(remoteInstancesPage.fields.addService);
I.verifyPopUpMessage(errorMessage);
I.fillField(remoteInstancesPage.fields.database, 'not_default_db');
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName);
await pmmInventoryPage.verifyAgentHasStatusRunning(remoteServiceName);
// verify metric for client container node instance
Expand Down
4 changes: 2 additions & 2 deletions tests/verifyTLSMongoDBRemoteInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Data(instances).Scenario(
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage(serviceType);
await remoteInstancesPage.addRemoteSSLDetails(details);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
await inventoryAPI.verifyServiceExistsAndHasRunningStatus(
{
serviceType: SERVICE_TYPE.MONGODB,
Expand Down Expand Up @@ -221,7 +221,7 @@ Data(instances).Scenario(
remoteInstancesPage.openAddRemotePage(serviceType);
await remoteInstancesPage.addRemoteSSLDetails(details);
I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();

// Check Remote Instance also added and have running status
pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName);
Expand Down
4 changes: 2 additions & 2 deletions tests/verifyTLSMySQLRemoteInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Data(instances).Scenario(
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage(serviceType);
await remoteInstancesPage.addRemoteSSLDetails(details);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
// Add wait for service status to be updated
I.wait(10);
await inventoryAPI.verifyServiceExistsAndHasRunningStatus(
Expand Down Expand Up @@ -244,7 +244,7 @@ Data(maxQueryLengthInstances).Scenario(
remoteInstancesPage.openAddRemotePage(serviceType);
await remoteInstancesPage.addRemoteSSLDetails(details);
I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();

// Check Remote Instance also added and have running status
pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName);
Expand Down
4 changes: 2 additions & 2 deletions tests/verifyTLSPostgresRemoteInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Data(instances).Scenario(
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage(serviceType);
await remoteInstancesPage.addRemoteSSLDetails(details);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
await inventoryAPI.verifyServiceExistsAndHasRunningStatus(
{
serviceType: SERVICE_TYPE.POSTGRESQL,
Expand Down Expand Up @@ -225,7 +225,7 @@ Data(instances).Scenario(
remoteInstancesPage.openAddRemotePage(serviceType);
await remoteInstancesPage.addRemoteSSLDetails(details);
I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength);
I.click(remoteInstancesPage.fields.addService);
await remoteInstancesPage.clickAddInstanceAndWaitForSuccess();

// Check Remote Instance also added and have running status
pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName);
Expand Down
Loading