Skip to content

Commit

Permalink
improve test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ricolin committed Mar 22, 2024
1 parent e07bdf0 commit bd9c175
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pipeline {
axis {
name 'SCENARIO'
values 'ha'
// TODO reduce resources per case so we can run them all
//values 'ha', 'aio'
// TODO reduce resources per case so we can run them all
}
axis {
name 'VERSION'
Expand All @@ -25,7 +25,7 @@ pipeline {
}
axis {
name 'TESTCASE'
values 'general', 'adopt', 'upgrade'
values 'general', 'adopt'
}
}

Expand All @@ -44,6 +44,7 @@ pipeline {
}

stages {
// Install, verify
stage('ubuntu2204') {
when { expression { env.DISTRO == "ubuntu2204" && env.VERSION == env.LAST_VERSION && env.TESTCASE == 'general' } }
steps {
Expand All @@ -64,8 +65,20 @@ pipeline {
sh "sudo molecule test -s ${SCENARIO}"
}
}
// upgrade and verify
stage('upgrade') {
when { expression { env.DISTRO == "ubuntu2004" && env.VERSION != env.LAST_VERSION && env.SCENARIO == "ha" && env.TESTCASE == 'general' } }
steps {
sh "MOLECULE_CEPH_VERSION=${LAST_VERSION} && sudo molecule converge -s ${SCENARIO}"
sh "MOLECULE_CEPH_VERSION=${LAST_VERSION} && sudo molecule verify -s ${SCENARIO}"
}
}
// adopt from legacy environment to cephadm env.
stage('adopt') {
when { expression { env.DISTRO == "ubuntu2004" && env.VERSION != env.LAST_VERSION && env.SCENARIO == "ha" && env.TESTCASE == 'adopt' } }
agent {
label 'jammy-16c-32g'
}
steps {
catchError(buildResult: "${BUILD_RESULT_ON_FAILURE}", stageResult: "${STAGE_RESULT_ON_FAILURE}") {
sh "git checkout -B ${GIT_BRANCH}"
Expand All @@ -83,20 +96,6 @@ pipeline {

}
}
stage('upgrade') {
when { expression { env.DISTRO == "ubuntu2004" && env.VERSION == '16.2.14' && env.SCENARIO == "ha" && env.TESTCASE == 'upgrade' } }
steps {

sh 'sudo apt-get purge -y snapd'
sh 'sudo apt-get install -y git python3-pip docker.io'
sh 'sudo pip install -r requirements.txt'
sh "sudo molecule converge -s ${SCENARIO}"
sh "sudo molecule verify -s ${SCENARIO}"
sh "MOLECULE_CEPH_VERSION=${LAST_VERSION} && sudo molecule converge -s ${SCENARIO}"
sh "MOLECULE_CEPH_VERSION=${LAST_VERSION} && sudo molecule verify -s ${SCENARIO}"
}
}

}
}
}
Expand Down

0 comments on commit bd9c175

Please sign in to comment.