Skip to content

Commit

Permalink
PMM-7 tweak remote instances
Browse files Browse the repository at this point in the history
  • Loading branch information
yurkovychv committed Nov 14, 2024
1 parent e8d0ddc commit 76311c4
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 49 deletions.
40 changes: 20 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ services:

# It is essential to have an extra directory `/slowlogs/` between host and container;
# Otherwise, MySQL in Docker for Mac completely locks during/after slowlog rotation tests.
mysql:
image: ${MYSQL_IMAGE:-percona:5.7.30}
container_name: pmm-agent_mysql_5_7
command: >
--sql-mode="ANSI_QUOTES"
--performance-schema --innodb_monitor_enable=all --userstat
--slow_query_log --log_slow_rate_limit=1 --log_slow_admin_statements --log_slow_slave_statements --slow_query_log_file=/tmp/mysql/log/ps5_slow_log.log --long_query_time=0
--character-set-server=utf8 --default-authentication-plugin=mysql_native_password --collation-server=utf8_unicode_ci
ports:
- "3309:3306"
environment:
- MYSQL_ROOT_PASSWORD=^O6VrIoC1@9b
- MYSQL_USER=pmm-agent
- MYSQL_PASSWORD=pmm%*&agent-password
- UMASK=0777 # for slowlog file
volumes:
- /tmp/mysql/log:/tmp/mysql/log:rw
networks:
- pmm-network
# mysql:
# image: ${MYSQL_IMAGE:-percona:5.7.30}
# container_name: pmm-agent_mysql_5_7
# command: >
# --sql-mode="ANSI_QUOTES"
# --performance-schema --innodb_monitor_enable=all --userstat
# --slow_query_log --log_slow_rate_limit=1 --log_slow_admin_statements --log_slow_slave_statements --slow_query_log_file=/tmp/mysql/log/ps5_slow_log.log --long_query_time=0
# --character-set-server=utf8 --default-authentication-plugin=mysql_native_password --collation-server=utf8_unicode_ci
# ports:
# - "3309:3306"
# environment:
# - MYSQL_ROOT_PASSWORD=^O6VrIoC1@9b
# - MYSQL_USER=pmm-agent
# - MYSQL_PASSWORD=pmm%*&agent-password
# - UMASK=0777 # for slowlog file
# volumes:
# - /tmp/mysql/log:/tmp/mysql/log:rw
# networks:
# - pmm-network

mysql8:
image: ${MYSQL_IMAGE:-percona:8.0}
Expand Down Expand Up @@ -175,7 +175,7 @@ services:
/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua \
prepare
sysbench \
--rate=200 \
--rate=100 \
--threads=64 \
--report-interval=10 \
--time=0 \
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);
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);
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);
remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName);
const newLabels = {
environment: `${inputs.environment} edited` || `${serviceName} environment edited`,
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);
remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(instanceDetails.serviceName);
await pmmInventoryPage.verifyAgentHasStatusRunning(instanceDetails.serviceName);
// Waiting for metrics to start hitting PMM-Server
Expand Down
25 changes: 23 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,34 @@ module.exports = {
I.click(this.fields.disableBasicMetrics);
break;
}
I.click(this.fields.addService);

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

return pmmInventoryPage;
},

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

I.waitForResponse(
(response) => {
if (response.url().includes('v1/management/services')) {
if (response.status() === 200) {
return true;
}

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

// Continue waiting if this isn't the target request
return false;
},
30,
);
},

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);
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);
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);
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
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);
remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName);

if (serviceName === 'azure-MySQL') {
Expand Down
12 changes: 5 additions & 7 deletions tests/verifyRemoteInstances_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ Scenario(
remoteInstancesPage.waitUntilRemoteInstancesPageLoaded();
remoteInstancesPage.openAddRemotePage('external');
await remoteInstancesPage.fillRemoteFields(externalExporterServiceName);
I.waitForVisible(remoteInstancesPage.fields.addService, 30);
I.click(remoteInstancesPage.fields.addService);
remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName);
await I.click(pmmInventoryPage.fields.showServiceDetails(externalExporterServiceName));
await I.click(pmmInventoryPage.fields.agentsLinkNew);
Expand Down Expand Up @@ -206,8 +205,7 @@ Scenario(
remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port,
);
I.scrollPageToBottom();
I.waitForVisible(remoteInstancesPage.fields.addService, 30);
I.click(remoteInstancesPage.fields.addService);
remoteInstancesPage.clickAddInstanceAndWaitForSuccess();
pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName);

await I.click(pmmInventoryPage.fields.showServiceDetails(haproxyServiceName));
Expand Down Expand Up @@ -260,10 +258,10 @@ Data(remotePostgreSQL).Scenario(
I.waitForVisible(remoteInstancesPage.fields.skipTLSL, 30);
I.click(remoteInstancesPage.fields.skipTLSL);
I.click(current.trackingOption);
I.click(remoteInstancesPage.fields.addService);
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 +334,7 @@ Scenario(
I.click(remoteInstancesPage.fields.addService);
I.verifyPopUpMessage(errorMessage);
I.fillField(remoteInstancesPage.fields.database, 'not_default_db');
I.click(remoteInstancesPage.fields.addService);
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);
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);
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);
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);
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);
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);
remoteInstancesPage.clickAddInstanceAndWaitForSuccess();

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

0 comments on commit 76311c4

Please sign in to comment.