Allow running single java paramertize test
This commit streamlines the process of passing parameterized tests
by utilizing the standard atest-include-filter instead of relying
on the test-arg flag.
Bug: 279667129
Test: m atest ; atest-dev CtsContentTestCases:\
PackageManagerShellCommandMultiUserTest#\
testGetFirstInstallTime[install]
Test: atest-dev ; CtsContentTestCases:\
PackageManagerShellCommandMultiUserTest#\
testGetFirstInstallTime[install],\
testListPackageDefaultAllUsers[install]
Change-Id: I0bd0310d82612d3a1664737e66c09ee3dce8303d
diff --git a/atest/test_runners/atest_tf_test_runner.py b/atest/test_runners/atest_tf_test_runner.py
index dd6535b..be220aa 100644
--- a/atest/test_runners/atest_tf_test_runner.py
+++ b/atest/test_runners/atest_tf_test_runner.py
@@ -1321,29 +1321,14 @@
filters = set()
for test_info_filter in info.data.get(constants.TI_FILTER, []):
filters.update(test_info_filter.to_set_of_tf_strings())
+
for test_filter in filters:
- if re.compile(r'.*#.*\[.*\]').match(test_filter):
- instrumentation_filters.append(test_filter)
- # Only pass test_name to --atest-include-filter if the given is
- # a Java parameterized test.
- test_filter, _ = test_filter_utils.split_methods(test_filter)
filter_arg = constants.TF_ATEST_INCLUDE_FILTER_VALUE_FMT.format(
test_name=info.test_name,
test_filter=test_filter
)
tf_args.extend([constants.TF_ATEST_INCLUDE_FILTER, filter_arg])
- # Customize --test-arg for running Java parameterized tests.
- if instrumentation_filters:
- test_filter = ','.join(instrumentation_filters)
- logging.debug('test_filter=%s', test_filter)
- tf_args.append(constants.TF_TEST_ARG)
- tf_args.append(
- '{tf_class}:{option_name}:{option_value}'.format(
- tf_class=constants.TF_AND_JUNIT_CLASS,
- option_name='instrumentation-arg',
- option_value=f'filter-tests:="{test_filter}"'
- )
- )
+
return tf_args