diff options
author | Per Larsen <perlarsen@google.com> | 2023-10-05 00:51:16 +0000 |
---|---|---|
committer | Per Larsen <perlarsen@google.com> | 2023-10-05 01:22:21 +0000 |
commit | fe9839a300cfbbba7d97587621c60e4a45671c6e (patch) | |
tree | 8c478b7ffbf37098db1c81c5bb25789786243457 | |
parent | 734032be5fa3746a223c4133350f3629fcd0bf16 (diff) | |
download | aosp-fe9839a300cfbbba7d97587621c60e4a45671c6e.tar.gz |
scripts: Allow host tests to be repeated
Add repeat property to TrustyHostTest such that a potentially
flaky test can be repeated via the --gtest_repeat flag such
that one can detemine whether flakyness has been addressed
with a single presubmit run.
Bug: None
Change-Id: Ibda9ca2a418a58b7143a07c9e79ed4780b4842c2
-rwxr-xr-x | scripts/trusty_build_config.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/trusty_build_config.py b/scripts/trusty_build_config.py index bee5974..a0efa8b 100755 --- a/scripts/trusty_build_config.py +++ b/scripts/trusty_build_config.py @@ -293,9 +293,12 @@ class TrustyBuildConfig(object): project = self.get_project(project_name) project.tests += flatten_list(tests) - def hosttest(host_cmd, enabled=True): - return TrustyHostTest("host-test:" + host_cmd, - ["host_tests/" + host_cmd], enabled) + def hosttest(host_cmd, enabled=True, repeat=1): + cmd = ["host_tests/" + host_cmd] + # TODO: assumes that host test is always a googletest + if repeat > 1: + cmd.append(f"--gtest_repeat={repeat}") + return TrustyHostTest("host-test:" + host_cmd, cmd, enabled) def hosttests(tests): return [test for test in flatten_list(tests) |