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:
Lorenz Meier 2019-12-24 14:46:21 +01:00
parent 73edc21667
commit 26d01b876c
3 changed files with 31 additions and 23 deletions

View File

@ -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

View File

@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.5.1)
find_package(MAVSDK)
if(${PX4_BOARD_MODEL} MATCHES "sitl")
find_package(MAVSDK QUIET)
if (MAVSDK_FOUND)
if (MAVSDK_FOUND)
add_executable(mavsdk_tests
test_main.cpp
autopilot_tester.cpp
@ -18,4 +19,7 @@ if (MAVSDK_FOUND)
target_compile_options(mavsdk_tests
PRIVATE -std=c++17 -Wall -Wextra -Werror)
else()
message("MAVSDK C++ not found, skipping mavsdk_tests build..")
endif()
endif()

View File

@ -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)