diff options
author | markdr <markdr@google.com> | 2018-02-12 14:49:16 -0800 |
---|---|---|
committer | markdr <markdr@google.com> | 2018-02-20 12:37:07 -0800 |
commit | 20f2f2d68b2a64de093c49fe3ea694ce10bf9ce8 (patch) | |
tree | 95da7efd24541f67278a26c2da3d03017c69e20d | |
parent | 02571f59094990bff67d52b12122563546488067 (diff) | |
download | platform_tools_test_connectivity-20f2f2d68b2a64de093c49fe3ea694ce10bf9ce8.tar.gz platform_tools_test_connectivity-20f2f2d68b2a64de093c49fe3ea694ce10bf9ce8.tar.bz2 platform_tools_test_connectivity-20f2f2d68b2a64de093c49fe3ea694ce10bf9ce8.zip |
Removed unused additional ACTS CLI to prevent confusion.
Bug: None
Test: BleScanApiTest
Test: IntegrationTest
Test: Upload Hooks/unit test coverage
Change-Id: Ib9e9840da8d62459ab6b23fe4de99aafea1c5059
-rw-r--r-- | acts/README.md | 2 | ||||
-rwxr-xr-x | acts/framework/acts/bin/act.py | 12 | ||||
-rw-r--r-- | acts/framework/acts/test_runner.py | 74 | ||||
-rwxr-xr-x | acts/framework/tests/IntegrationTest.py | 4 | ||||
-rw-r--r-- | acts/tests/sample/RelayDeviceSampleTest.py | 5 |
5 files changed, 5 insertions, 92 deletions
diff --git a/acts/README.md b/acts/README.md index ff4489f7ad..a4e9950e11 100644 --- a/acts/README.md +++ b/acts/README.md @@ -93,7 +93,7 @@ $ python Above, the command `act.py -c acts_sanity_test_config.json -tc IntegrationTest` was run to verify ACTS was properly set up. Below are the components of that command: -- `acts.py`: is the script that runs the test +- `act.py`: is the script that runs the test - -c acts_sanity_test_config: is the flag and name of the configuration file to be used in the test - -tc IntegrationTest: is the name of the test case diff --git a/acts/framework/acts/bin/act.py b/acts/framework/acts/bin/act.py index 2e533cded6..f784d01899 100755 --- a/acts/framework/acts/bin/act.py +++ b/acts/framework/acts/bin/act.py @@ -18,7 +18,6 @@ from builtins import str import argparse import multiprocessing -import os import signal import sys import traceback @@ -91,8 +90,8 @@ def _run_tests_parallel(parsed_configs, test_identifiers, repeat): Each test run will be in its own process. Args: - parsed_config: A list of dicts, each is a set of configs for one - test_runner.TestRunner. + parsed_configs: A list of dicts, each is a set of configs for one + test_runner.TestRunner. test_identifiers: A list of tuples, each identifies what test case to run on what test class. repeat: Number of times to iterate the specified tests. @@ -145,11 +144,6 @@ def main(argv): """This is a sample implementation of a cli entry point for ACTS test execution. - Alternatively, you could directly invoke an ACTS test script: - - python3 MyTest.py -c my_config.json - - See acts.test_runner.main for more details. Or you could implement your own cli entry point using acts.config_parser functions and acts.test_runner.execute_one_test_class. """ @@ -227,7 +221,7 @@ def main(argv): '-r', '--random', action="store_true", - help=("If set, tests will be executed in random order.")) + help="If set, tests will be executed in random order.") parser.add_argument( '-ti', '--test_case_iterations', diff --git a/acts/framework/acts/test_runner.py b/acts/framework/acts/test_runner.py index b3a7111b0f..fdb909944e 100644 --- a/acts/framework/acts/test_runner.py +++ b/acts/framework/acts/test_runner.py @@ -18,7 +18,6 @@ from future import standard_library standard_library.install_aliases() -import argparse import copy import importlib import inspect @@ -37,77 +36,6 @@ from acts import signals from acts import utils -def main(): - """Execute the test class in a test module. - - This is the default entry point for running a test script file directly. - In this case, only one test class in a test script is allowed. - - To make your test script executable, add the following to your file: - - from acts import test_runner - ... - if __name__ == "__main__": - test_runner.main() - - If you want to implement your own cli entry point, you could use function - execute_one_test_class(test_class, test_config, test_identifier) - """ - # Parse cli args. - parser = argparse.ArgumentParser(description="ACTS Test Executable.") - parser.add_argument( - '-c', - '--config', - nargs=1, - type=str, - required=True, - metavar="<PATH>", - help="Path to the test configuration file.") - parser.add_argument( - '--test_case', - nargs='+', - type=str, - metavar="[test_a test_b...]", - help="A list of test case names in the test script.") - parser.add_argument( - '-tb', - '--test_bed', - nargs='+', - type=str, - metavar="[<TEST BED NAME1> <TEST BED NAME2> ...]", - help="Specify which test beds to run tests on.") - args = parser.parse_args(sys.argv[1:]) - # Load test config file. - test_configs = config_parser.load_test_config_file(args.config[0], - args.test_bed) - # Find the test class in the test script. - test_class = _find_test_class() - test_class_name = test_class.__name__ - # Parse test case specifiers if exist. - test_case_names = None - if args.test_case: - test_case_names = args.test_case - test_identifier = [(test_class_name, test_case_names)] - # Execute the test class with configs. - ok = True - for config in test_configs: - try: - result = execute_one_test_class(test_class, config, - test_identifier) - if not result: - logging.error( - 'Results for config %s have returned empty.' % config) - ok = result and ok - except signals.TestAbortAll: - pass - except: - logging.exception("Error occurred when executing test bed %s", - config[keys.Config.key_testbed.value]) - ok = False - if not ok: - sys.exit(1) - - def _find_test_class(): """Finds the test class in a test script. @@ -134,7 +62,7 @@ def execute_one_test_class(test_class, test_config, test_identifier): """Executes one specific test class. You could call this function in your own cli test entry point if you choose - not to use act.py or test_runner.main. + not to use act.py. Args: test_class: A subclass of acts.base_test.BaseTestClass that has the test diff --git a/acts/framework/tests/IntegrationTest.py b/acts/framework/tests/IntegrationTest.py index c8bdf2fa47..3cb34b76d5 100755 --- a/acts/framework/tests/IntegrationTest.py +++ b/acts/framework/tests/IntegrationTest.py @@ -31,7 +31,3 @@ class IntegrationTest(base_test.BaseTestClass): self.log.info("This is a bare minimal test to make sure the basic ACTS" "test flow works.") asserts.explicit_pass("Hello World") - - -if __name__ == "__main__": - test_runner.main() diff --git a/acts/tests/sample/RelayDeviceSampleTest.py b/acts/tests/sample/RelayDeviceSampleTest.py index 040ef62b84..a9304bc9b3 100644 --- a/acts/tests/sample/RelayDeviceSampleTest.py +++ b/acts/tests/sample/RelayDeviceSampleTest.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. from acts import base_test -from acts import test_runner from acts.controllers.relay_lib.relay import SynchronizeRelays @@ -98,7 +97,3 @@ class RelayDeviceSampleTest(base_test.BaseTestClass): # For more fine control over the wait time of relays, you can set # Relay.transition_wait_time. This is not recommended unless you are # using solid state relays, or async calls. - - -if __name__ == "__main__": - test_runner.main() |