forked from Archive/PX4-Autopilot
GH Actions: Enable grind option
This allows to run the script in grind mode to find CI failures that are triggered through e.g. race conditions.
This commit is contained in:
parent
73edc21667
commit
26d01b876c
|
@ -16,4 +16,5 @@ jobs:
|
|||
# Build all targets
|
||||
run: DONT_RUN=1 make px4_sitl gazebo mavsdk_tests
|
||||
- name: Run simulation tests
|
||||
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 100
|
||||
# Grind configuration: Run ~8 minutes for 35 iterations == close to the 6 hour limit of Github Actions
|
||||
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --iterations 1 --fail-early
|
||||
|
|
|
@ -1,21 +1,25 @@
|
|||
cmake_minimum_required(VERSION 3.5.1)
|
||||
|
||||
find_package(MAVSDK)
|
||||
if(${PX4_BOARD_MODEL} MATCHES "sitl")
|
||||
find_package(MAVSDK QUIET)
|
||||
|
||||
if (MAVSDK_FOUND)
|
||||
add_executable(mavsdk_tests
|
||||
test_main.cpp
|
||||
autopilot_tester.cpp
|
||||
test_mission_multicopter.cpp
|
||||
)
|
||||
if (MAVSDK_FOUND)
|
||||
add_executable(mavsdk_tests
|
||||
test_main.cpp
|
||||
autopilot_tester.cpp
|
||||
test_mission_multicopter.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(mavsdk_tests
|
||||
MAVSDK::mavsdk
|
||||
MAVSDK::mavsdk_action
|
||||
MAVSDK::mavsdk_mission
|
||||
MAVSDK::mavsdk_telemetry
|
||||
)
|
||||
target_link_libraries(mavsdk_tests
|
||||
MAVSDK::mavsdk
|
||||
MAVSDK::mavsdk_action
|
||||
MAVSDK::mavsdk_mission
|
||||
MAVSDK::mavsdk_telemetry
|
||||
)
|
||||
|
||||
target_compile_options(mavsdk_tests
|
||||
PRIVATE -std=c++17 -Wall -Wextra -Werror)
|
||||
target_compile_options(mavsdk_tests
|
||||
PRIVATE -std=c++17 -Wall -Wextra -Werror)
|
||||
else()
|
||||
message("MAVSDK C++ not found, skipping mavsdk_tests build..")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -243,12 +243,6 @@ def main():
|
|||
|
||||
returncode = test_runner.wait(group['timeout_min'])
|
||||
was_success = (returncode == 0)
|
||||
print("Test '{}': {}".
|
||||
format(test, "Success" if was_success else "Fail"))
|
||||
if not was_success:
|
||||
overall_success = False
|
||||
if args.fail_early:
|
||||
break
|
||||
|
||||
if args.gui:
|
||||
returncode = gzclient_runner.stop()
|
||||
|
@ -260,7 +254,16 @@ def main():
|
|||
px4_runner.stop()
|
||||
print("px4 exited with {}".format(returncode))
|
||||
|
||||
if not overall_success and x > 0:
|
||||
# Test run results
|
||||
print("Test '{}': {}".
|
||||
format(test, "Success" if was_success else "Fail"))
|
||||
|
||||
# Flag it as group test failure, but finish the rest of the test targets
|
||||
if not was_success:
|
||||
overall_success = False
|
||||
|
||||
# Abort after the full matrix / test group
|
||||
if not overall_success and x > 0 and args.fail_early:
|
||||
print("Aborting with a failure in test run %d" % (x + 1))
|
||||
sys.exit(0 if overall_success else 1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue