mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
Jenkins split SITL tests into separate pipeline (#10144)
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
#!/usr/bin/env groovy
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
stages {
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
script {
|
||||
stage('sitl package') {
|
||||
node {
|
||||
docker.image("px4io/px4-dev-ros:2018-07-19").inside('-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE') {
|
||||
stage("sitl package") {
|
||||
try {
|
||||
checkout(scm)
|
||||
sh('export')
|
||||
sh('make distclean')
|
||||
sh "ccache -z"
|
||||
sh('make posix_sitl_default')
|
||||
sh "ccache -s"
|
||||
sh('make posix_sitl_default sitl_gazebo')
|
||||
sh "ccache -s"
|
||||
sh('make posix_sitl_default package')
|
||||
stash(name: "px4_sitl_package", includes: "build/posix_sitl_default/*.bz2")
|
||||
}
|
||||
catch (exc) {
|
||||
throw (exc)
|
||||
}
|
||||
finally {
|
||||
sh('make distclean')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // script
|
||||
} // steps
|
||||
} // Build
|
||||
|
||||
stage('ROS Tests') {
|
||||
steps {
|
||||
script {
|
||||
def missions = [
|
||||
[
|
||||
name: "VTOL standard",
|
||||
test: "mavros_posix_test_mission.test",
|
||||
mission: "vtol_new_1",
|
||||
vehicle: "standard_vtol"
|
||||
],
|
||||
[
|
||||
name: "VTOL tailsitter",
|
||||
test: "mavros_posix_test_mission.test",
|
||||
mission: "vtol_new_1",
|
||||
vehicle: "tailsitter"
|
||||
],
|
||||
[
|
||||
name: "VTOL tiltrotor",
|
||||
test: "mavros_posix_test_mission.test",
|
||||
mission: "vtol_new_1",
|
||||
vehicle: "tiltrotor"
|
||||
],
|
||||
[
|
||||
name: "MC box",
|
||||
test: "mavros_posix_test_mission.test",
|
||||
mission: "multirotor_box",
|
||||
vehicle: "iris"
|
||||
],
|
||||
[
|
||||
name: "MC offboard att",
|
||||
test: "mavros_posix_tests_offboard_attctl.test",
|
||||
mission: "",
|
||||
vehicle: "iris"
|
||||
],
|
||||
[
|
||||
name: "MC offboard pos",
|
||||
test: "mavros_posix_tests_offboard_posctl.test",
|
||||
mission: "",
|
||||
vehicle: "iris"
|
||||
]
|
||||
]
|
||||
|
||||
def test_nodes = [:]
|
||||
for (def i = 0; i < missions.size(); i++) {
|
||||
test_nodes.put(missions[i].name, createTestNode(missions[i]))
|
||||
}
|
||||
|
||||
parallel test_nodes
|
||||
} // script
|
||||
} // steps
|
||||
} // ROS Tests
|
||||
|
||||
} //stages
|
||||
environment {
|
||||
CCACHE_DIR = '/tmp/ccache'
|
||||
CI = true
|
||||
}
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
|
||||
timeout(time: 60, unit: 'MINUTES')
|
||||
}
|
||||
} // pipeline
|
||||
|
||||
def createTestNode(Map test_def) {
|
||||
return {
|
||||
node {
|
||||
cleanWs()
|
||||
docker.image("px4io/px4-dev-ros:2018-03-30").inside('-e HOME=${WORKSPACE}') {
|
||||
stage(test_def.name) {
|
||||
try {
|
||||
sh('export')
|
||||
unstash('px4_sitl_package')
|
||||
sh('tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2')
|
||||
sh('px4-posix_sitl_default*/px4/test/rostest_px4_run.sh ' + test_def.test + ' mission:=' + test_def.mission + ' vehicle:=' + test_def.vehicle)
|
||||
sh('px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py .ros/rootfs/fs/microsd/log/*/*.ulg')
|
||||
}
|
||||
catch (exc) {
|
||||
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.ulg, .ros/**/rosunit-*.xml, .ros/**/rostest-*.log')
|
||||
throw (exc)
|
||||
}
|
||||
finally {
|
||||
sh('px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg')
|
||||
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.pdf, .ros/**/*.csv')
|
||||
}
|
||||
}
|
||||
}
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
-269
@@ -324,210 +324,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS vtol standard mission') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_1 vehicle:=standard_vtol'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS vtol tailsitter mission') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_1 vehicle:=tailsitter'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS vtol tiltrotor mission') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_1 vehicle:=tiltrotor'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS vtol mission new 2') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_new_2 vehicle:=standard_vtol'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS vtol mission old 1') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_old_1 vehicle:=standard_vtol'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS vtol mission old 2') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=vtol_old_2 vehicle:=standard_vtol'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS MC mission box (EKF2)') {
|
||||
agent {
|
||||
docker {
|
||||
@@ -593,71 +389,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS offboard att') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_tests_offboard_attctl.test'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ROS offboard pos') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros:2018-07-19'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'export'
|
||||
sh 'rm -rf build; rm -rf px4-posix_sitl_default*; rm -rf .ros; rm -rf .gazebo'
|
||||
unstash 'px4_sitl_package'
|
||||
sh 'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
|
||||
sh 'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh mavros_posix_tests_offboard_posctl.test'
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py `find . -name *.ulg -print -quit`'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'px4-posix_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/rootfs/fs/microsd/log/*/*.ulg'
|
||||
archiveArtifacts '.ros/**/*.pdf'
|
||||
archiveArtifacts '.ros/**/*.csv'
|
||||
deleteDir()
|
||||
}
|
||||
failure {
|
||||
sh 'ls -a'
|
||||
archiveArtifacts '.ros/**/*.ulg'
|
||||
archiveArtifacts '.ros/**/rosunit-*.xml'
|
||||
archiveArtifacts '.ros/**/rostest-*.log'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user