mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
mavsdk SITL testing code coverage and upload to codecov.io
This commit is contained in:
23
.github/workflows/sitl_tests_coverage.yml
vendored
Normal file
23
.github/workflows/sitl_tests_coverage.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: SITL Tests (Code Coverage)
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: px4io/px4-dev-simulation-bionic:2019-12-18
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
|
- name: Set Python 3 as default
|
||||||
|
run: update-alternatives --install /usr/bin/python python /usr/bin/python3 10
|
||||||
|
- name: Install psutil
|
||||||
|
run: pip3 install psutil
|
||||||
|
- name: Run simulation tests
|
||||||
|
run: make tests_integration_coverage
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
flags: mavsdk
|
||||||
10
Makefile
10
Makefile
@@ -357,10 +357,16 @@ tests_coverage:
|
|||||||
rostest: px4_sitl_default
|
rostest: px4_sitl_default
|
||||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo
|
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo
|
||||||
|
|
||||||
tests_integration: px4_sitl gazebo mavsdk_tests
|
tests_integration: px4_sitl_default
|
||||||
# Missing step: Gazebo model generation
|
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo
|
||||||
@"$(SRC_DIR)"/test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 100
|
@"$(SRC_DIR)"/test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 100
|
||||||
|
|
||||||
|
tests_integration_coverage:
|
||||||
|
@$(MAKE) clean
|
||||||
|
@$(MAKE) --no-print-directory px4_sitl_default PX4_CMAKE_BUILD_TYPE=Coverage
|
||||||
|
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo PX4_CMAKE_BUILD_TYPE=Coverage
|
||||||
|
@"$(SRC_DIR)"/test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --iterations 1 --fail-early
|
||||||
|
|
||||||
tests_mission: rostest
|
tests_mission: rostest
|
||||||
@"$(SRC_DIR)"/test/rostest_px4_run.sh mavros_posix_tests_missions.test
|
@"$(SRC_DIR)"/test/rostest_px4_run.sh mavros_posix_tests_missions.test
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ matplotlib
|
|||||||
nose
|
nose
|
||||||
numpy>=1.13
|
numpy>=1.13
|
||||||
pandas>=0.21
|
pandas>=0.21
|
||||||
|
psutil
|
||||||
pyserial>=3.0
|
pyserial>=3.0
|
||||||
pyulog>=0.5.0
|
pyulog>=0.5.0
|
||||||
pyyaml
|
pyyaml
|
||||||
|
|||||||
@@ -144,4 +144,7 @@ endforeach()
|
|||||||
if(CMAKE_BUILD_TYPE STREQUAL Coverage)
|
if(CMAKE_BUILD_TYPE STREQUAL Coverage)
|
||||||
setup_target_for_coverage(test_coverage "${CMAKE_CTEST_COMMAND} --output-on-failure -T Test" tests)
|
setup_target_for_coverage(test_coverage "${CMAKE_CTEST_COMMAND} --output-on-failure -T Test" tests)
|
||||||
setup_target_for_coverage(generate_coverage "${CMAKE_COMMAND} -E echo" generic)
|
setup_target_for_coverage(generate_coverage "${CMAKE_COMMAND} -E echo" generic)
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
#setup_target_for_coverage(mavsdk_coverage "${PX4_SOURCE_DIR}/test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --iterations 1 --fail-early" mavsdk)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -77,4 +77,3 @@ if (BUILD_TESTING)
|
|||||||
add_subdirectory(test_stubs)
|
add_subdirectory(test_stubs)
|
||||||
add_subdirectory(gtest_runner)
|
add_subdirectory(gtest_runner)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user