diff --git a/pmm/v3/pmm3-ui-tests-nightly.groovy b/pmm/v3/pmm3-ui-tests-nightly.groovy index e8dfaae114..7c1dc80987 100644 --- a/pmm/v3/pmm3-ui-tests-nightly.groovy +++ b/pmm/v3/pmm3-ui-tests-nightly.groovy @@ -20,12 +20,12 @@ void runStagingServer(String DOCKER_VERSION, CLIENT_VERSION, CLIENTS, CLIENT_INS env.VM_NAME = stagingJob.buildVariables.VM_NAME def clientInstance = "yes"; if ( CLIENT_INSTANCE == clientInstance ) { - env.PMM_URL = "http://admin:${ADMIN_PASSWORD}@${SERVER_IP}" + env.PMM_URL = "https://admin:${ADMIN_PASSWORD}@${SERVER_IP}" env.PMM_UI_URL = "http://${SERVER_IP}/" } else { - env.PMM_URL = "http://admin:${ADMIN_PASSWORD}@${VM_IP}" + env.PMM_URL = "https://admin:${ADMIN_PASSWORD}@${VM_IP}" env.PMM_UI_URL = "http://${VM_IP}/" } } @@ -107,6 +107,24 @@ void destroyStaging(IP) { string(name: 'VM', value: IP), ] } + +void checkClientNodesAgentStatus(String VM_CLIENT_IP, PMM_QA_GIT_BRANCH) { + withCredentials([sshUserPrivateKey(credentialsId: 'aws-jenkins', keyFileVariable: 'KEY_PATH', passphraseVariable: '', usernameVariable: 'USER')]) { + sh """ + ssh -i "${KEY_PATH}" -o ConnectTimeout=1 -o StrictHostKeyChecking=no ${USER}@${VM_CLIENT_IP} ' + set -o errexit + set -o xtrace + echo "Checking Agent Status on Client Nodes"; + sudo mkdir -p /srv/pmm-qa || : + sudo git clone --single-branch --branch $PMM_QA_GIT_BRANCH https://github.com/percona/pmm-qa.git /srv/pmm-qa + sudo chmod -R 755 /srv/pmm-qa + sudo chmod 755 /srv/pmm-qa/pmm-tests/agent_status.sh + bash -xe /srv/pmm-qa/pmm-tests/agent_status.sh + ' + """ + } +} + pipeline { agent { label 'min-focal-x64' @@ -198,11 +216,11 @@ pipeline { description: 'MySQL Community Server version', name: 'MS_VERSION') choice( - choices: ['16', '17', '15', '14', '13'], + choices: ['17', '16', '15', '14', '13'], description: "Which version of PostgreSQL", name: 'PGSQL_VERSION') choice( - choices: ['16', '17', '15', '14', '13'], + choices: ['17', '16', '15','14', '13'], description: 'Percona Distribution for PostgreSQL', name: 'PDPGSQL_VERSION') choice( @@ -234,6 +252,7 @@ pipeline { sudo mkdir -p /srv/qa-integration || : sudo git clone --single-branch --branch \${PMM_QA_GIT_BRANCH} https://github.com/Percona-Lab/qa-integration.git /srv/qa-integration sudo chmod -R 755 /srv/qa-integration + ''' } } @@ -322,22 +341,41 @@ pipeline { sleep 300 } } - stage('Run Tests') { + stage('Check agent status') { parallel { - stage('Run UI - Tests') { - options { - timeout(time: 150, unit: "MINUTES") + stage('Check Agent Status on ps single and mongo pss') { + steps { + checkClientNodesAgentStatus(env.VM_CLIENT_IP_MYSQL, env.PMM_QA_GIT_BRANCH) + } + } + stage('Check Agent Status on ps & replication node') { + steps { + checkClientNodesAgentStatus(env.VM_CLIENT_IP_PS_GR, env.PMM_QA_GIT_BRANCH) } + } + stage('Check Agent Status on ms/md/pxc node') { steps { - withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'PMM_AWS_DEV', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { - sh """ - sed -i 's+http://localhost/+${PMM_UI_URL}/+g' pr.codecept.js - export PWD=\$(pwd); - npx codeceptjs run --reporter mocha-multi -c pr.codecept.js --grep '@qan|@nightly|@menu' - """ - } + checkClientNodesAgentStatus(env.VM_CLIENT_IP_PXC, env.PMM_QA_GIT_BRANCH) } } + stage('Check Agent Status on postgresql node') { + steps { + checkClientNodesAgentStatus(env.VM_CLIENT_IP_PGSQL, env.PMM_QA_GIT_BRANCH) + } + } + } + } + stage('Run UI Tests') { + options { + timeout(time: 150, unit: "MINUTES") + } + steps { + withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'PMM_AWS_DEV', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { + sh """ + sed -i 's+http://localhost/+${PMM_UI_URL}/+g' pr.codecept.js + npx codeceptjs run --reporter mocha-multi -c pr.codecept.js --grep '@qan|@nightly|@menu' + """ + } } } }