From e8d0ddc82056f3ee677a3891ec82766fa7c61e79 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Thu, 14 Nov 2024 14:37:08 +0200 Subject: [PATCH 01/13] PMM-7 disconnect fix --- docker-compose-disconnect.yml | 7 ++----- tests/configuration/verifyPMMServerDisconnect_test.js | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/docker-compose-disconnect.yml b/docker-compose-disconnect.yml index df820fe39..4e999131d 100644 --- a/docker-compose-disconnect.yml +++ b/docker-compose-disconnect.yml @@ -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 diff --git a/tests/configuration/verifyPMMServerDisconnect_test.js b/tests/configuration/verifyPMMServerDisconnect_test.js index 48dacbb64..fc48bbed1 100644 --- a/tests/configuration/verifyPMMServerDisconnect_test.js +++ b/tests/configuration/verifyPMMServerDisconnect_test.js @@ -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'); From 76311c44d8b79041ce0ca6823650d50c82de40c3 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Thu, 14 Nov 2024 15:26:03 +0200 Subject: [PATCH 02/13] PMM-7 tweak remote instances --- docker-compose.yml | 40 +++++++++---------- .../configuration/verifyPMMInventory_test.js | 8 ++-- .../dashboards/verifyGCRemoteInstance_test.js | 2 +- tests/pages/remoteInstancesPage.js | 25 +++++++++++- .../qa-integration/pmm_ps_integration_test.js | 2 +- .../pmm_psmdb_integration_test.js | 2 +- .../pmm_pxc_integration_test.js | 2 +- .../remoteInstances/remoteInstancesHelper.js | 8 ++-- ...AzureMySQLPostgreSQLRemoteInstance_test.js | 2 +- tests/verifyRemoteInstances_test.js | 12 +++--- tests/verifyTLSMongoDBRemoteInstance_test.js | 4 +- tests/verifyTLSMySQLRemoteInstance_test.js | 4 +- tests/verifyTLSPostgresRemoteInstance_test.js | 4 +- 13 files changed, 66 insertions(+), 49 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0566a7b6d..ef8bd7e2a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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} @@ -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 \ diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index c96e5814d..38658daf5 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -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`, @@ -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`, @@ -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`, diff --git a/tests/dashboards/verifyGCRemoteInstance_test.js b/tests/dashboards/verifyGCRemoteInstance_test.js index 95bedf4a9..ac7eda8ea 100644 --- a/tests/dashboards/verifyGCRemoteInstance_test.js +++ b/tests/dashboards/verifyGCRemoteInstance_test.js @@ -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 diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 256496c69..c9fca29fb 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -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) { @@ -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); diff --git a/tests/qa-integration/pmm_ps_integration_test.js b/tests/qa-integration/pmm_ps_integration_test.js index a8395c077..babe99fba 100644 --- a/tests/qa-integration/pmm_ps_integration_test.js +++ b/tests/qa-integration/pmm_ps_integration_test.js @@ -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( diff --git a/tests/qa-integration/pmm_psmdb_integration_test.js b/tests/qa-integration/pmm_psmdb_integration_test.js index cd9ff59c0..132a65f2b 100644 --- a/tests/qa-integration/pmm_psmdb_integration_test.js +++ b/tests/qa-integration/pmm_psmdb_integration_test.js @@ -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( { diff --git a/tests/qa-integration/pmm_pxc_integration_test.js b/tests/qa-integration/pmm_pxc_integration_test.js index 57b970acb..cd2278c8e 100644 --- a/tests/qa-integration/pmm_pxc_integration_test.js +++ b/tests/qa-integration/pmm_pxc_integration_test.js @@ -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( { diff --git a/tests/remoteInstances/remoteInstancesHelper.js b/tests/remoteInstances/remoteInstancesHelper.js index 76f400d9c..f5a505892 100644 --- a/tests/remoteInstances/remoteInstancesHelper.js +++ b/tests/remoteInstances/remoteInstancesHelper.js @@ -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), @@ -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 @@ -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), @@ -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), diff --git a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js index 8cf4286a8..e89c11d4d 100644 --- a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js +++ b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js @@ -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') { diff --git a/tests/verifyRemoteInstances_test.js b/tests/verifyRemoteInstances_test.js index 5414a44b0..55a17fba7 100644 --- a/tests/verifyRemoteInstances_test.js +++ b/tests/verifyRemoteInstances_test.js @@ -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); @@ -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)); @@ -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); }, ); @@ -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 diff --git a/tests/verifyTLSMongoDBRemoteInstance_test.js b/tests/verifyTLSMongoDBRemoteInstance_test.js index 03976c62a..4da69c98f 100644 --- a/tests/verifyTLSMongoDBRemoteInstance_test.js +++ b/tests/verifyTLSMongoDBRemoteInstance_test.js @@ -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, @@ -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); diff --git a/tests/verifyTLSMySQLRemoteInstance_test.js b/tests/verifyTLSMySQLRemoteInstance_test.js index 1c732269c..768c5c464 100644 --- a/tests/verifyTLSMySQLRemoteInstance_test.js +++ b/tests/verifyTLSMySQLRemoteInstance_test.js @@ -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( @@ -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); diff --git a/tests/verifyTLSPostgresRemoteInstance_test.js b/tests/verifyTLSPostgresRemoteInstance_test.js index 7aa7a68fb..21e95b706 100644 --- a/tests/verifyTLSPostgresRemoteInstance_test.js +++ b/tests/verifyTLSPostgresRemoteInstance_test.js @@ -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, @@ -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); From 55d8d0ab1d6d41def3042ce957555f72abff214b Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Thu, 14 Nov 2024 15:49:04 +0200 Subject: [PATCH 03/13] PMM-7 tweak remote instances --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ef8bd7e2a..6d3e81559 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -150,7 +150,7 @@ services: image: perconalab/sysbench container_name: pmm-agent_sysbench depends_on: - - mysql + - mysql8 networks: - pmm-network command: > From 0d6c0b4be410fb7fe7832e2c0b88408ba97c8c77 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Thu, 14 Nov 2024 15:49:36 +0200 Subject: [PATCH 04/13] PMM-7 tweak remote instances --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6d3e81559..109a5e83e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -158,7 +158,7 @@ services: set -o xtrace sleep 20 mysql \ - --host=mysql \ + --host=mysql8 \ --port=3306 \ --user=root \ --password=^O6VrIoC1@9b \ @@ -182,7 +182,7 @@ services: --events=0 \ --rand-type=pareto \ --db-driver=mysql \ - --mysql-host=mysql \ + --mysql-host=mysql8 \ --mysql-port=3306 \ --mysql-user=root \ --mysql-password=^O6VrIoC1@9b \ From 1a8bb6cef62a026dba5014b712a232ccc36c72ab Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Thu, 14 Nov 2024 16:03:06 +0200 Subject: [PATCH 05/13] PMM-7 tweak remote instances --- docker-compose.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 109a5e83e..4779373cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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} From 4e19ed924de81286cf7190d5ee54bddf140079ec Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 10:15:53 +0200 Subject: [PATCH 06/13] PMM-7 fix rdsadmin test --- tests/verifyAWSRDSPostgreSQLInstance_test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/verifyAWSRDSPostgreSQLInstance_test.js b/tests/verifyAWSRDSPostgreSQLInstance_test.js index f19c5c02c..3067aa733 100644 --- a/tests/verifyAWSRDSPostgreSQLInstance_test.js +++ b/tests/verifyAWSRDSPostgreSQLInstance_test.js @@ -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'); @@ -79,7 +79,7 @@ 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 @@ -88,7 +88,7 @@ Scenario( // await pmmInventoryPage.verifyMetricsFlags(serviceName); const logs = await I.verifyCommand('docker exec pmm-server cat /srv/logs/pmm-agent.log | awk \'/ERRO/ && /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}`); }, ); From 16566d3e7eb6984896cf0fdcabaa98c500c2b75b Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 11:07:58 +0200 Subject: [PATCH 07/13] PMM-7 fix rdsadmin test --- tests/pages/remoteInstancesPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index c9fca29fb..7827c919c 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -529,7 +529,8 @@ module.exports = { clickAddInstanceAndWaitForSuccess() { I.waitForVisible(this.fields.addService, 30); - I.click(this.fields.addService); + I.wait(1); + I.click(this.fields.addService, { force: true }); I.waitForResponse( (response) => { From 9041232102e80667e0277e036811d6c6159073c1 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 11:36:11 +0200 Subject: [PATCH 08/13] PMM-7 fix rdsadmin test --- tests/pages/remoteInstancesPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 7827c919c..317effe12 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -530,7 +530,7 @@ module.exports = { clickAddInstanceAndWaitForSuccess() { I.waitForVisible(this.fields.addService, 30); I.wait(1); - I.click(this.fields.addService, { force: true }); + I.forceClick(this.fields.addService); I.waitForResponse( (response) => { From 3433d50f937afcaf90e5f06d9b3356f38de838d5 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 12:50:43 +0200 Subject: [PATCH 09/13] PMM-7 try fix for remote instances --- .../configuration/verifyPMMInventory_test.js | 6 +- .../dashboards/verifyGCRemoteInstance_test.js | 2 +- tests/pages/remoteInstancesPage.js | 60 +++++++++++++------ .../qa-integration/pmm_ps_integration_test.js | 2 +- .../pmm_psmdb_integration_test.js | 2 +- .../pmm_pxc_integration_test.js | 2 +- ...AzureMySQLPostgreSQLRemoteInstance_test.js | 2 +- tests/verifyRemoteInstances_test.js | 8 +-- tests/verifyTLSMongoDBRemoteInstance_test.js | 4 +- tests/verifyTLSMySQLRemoteInstance_test.js | 4 +- tests/verifyTLSPostgresRemoteInstance_test.js | 4 +- 11 files changed, 60 insertions(+), 36 deletions(-) diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index 38658daf5..1958fb70e 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -347,7 +347,7 @@ Scenario( remoteInstancesPage.openAddRemotePage('external'); const inputs = await remoteInstancesPage.fillRemoteFields(externalExporterServiceName); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); const newLabels = { environment: `${inputs.environment} edited` || `${externalExporterServiceName} environment edited`, @@ -410,7 +410,7 @@ Scenario( remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port, ); I.scrollPageToBottom(); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); const newLabels = { environment: `${remoteInstancesHelper.remote_instance.haproxy.environment} edited` || `${haproxyServiceName} environment edited`, @@ -474,7 +474,7 @@ Data(azureServices).Scenario( remoteInstancesPage.verifyAddInstancePageOpened(); const inputs = await remoteInstancesPage.fillRemoteRDSFields(serviceName); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); const newLabels = { environment: `${inputs.environment} edited` || `${serviceName} environment edited`, diff --git a/tests/dashboards/verifyGCRemoteInstance_test.js b/tests/dashboards/verifyGCRemoteInstance_test.js index ac7eda8ea..d8a628dd4 100644 --- a/tests/dashboards/verifyGCRemoteInstance_test.js +++ b/tests/dashboards/verifyGCRemoteInstance_test.js @@ -69,7 +69,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(instanceType); await remoteInstancesPage.addRemoteDetails(instanceDetails); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(instanceDetails.serviceName); await pmmInventoryPage.verifyAgentHasStatusRunning(instanceDetails.serviceName); // Waiting for metrics to start hitting PMM-Server diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 317effe12..19099f397 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -527,26 +527,50 @@ module.exports = { return pmmInventoryPage; }, - clickAddInstanceAndWaitForSuccess() { + async clickAddInstanceAndWaitForSuccess() { I.waitForVisible(this.fields.addService, 30); I.wait(1); - I.forceClick(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, - ); + + await I.usePlaywrightTo('click Add service and wait for response', async ({ page }) => { + const [response] = 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), + ]); + }); + + // eslint-disable-next-line no-undef + // await retryTo((tryNum) => { + // 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; + // }, + // 5, + // ); + // }, 5); }, openAddAzure() { diff --git a/tests/qa-integration/pmm_ps_integration_test.js b/tests/qa-integration/pmm_ps_integration_test.js index babe99fba..9646f3a35 100644 --- a/tests/qa-integration/pmm_ps_integration_test.js +++ b/tests/qa-integration/pmm_ps_integration_test.js @@ -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); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30); I.wait(10); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( diff --git a/tests/qa-integration/pmm_psmdb_integration_test.js b/tests/qa-integration/pmm_psmdb_integration_test.js index 132a65f2b..40a4a30a9 100644 --- a/tests/qa-integration/pmm_psmdb_integration_test.js +++ b/tests/qa-integration/pmm_psmdb_integration_test.js @@ -48,7 +48,7 @@ Scenario( I.fillField(remoteInstancesPage.fields.environment, details.environment); I.fillField(remoteInstancesPage.fields.cluster, details.cluster); I.click(remoteInstancesPage.fields.useQANMongoDBProfiler); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { diff --git a/tests/qa-integration/pmm_pxc_integration_test.js b/tests/qa-integration/pmm_pxc_integration_test.js index cd2278c8e..9ad3932b1 100644 --- a/tests/qa-integration/pmm_pxc_integration_test.js +++ b/tests/qa-integration/pmm_pxc_integration_test.js @@ -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); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { diff --git a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js index e89c11d4d..5427332c4 100644 --- a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js +++ b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js @@ -43,7 +43,7 @@ Data(azureServices).Scenario( remoteInstancesPage.startMonitoringOfInstance(current.instanceToMonitor); remoteInstancesPage.verifyAddInstancePageOpened(); await remoteInstancesPage.fillRemoteRDSFields(serviceName); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); if (serviceName === 'azure-MySQL') { diff --git a/tests/verifyRemoteInstances_test.js b/tests/verifyRemoteInstances_test.js index 55a17fba7..ee73bdd45 100644 --- a/tests/verifyRemoteInstances_test.js +++ b/tests/verifyRemoteInstances_test.js @@ -75,7 +75,7 @@ Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage('external'); await remoteInstancesPage.fillRemoteFields(externalExporterServiceName); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); await I.click(pmmInventoryPage.fields.showServiceDetails(externalExporterServiceName)); await I.click(pmmInventoryPage.fields.agentsLinkNew); @@ -205,7 +205,7 @@ Scenario( remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port, ); I.scrollPageToBottom(); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); await I.click(pmmInventoryPage.fields.showServiceDetails(haproxyServiceName)); @@ -258,7 +258,7 @@ Data(remotePostgreSQL).Scenario( I.waitForVisible(remoteInstancesPage.fields.skipTLSL, 30); I.click(remoteInstancesPage.fields.skipTLSL); I.click(current.trackingOption); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(current.instanceName); await pmmInventoryPage.verifyAgentHasStatusRunning(current.instanceName); await pmmInventoryPage.checkExistingAgent(current.checkAgent); @@ -334,7 +334,7 @@ Scenario( I.click(remoteInstancesPage.fields.addService); I.verifyPopUpMessage(errorMessage); I.fillField(remoteInstancesPage.fields.database, 'not_default_db'); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName); await pmmInventoryPage.verifyAgentHasStatusRunning(remoteServiceName); // verify metric for client container node instance diff --git a/tests/verifyTLSMongoDBRemoteInstance_test.js b/tests/verifyTLSMongoDBRemoteInstance_test.js index 4da69c98f..f12e5fc08 100644 --- a/tests/verifyTLSMongoDBRemoteInstance_test.js +++ b/tests/verifyTLSMongoDBRemoteInstance_test.js @@ -53,7 +53,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { serviceType: SERVICE_TYPE.MONGODB, @@ -221,7 +221,7 @@ Data(instances).Scenario( remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Check Remote Instance also added and have running status pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName); diff --git a/tests/verifyTLSMySQLRemoteInstance_test.js b/tests/verifyTLSMySQLRemoteInstance_test.js index 768c5c464..c8000eafc 100644 --- a/tests/verifyTLSMySQLRemoteInstance_test.js +++ b/tests/verifyTLSMySQLRemoteInstance_test.js @@ -69,7 +69,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Add wait for service status to be updated I.wait(10); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( @@ -244,7 +244,7 @@ Data(maxQueryLengthInstances).Scenario( remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Check Remote Instance also added and have running status pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName); diff --git a/tests/verifyTLSPostgresRemoteInstance_test.js b/tests/verifyTLSPostgresRemoteInstance_test.js index 21e95b706..ae4ed25a9 100644 --- a/tests/verifyTLSPostgresRemoteInstance_test.js +++ b/tests/verifyTLSPostgresRemoteInstance_test.js @@ -48,7 +48,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { serviceType: SERVICE_TYPE.POSTGRESQL, @@ -225,7 +225,7 @@ Data(instances).Scenario( remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength); - remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); + await remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Check Remote Instance also added and have running status pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName); From e260301e5922fbb2526381ce039d71354214e0f7 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 14:42:57 +0200 Subject: [PATCH 10/13] PMM-7 try fix for remote instances --- tests/pages/remoteInstancesPage.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 19099f397..e1946b502 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -529,10 +529,9 @@ module.exports = { async clickAddInstanceAndWaitForSuccess() { I.waitForVisible(this.fields.addService, 30); - I.wait(1); await I.usePlaywrightTo('click Add service and wait for response', async ({ page }) => { - const [response] = await Promise.all([ + await Promise.all([ page.waitForResponse( async (response) => { if (response.url().includes('v1/management/services')) { @@ -550,27 +549,6 @@ module.exports = { page.click(this.fields.addService), ]); }); - - // eslint-disable-next-line no-undef - // await retryTo((tryNum) => { - // 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; - // }, - // 5, - // ); - // }, 5); }, openAddAzure() { From 0c295ed96c46df1527e23115c033e30bf15c0a2f Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 15:29:51 +0200 Subject: [PATCH 11/13] PMM-7 try fix rdsadmin test for remote instances --- tests/verifyAWSRDSPostgreSQLInstance_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/verifyAWSRDSPostgreSQLInstance_test.js b/tests/verifyAWSRDSPostgreSQLInstance_test.js index 3067aa733..942935158 100644 --- a/tests/verifyAWSRDSPostgreSQLInstance_test.js +++ b/tests/verifyAWSRDSPostgreSQLInstance_test.js @@ -86,7 +86,7 @@ Scenario( // 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}`); }, From 99819028f34911c4fb0ca2f12ebb1d20f8d622a0 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 16:39:25 +0200 Subject: [PATCH 12/13] PMM-7 alerting tweak --- tests/ia/alerts_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ia/alerts_test.js b/tests/ia/alerts_test.js index 55a6434d8..99afa8fb6 100644 --- a/tests/ia/alerts_test.js +++ b/tests/ia/alerts_test.js @@ -119,7 +119,7 @@ Scenario( await rulesAPI.removeAllAlertRules(); I.amOnPage(alertsPage.url); - I.seeElement(alertsPage.elements.noAlerts); + I.waitForElement(alertsPage.elements.noAlerts, 20); }, ); From 2b3c389fa4cff05cf631a5def9de7f4c37f87220 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Fri, 15 Nov 2024 17:50:48 +0200 Subject: [PATCH 13/13] PMM-7 start docker compose before remote instances tests --- tests/verifyRemoteInstances_test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/verifyRemoteInstances_test.js b/tests/verifyRemoteInstances_test.js index ee73bdd45..3fe6b325f 100644 --- a/tests/verifyRemoteInstances_test.js +++ b/tests/verifyRemoteInstances_test.js @@ -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(); });