Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
63cc3280
Commit
63cc3280
authored
6 years ago
by
Anthony Lamping
Committed by
Daniel Agar
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
jenkins: archive ekf log processing output on failure
parent
27b2dad1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.ci/Jenkinsfile-SITL_tests
+49
-36
49 additions, 36 deletions
.ci/Jenkinsfile-SITL_tests
with
49 additions
and
36 deletions
.ci/Jenkinsfile-SITL_tests
+
49
−
36
View file @
63cc3280
...
...
@@ -77,7 +77,7 @@ pipeline {
}
}
}
}
// stage Build
stage
(
'ROS Tests'
)
{
steps
{
...
...
@@ -138,7 +138,7 @@ pipeline {
parallel
test_nodes
}
// script
}
// steps
}
// ROS Tests
}
//
stage
ROS Tests
stage
(
'Coverage'
)
{
parallel
{
...
...
@@ -191,6 +191,7 @@ pipeline {
}
// stage Coverage
}
//stages
environment
{
ASAN_OPTIONS
=
'detect_stack_use_after_return=1:check_initialization_order=1'
UBSAN_OPTIONS
=
'print_stacktrace=1'
...
...
@@ -198,6 +199,7 @@ pipeline {
CI
=
true
CTEST_OUTPUT_ON_FAILURE
=
1
}
options
{
buildDiscarder
(
logRotator
(
numToKeepStr:
'10'
,
artifactDaysToKeepStr:
'30'
))
timeout
(
time:
60
,
unit:
'MINUTES'
)
...
...
@@ -210,56 +212,67 @@ def createTestNode(Map test_def) {
cleanWs
()
docker
.
image
(
"px4io/px4-dev-ros-kinetic:2018-09-11"
).
inside
(
'-e HOME=${WORKSPACE} --cap-add SYS_PTRACE'
)
{
stage
(
test_def
.
name
)
{
def
test_ok
=
true
sh
(
'export'
)
try
{
sh
(
'export'
)
if
(
env
.
PX4_CMAKE_BUILD_TYPE
==
'Coverage'
)
{
checkout
(
scm
)
unstash
'build_sitl_coverage'
}
if
(
env
.
PX4_CMAKE_BUILD_TYPE
==
'Coverage'
)
{
checkout
(
scm
)
unstash
'build_sitl_coverage'
}
unstash
(
'px4_sitl_package'
)
sh
(
'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
)
unstash
(
'px4_sitl_package'
)
sh
(
'tar -xjpvf build/posix_sitl_default/px4-posix_sitl_default*.bz2'
)
// run test
try
{
sh
(
'px4-posix_sitl_default*/px4/test/rostest_px4_run.sh '
+
test_def
.
test
+
' mission:='
+
test_def
.
mission
+
' vehicle:='
+
test_def
.
vehicle
)
}
catch
(
exc
)
{
// save all test artifacts for debugging
archiveArtifacts
(
allowEmptyArchive:
false
,
artifacts:
'.ros/**/*.ulg, .ros/**/rosunit-*.xml, .ros/**/rostest-*.log'
)
throw
(
exc
)
}
finally
{
if
(
env
.
PX4_CMAKE_BUILD_TYPE
==
'Coverage'
)
{
withCredentials
([
string
(
credentialsId:
'FIRMWARE_CODECOV_TOKEN'
,
variable:
'CODECOV_TOKEN'
)])
{
sh
'curl -s https://codecov.io/bash | bash -s - -F sitl_mission_${STAGE_NAME}'
test_ok
=
false
}
// upload log to flight review (https://logs.px4.io/) with python code coverage
sh
(
'coverage run -p 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/log/*/*.ulg'
)
// log analysis
if
(
env
.
PX4_CMAKE_BUILD_TYPE
==
'Coverage'
)
{
withCredentials
([
string
(
credentialsId:
'FIRMWARE_CODECOV_TOKEN'
,
variable:
'CODECOV_TOKEN'
)])
{
sh
'curl -s https://codecov.io/bash | bash -s - -F sitl_mission_${STAGE_NAME}'
// process log data (with python code coverage)
// process log data (with python code coverage)
try
{
sh
(
'coverage run -p px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py .ros/log/*/*.ulg'
)
// upload python code coverage to codecov.io
sh
'curl -s https://codecov.io/bash | bash -s - -X gcov -F sitl_python_${STAGE_NAME}'
}
catch
(
exc
)
{
// save log analysis artifacts for debugging
archiveArtifacts
(
allowEmptyArchive:
false
,
artifacts:
'.ros/**/*.pdf, .ros/**/*.csv'
)
test_ok
=
false
}
}
// log analysis (non code coverage)
if
(
env
.
PX4_CMAKE_BUILD_TYPE
!=
'Coverage'
)
{
// upload log to flight review (https://logs.px4.io/)
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/log/*/*.ulg'
)
// upload log to flight review (https://logs.px4.io/) with python code coverage
sh
(
'coverage run -p 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/log/*/*.ulg'
)
// upload python code coverage to codecov.io
sh
'curl -s https://codecov.io/bash | bash -s - -X gcov -F sitl_python_${STAGE_NAME}'
}
}
else
{
// non code coverage
// process ekf log data
try
{
sh
(
'px4-posix_sitl_default*/px4/Tools/ecl_ekf/process_logdata_ekf.py .ros/log/*/*.ulg'
)
}
catch
(
exc
)
{
// save log analysis artifacts for debugging
archiveArtifacts
(
allowEmptyArchive:
false
,
artifacts:
'.ros/**/*.pdf, .ros/**/*.csv'
)
test_ok
=
false
}
//
save test artifacts for debugging
archiveArtifacts
(
allowEmptyArchive:
false
,
artifacts:
'.ros/**/*.pdf, .ros/*
*/*.
csv
'
)
//
upload log to flight review (https://logs.px4.io/)
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/log/
*/*.
ulg
'
)
}
}
}
cleanWs
()
}
}
}
if
(!
test_ok
)
{
error
(
'ROS Test failed'
)
}
}
// stage
cleanWs
()
}
// docker.image
}
// node
}
// return
}
// createTestNode
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment