b03560c32573b9057dc1daaf877501dbb4e16f8d |
|
25-May-2017 |
Paul Duffin <paulduffin@google.com> |
Fix JUnitParamsRunner so it works with CTS sharding CTS uses the Android Test Support Library's TestRequestBuilder.ShardingFilter to spread changes across a number of devices in order to parallelize testing. CTS runs the tests in two modes, in the first it collects the set of tests that will be run - the list of tests returned by Runner.getDescription() (after filtering) and in the second it actually runs the tests as returned by ParentRunner.getFilteredChildren(). JUnitParams does not work in that situation because it applies the filter in a different way for parameterized methods depending on whether it is collecting or running which leads to inconsistent methods in each phase which causes CTS problems. When collecting it creates a flat list of FrameworkMethod instances, one for each method, whether parameterized or not and applies the filter to that. Once it has filtered it iterates over to create the Description and during that process it creates N Description objects for each parameterized method and 1 Description object for each non-parameterized method. That means that for each parameterized method either every instance is collected or none of them are. When running it creates a flat list of FrameworkMethod instances, one for each non-parameterized method and N for each parameterized method (where N is the number of parameter sets supplied for the method). They are then filtered individually. That means that for each parameterized method some of its instances are run but not necessarily all. This fixes it by making the running and describing parts completely consistent in how they apply the filters. This change will be pushed upstream if possible. Tested by running the two commands given in the bug and ensuring that they produce the correct set of tests. Added target to build the test on host and ran selected tests from there. Ran all tests on the device as per instructions in Android.mk file. Bug: 38419944 Test: See above Change-Id: I25b4d4130ffdc71c77992abf592662ba1e1432db
/external/junit-params/src/main/java/junitparams/internal/TestMethod.java
|
ea07fbcef796fdacd3110b41eec7a6c6e55044fc |
|
14-Dec-2016 |
Paul Duffin <paulduffin@google.com> |
Partially revert "Patch to make it compile against JUnit 4.10 and run on Android" This partially reverts commit 6774bdc0447b72a618eab51772685010afd5647a. Bug: 33613916 Test: make checkbuild Change-Id: Iac008952ff1a0e6f89d8862e817a8b2480dcbb28
/external/junit-params/src/main/java/junitparams/internal/TestMethod.java
|
6774bdc0447b72a618eab51772685010afd5647a |
|
20-Jul-2016 |
Paul Duffin <paulduffin@google.com> |
Patch to make it compile against JUnit 4.10 and run on Android The main issues are: * JUnit 4.10 does not support giving Description instances a unique id, separate to its display name. * JUnit 4.10's BlockJUnit4ClassRunner.validateFields(List) method is private so cannot be overridden. * JUnit 4.10 requires test classes to be static. * JUnit 4.10 has no assertNotEquals() methods. * Some of the tests need to be run from the project's root directory in order to access file system resources. As a result those tests do not work when run on the device and so they are marked with @Ignore. Bug: 30244565 Test: Ran the junit-params-test using vogar Change-Id: I8f1bd602d07bedec1340373ad5747e3565ce617d
/external/junit-params/src/main/java/junitparams/internal/TestMethod.java
|
fd1f9491413fcdbfae3cbd43651db31fdabce41a |
|
12-Jul-2016 |
Paul Duffin <paulduffin@google.com> |
Initial checkin of JUnitParams-1.0.5 Adds README.version, README.google, MODULE_LICENSE_APACHE2 files as required by the process (see b/30087411). The code does not yet compile; it requires patching to work with Android API and JUnit 4.10. Those patches will be added in separate commits to make it easy to identify the Android specific changes. All the changes will be submitted together. Bug: 30244565 Change-Id: Icf556377478c3afdd644c5e4db0ff18898f496ae Test: Once it compiles the tests will be run.
/external/junit-params/src/main/java/junitparams/internal/TestMethod.java
|