Skip to content

Commit

Permalink
PMM-13607: Add status check to pmm 3 nightly job (#3074)
Browse files Browse the repository at this point in the history
* PMM-7: Test https with docker

* PMM-7: Change default pgsql and pdpgsql versions

* PMM-7: Change default pgsql and pdpgsql versions

* PMM-7: Change default pgsql and pdpgsql versions

* PMM-13607: Status check for agents

* PMM-13607: Status check for agents

* PMM-13607: Status check for agents

* PMM-13607: Status check for agents

* PMM-13607: Status check for agents

* PMM-13607: Status check for agents

* PMM-13607: Fixed redundant code
  • Loading branch information
peterSirotnak authored Dec 19, 2024
1 parent bad018e commit 357e8da
Showing 1 changed file with 53 additions and 15 deletions.
68 changes: 53 additions & 15 deletions pmm/v3/pmm3-ui-tests-nightly.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}/"
}
}
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
'''
}
}
Expand Down Expand Up @@ -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'
"""
}
}
}
}
Expand Down

0 comments on commit 357e8da

Please sign in to comment.