[autotest]: Add --help to test health scripts.
Although these scripts have no interesting options, people will not be
suprised when they try to find out more and suddenly the script is bein ran.
BUG=chromium:276668
TEST=Manual testing.
Change-Id: I247c1e681a26314ffb74f1905575be4a1706deb8
Reviewed-on: https://gerrit.chromium.org/gerrit/66441
Reviewed-by: Dennis Jeffrey <dennisjeffrey@chromium.org>
Commit-Queue: Keyar Hood <keyar@chromium.org>
Tested-by: Keyar Hood <keyar@chromium.org>
diff --git a/frontend/health/passing_experimental.py b/frontend/health/passing_experimental.py
index 383198a..e81c91d 100755
--- a/frontend/health/passing_experimental.py
+++ b/frontend/health/passing_experimental.py
@@ -5,7 +5,7 @@
# found in the LICENSE file.
-import datetime, sys
+import argparse, datetime, sys
import common
from autotest_lib.client.common_lib import mail
@@ -65,14 +65,29 @@
return recent_passes - recent_fails
-def main():
+def parse_options(args):
+ """Parse the command line options."""
+
+ description = ('Collects information about which experimental tests '
+ 'have been passing for a long time and creates an email '
+ 'summarizing the results.')
+ parser = argparse.ArgumentParser(description=description)
+ parser.parse_args(args)
+
+
+def main(args=None):
"""
The script code.
Allows other python code to import and run this code. This will be more
important if a nice way to test this code can be determined.
+ @param args: The command line arguments being passed in.
+
"""
+ args = [] if args is None else args
+ parse_options(args)
+
experimental_tests = get_experimental_tests()
pass_times = utils.get_last_pass_times()
fail_times = utils.get_last_fail_times()
@@ -93,4 +108,4 @@
if __name__ == '__main__':
- sys.exit(main())
+ sys.exit(main(sys.argv))