diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index b3fb6bdab0..952bc3ecbd 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -4597,7 +4597,7 @@ class AutoTestCopter(AutoTest): self.drain_mav() self.assert_prearm_failure("Check MOT_PWM_MIN/MAX") - def tests(self): + def tests1(self): '''return list of all tests''' ret = super(AutoTestCopter, self).tests() ret.extend([ @@ -4831,6 +4831,35 @@ class AutoTestCopter(AutoTest): ]) return ret + def tests2(self): + '''return list of all tests''' + ret = ([ + ("MotorVibration", + "Fly motor vibration test", + self.fly_motor_vibration), + + ("DynamicNotches", + "Fly Dynamic Notches", + self.fly_dynamic_notches), + + ("GyroFFT", + "Fly Gyro FFT", + self.fly_gyro_fft), + + ("LogDownLoad", + "Log download", + lambda: self.log_download( + self.buildlogs_path("ArduCopter-log.bin"), + upload_logs=len(self.fail_list) > 0)) + ]) + return ret + + def tests(self): + ret = [] + ret.extend(self.tests1()) + ret.extend(self.tests2()) + return ret + def disabled_tests(self): return { "Parachute": "See https://github.com/ArduPilot/ardupilot/issues/4702", @@ -5051,30 +5080,14 @@ class AutoTestHeli(AutoTestCopter): ]) return ret -class AutoTestCopterExtra(AutoTestCopter): - def log_name(self): - return "ArduCopter" +class AutoTestCopterTests1(AutoTestCopter): def tests(self): - '''return list of all tests''' - ret = ([ - ("MotorVibration", - "Fly motor vibration test", - self.fly_motor_vibration), + return self.tests1() - ("DynamicNotches", - "Fly Dynamic Notches", - self.fly_dynamic_notches), - ("GyroFFT", - "Fly Gyro FFT", - self.fly_gyro_fft), +class AutoTestCopterTests2(AutoTestCopter): - ("LogDownLoad", - "Log download", - lambda: self.log_download( - self.buildlogs_path("ArduCopter-log.bin"), - upload_logs=len(self.fail_list) > 0)) - ]) - return ret + def tests(self): + return self.tests2() diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index f43e81ea1f..b3b8fab023 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -251,7 +251,8 @@ def should_run_step(step): __bin_names = { "ArduCopter": "arducopter", - "ArduCopterExtra": "arducopter", + "ArduCopterTests1": "arducopter", + "ArduCopterTests2": "arducopter", "ArduPlane": "arduplane", "APMrover2": "ardurover", "AntennaTracker": "antennatracker", @@ -303,7 +304,8 @@ def find_specific_test_to_run(step): tester_class_map = { "fly.ArduCopter": arducopter.AutoTestCopter, - "fly.ArduCopterExtra": arducopter.AutoTestCopterExtra, + "fly.ArduCopterTests1": arducopter.AutoTestCopterTests1, + "fly.ArduCopterTests2": arducopter.AutoTestCopterTests2, "fly.ArduPlane": arduplane.AutoTestPlane, "fly.QuadPlane": quadplane.AutoTestQuadPlane, "drive.APMrover2": apmrover2.AutoTestRover, @@ -771,7 +773,6 @@ if __name__ == "__main__": 'build.ArduCopter', 'defaults.ArduCopter', 'fly.ArduCopter', - 'fly.ArduCopterExtra', 'build.Helicopter', 'fly.CopterAVC', @@ -787,6 +788,11 @@ if __name__ == "__main__": 'convertgpx', ] + moresteps = [ + 'fly.ArduCopterTests1', + 'fly.ArduCopterTests2', + ] + skipsteps = opts.skip.split(',') # ensure we catch timeouts @@ -820,6 +826,9 @@ if __name__ == "__main__": if x is not None: matches.append(x) + if a in moresteps: + matches.append(a) + if not len(matches): print("No steps matched {}".format(a)) sys.exit(1) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index e13abc9d30..147c9fd928 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -688,6 +688,9 @@ class AutoTest(ABC): use_map=False, _show_test_timings=False): + if binary is None: + raise ValueError("Should always have a binary") + self.binary = binary self.valgrind = valgrind self.gdb = gdb diff --git a/Tools/scripts/build_ci.sh b/Tools/scripts/build_ci.sh index 1210071591..c995bdaf29 100755 --- a/Tools/scripts/build_ci.sh +++ b/Tools/scripts/build_ci.sh @@ -74,12 +74,12 @@ function run_autotest() { for t in $CI_BUILD_TARGET; do # special case for SITL testing in CI - if [ "$t" == "sitltest-copter" ]; then - run_autotest "Copter" "build.ArduCopter" "fly.ArduCopter" + if [ "$t" == "sitltest-copter-tests1" ]; then + run_autotest "Copter" "build.ArduCopter" "fly.ArduCopter.Tests2" continue fi - if [ "$t" == "sitltest-copter-extra" ]; then - run_autotest "Copter" "build.ArduCopter" "fly.ArduCopterExtra" + if [ "$t" == "sitltest-copter-tests2" ]; then + run_autotest "Copter" "build.ArduCopter" "fly.ArduCopter.Tests1" continue fi if [ "$t" == "sitltest-plane" ]; then diff --git a/Tools/scripts/run-coverage.sh b/Tools/scripts/run-coverage.sh index 78cbc53150..0f2bbea113 100755 --- a/Tools/scripts/run-coverage.sh +++ b/Tools/scripts/run-coverage.sh @@ -31,7 +31,7 @@ rm -rf build # Run main vehicle tests ./Tools/autotest/autotest.py $OPTS build.ArduPlane fly.ArduPlane fly.QuadPlane ./Tools/autotest/autotest.py $OPTS build.ArduSub dive.ArduSub -./Tools/autotest/autotest.py $OPTS build.ArduCopter fly.ArduCopter fly.ArduCopterExtra +./Tools/autotest/autotest.py $OPTS build.ArduCopter fly.ArduCopter fly.ArduCopter ./Tools/autotest/autotest.py $OPTS build.Helicopter fly.CopterAVC ./Tools/autotest/autotest.py $OPTS build.AntennaTracker test.AntennaTracker ./Tools/autotest/autotest.py $OPTS build.APMrover2 drive.APMrover2