diff options
author | Julien Desprez <jdesprez@google.com> | 2020-07-16 15:57:38 -0700 |
---|---|---|
committer | Julien Desprez <jdesprez@google.com> | 2020-07-16 15:57:38 -0700 |
commit | 8e336314b1f33f90c917fa4c06e120ee267ebbdb (patch) | |
tree | a340a627369e4b046ca83fc998e557c2d044aaf8 | |
parent | f7511f62c207cd28e6db3940a799dbe09720f92c (diff) | |
download | tradefederation-8e336314b1f33f90c917fa4c06e120ee267ebbdb.tar.gz |
Fix sharding for executable test
Filters need to be copied to shards.
Test: unit tests
Bug: 161478661
Change-Id: Ie56e20ff2dd90346bdb43b0a28c4a0f2fc68fd4e
-rw-r--r-- | test_framework/com/android/tradefed/testtype/binary/ExecutableBaseTest.java | 3 | ||||
-rw-r--r-- | tests/src/com/android/tradefed/testtype/binary/ExecutableTargetTestTest.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test_framework/com/android/tradefed/testtype/binary/ExecutableBaseTest.java b/test_framework/com/android/tradefed/testtype/binary/ExecutableBaseTest.java index 94e4aa619..eda9d308b 100644 --- a/test_framework/com/android/tradefed/testtype/binary/ExecutableBaseTest.java +++ b/test_framework/com/android/tradefed/testtype/binary/ExecutableBaseTest.java @@ -303,6 +303,9 @@ public abstract class ExecutableBaseTest // Set one test command per shard shard.mTestCommands.put(testName, cmd); } + // Copy the filters to each shard + shard.mExcludeFilters.addAll(mExcludeFilters); + shard.mIncludeFilters.addAll(mIncludeFilters); } catch (InstantiationException | IllegalAccessException | InvocationTargetException diff --git a/tests/src/com/android/tradefed/testtype/binary/ExecutableTargetTestTest.java b/tests/src/com/android/tradefed/testtype/binary/ExecutableTargetTestTest.java index ba18dc054..5c628dfde 100644 --- a/tests/src/com/android/tradefed/testtype/binary/ExecutableTargetTestTest.java +++ b/tests/src/com/android/tradefed/testtype/binary/ExecutableTargetTestTest.java @@ -52,7 +52,6 @@ public class ExecutableTargetTestTest { private final String testCmd2 = "cmd2"; private final String testName3 = "testName3"; private final String testCmd3 = "cmd3"; - private static final String NO_BINARY_ERROR = "Binary %s does not exist."; private static final String ERROR_MESSAGE = "binary returned non-zero exit code."; private ITestInvocationListener mListener = null; @@ -376,7 +375,7 @@ public class ExecutableTargetTestTest { /** Test split() for sharding */ @Test - public void testShard_Split() throws DeviceNotAvailableException, ConfigurationException { + public void testShard_Split() throws ConfigurationException { mExecutableTargetTest = new ExecutableTargetTest(); // Set test commands OptionSetter setter = new OptionSetter(mExecutableTargetTest); |