Skip to content

Commit f26e780

Browse files
authored
Merge pull request #1 from PX4/master
sync
2 parents 4d09643 + 39d1751 commit f26e780

File tree

2,833 files changed

+187159
-176756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,833 files changed

+187159
-176756
lines changed

.ci/Jenkinsfile-SITL_tests

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
#!/usr/bin/env groovy
2+
3+
pipeline {
4+
agent none
5+
6+
stages {
7+
8+
stage('Build') {
9+
agent {
10+
docker {
11+
image 'px4io/px4-dev-ros-kinetic:2019-03-08'
12+
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
13+
}
14+
}
15+
steps {
16+
sh 'export'
17+
sh 'make distclean'
18+
sh 'ccache -z'
19+
sh 'git fetch --tags'
20+
sh 'make px4_sitl_default'
21+
sh 'make px4_sitl_default sitl_gazebo'
22+
sh 'make px4_sitl_default package'
23+
sh 'ccache -s'
24+
stash(name: "px4_sitl_package", includes: "build/px4_sitl_default/*.bz2")
25+
archiveArtifacts(artifacts: "build/px4_sitl_default/*.bz2", fingerprint: true, onlyIfSuccessful: true)
26+
}
27+
post {
28+
always {
29+
sh 'make distclean'
30+
}
31+
}
32+
} // stage Build
33+
34+
stage('ROS Tests') {
35+
steps {
36+
script {
37+
def missions = [
38+
[
39+
name: "FW",
40+
test: "mavros_posix_test_mission.test",
41+
mission: "FW_mission_1",
42+
vehicle: "plane"
43+
],
44+
45+
[
46+
name: "MC_box",
47+
test: "mavros_posix_test_mission.test",
48+
mission: "MC_mission_box",
49+
vehicle: "iris"
50+
],
51+
[
52+
name: "MC_offboard_att",
53+
test: "mavros_posix_tests_offboard_attctl.test",
54+
mission: "",
55+
vehicle: "iris"
56+
],
57+
[
58+
name: "MC_offboard_pos",
59+
test: "mavros_posix_tests_offboard_posctl.test",
60+
mission: "",
61+
vehicle: "iris"
62+
],
63+
64+
[
65+
name: "VTOL_standard",
66+
test: "mavros_posix_test_mission.test",
67+
mission: "VTOL_mission_1",
68+
vehicle: "standard_vtol"
69+
],
70+
[
71+
name: "VTOL_tailsitter",
72+
test: "mavros_posix_test_mission.test",
73+
mission: "VTOL_mission_1",
74+
vehicle: "tailsitter"
75+
],
76+
[
77+
name: "VTOL_tiltrotor",
78+
test: "mavros_posix_test_mission.test",
79+
mission: "VTOL_mission_1",
80+
vehicle: "tiltrotor"
81+
],
82+
[
83+
name: "MC_avoidance",
84+
test: "mavros_posix_test_avoidance.test",
85+
mission: "avoidance",
86+
vehicle: "iris_obs_avoid",
87+
run_script: "rostest_avoidance_run.sh"
88+
],
89+
90+
]
91+
92+
def test_nodes = [:]
93+
for (def i = 0; i < missions.size(); i++) {
94+
test_nodes.put(missions[i].name, createTestNode(missions[i]))
95+
}
96+
97+
parallel test_nodes
98+
} // script
99+
} // steps
100+
} // stage ROS Tests
101+
102+
} //stages
103+
104+
environment {
105+
CCACHE_DIR = '/tmp/ccache'
106+
CI = true
107+
}
108+
109+
options {
110+
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
111+
timeout(time: 60, unit: 'MINUTES')
112+
}
113+
} // pipeline
114+
115+
def createTestNode(Map test_def) {
116+
return {
117+
node {
118+
cleanWs()
119+
docker.image("px4io/px4-dev-ros-kinetic:2019-03-08").inside('-e HOME=${WORKSPACE}') {
120+
stage(test_def.name) {
121+
def run_script = test_def.get('run_script', 'rostest_px4_run.sh')
122+
def test_ok = true
123+
sh('export')
124+
125+
unstash('px4_sitl_package')
126+
sh('tar -xjpvf build/px4_sitl_default/px4-px4_sitl_default*.bz2')
127+
128+
// run test
129+
try {
130+
sh('px4-px4_sitl_default*/px4/test/' + run_script + ' ' + test_def.test + ' mission:=' + test_def.mission + ' vehicle:=' + test_def.vehicle)
131+
132+
} catch (exc) {
133+
// save all test artifacts for debugging
134+
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.ulg, .ros/**/rosunit-*.xml, .ros/**/rostest-*.log')
135+
test_ok = false
136+
}
137+
138+
// log analysis
139+
// process ekf log data
140+
try {
141+
sh('px4-px4_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py .ros/log/*/*.ulg')
142+
} catch (exc) {
143+
// save log analysis artifacts for debugging
144+
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.pdf, .ros/**/*.csv')
145+
// FIXME: don't let the script to fail the build
146+
// test_ok = false
147+
}
148+
149+
// upload log to flight review (https://logs.px4.io/)
150+
sh('px4-px4_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/log/*/*.ulg')
151+
152+
if (!test_ok) {
153+
error('ROS Test failed')
154+
}
155+
} // stage
156+
cleanWs()
157+
} // docker.image
158+
} // node
159+
} // return
160+
} // createTestNode

.ci/Jenkinsfile-SITL_tests_ASan

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
#!/usr/bin/env groovy
2+
3+
pipeline {
4+
agent none
5+
6+
stages {
7+
8+
stage('Build') {
9+
agent {
10+
docker {
11+
image 'px4io/px4-dev-ros-kinetic:2019-03-08'
12+
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
13+
}
14+
}
15+
steps {
16+
sh 'export'
17+
sh 'make distclean'
18+
sh 'ccache -z'
19+
sh 'git fetch --tags'
20+
sh 'make px4_sitl_default'
21+
sh 'make px4_sitl_default sitl_gazebo'
22+
sh 'make px4_sitl_default package'
23+
sh 'ccache -s'
24+
stash(name: "px4_sitl_package", includes: "build/px4_sitl_default/*.bz2")
25+
//archiveArtifacts(artifacts: "build/px4_sitl_default/*.bz2", fingerprint: true, onlyIfSuccessful: true)
26+
}
27+
post {
28+
always {
29+
sh 'make distclean'
30+
}
31+
}
32+
} // stage Build
33+
34+
stage('ROS Tests') {
35+
steps {
36+
script {
37+
def missions = [
38+
[
39+
name: "FW",
40+
test: "mavros_posix_test_mission.test",
41+
mission: "FW_mission_1",
42+
vehicle: "plane"
43+
],
44+
45+
[
46+
name: "MC_box",
47+
test: "mavros_posix_test_mission.test",
48+
mission: "MC_mission_box",
49+
vehicle: "iris"
50+
],
51+
[
52+
name: "MC_offboard_att",
53+
test: "mavros_posix_tests_offboard_attctl.test",
54+
mission: "",
55+
vehicle: "iris"
56+
],
57+
[
58+
name: "MC_offboard_pos",
59+
test: "mavros_posix_tests_offboard_posctl.test",
60+
mission: "",
61+
vehicle: "iris"
62+
],
63+
64+
[
65+
name: "VTOL_standard",
66+
test: "mavros_posix_test_mission.test",
67+
mission: "VTOL_mission_1",
68+
vehicle: "standard_vtol"
69+
],
70+
[
71+
name: "VTOL_tailsitter",
72+
test: "mavros_posix_test_mission.test",
73+
mission: "VTOL_mission_1",
74+
vehicle: "tailsitter"
75+
],
76+
[
77+
name: "VTOL_tiltrotor",
78+
test: "mavros_posix_test_mission.test",
79+
mission: "VTOL_mission_1",
80+
vehicle: "tiltrotor"
81+
],
82+
83+
]
84+
85+
def test_nodes = [:]
86+
for (def i = 0; i < missions.size(); i++) {
87+
test_nodes.put(missions[i].name, createTestNode(missions[i]))
88+
}
89+
90+
parallel test_nodes
91+
} // script
92+
} // steps
93+
} // stage ROS Tests
94+
95+
} //stages
96+
97+
environment {
98+
CCACHE_DIR = '/tmp/ccache'
99+
CI = true
100+
PX4_CMAKE_BUILD_TYPE = 'AddressSanitizer'
101+
}
102+
103+
options {
104+
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
105+
timeout(time: 60, unit: 'MINUTES')
106+
}
107+
} // pipeline
108+
109+
def createTestNode(Map test_def) {
110+
return {
111+
node {
112+
cleanWs()
113+
docker.image("px4io/px4-dev-ros-kinetic:2019-03-08").inside('-e HOME=${WORKSPACE}') {
114+
stage(test_def.name) {
115+
def test_ok = true
116+
sh('export')
117+
118+
unstash('px4_sitl_package')
119+
sh('tar -xjpvf build/px4_sitl_default/px4-px4_sitl_default*.bz2')
120+
121+
// run test
122+
try {
123+
sh('px4-px4_sitl_default*/px4/test/rostest_px4_run.sh ' + test_def.test + ' mission:=' + test_def.mission + ' vehicle:=' + test_def.vehicle)
124+
125+
} catch (exc) {
126+
// save all test artifacts for debugging
127+
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.ulg, .ros/**/rosunit-*.xml, .ros/**/rostest-*.log')
128+
test_ok = false
129+
}
130+
131+
// log analysis
132+
// process ekf log data
133+
try {
134+
sh('px4-px4_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py .ros/log/*/*.ulg')
135+
} catch (exc) {
136+
// save log analysis artifacts for debugging
137+
archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.pdf, .ros/**/*.csv')
138+
// FIXME: don't let the script to fail the build
139+
// test_ok = false
140+
}
141+
142+
// upload log to flight review (https://logs.px4.io/)
143+
sh('px4-px4_sitl_default*/px4/Tools/upload_log.py -q --description "${JOB_NAME}: ${STAGE_NAME}" --feedback "${JOB_NAME} ${CHANGE_TITLE} ${CHANGE_URL}" --source CI .ros/log/*/*.ulg')
144+
145+
if (!test_ok) {
146+
error('ROS Test failed')
147+
}
148+
} // stage
149+
cleanWs()
150+
} // docker.image
151+
} // node
152+
} // return
153+
} // createTestNode

0 commit comments

Comments
 (0)