Hypershard Android
This is an introduction and breakdown of the steps required to make use of Hypershard-android.
It should be used in cases where an application has a significant number of UI tests that need to be sharded correctly to run efficiently. On Android UI tests sharding require the entire application to be built first. The hypershard library removes the need for building and outputs a list of all available tests.
More information on this can be found at the official library: Hypershard-android
Installation
- Releases can be found downloaded from Maven Central
- Ensure that you download the correct suffixed as follows
*-all.jar
library
- Ensure that you download the correct suffixed as follows
- Alternatively cloning the repository found here
- Then running
./gradlew install
will produce a valid jarfile in the build directory.
- Then running
Running
-
Open Terminal/cmd/bash
-
Make sure that the hypershard jar file is either copied to the correct location and/or available on the path.
-
Hypershard options are as follows: ```bash
java -jar hypershard-1.1.2-all.jar --help Usage: hypershardcommand [OPTIONS] [dirs]...
Hypershard is a fast and simple test collector that uses the Kotlin and Java ASTs. Hypershard CLI will print full qualified test names found in dir(s).
Options: --annotation-name TEXT Class annotation name to process. For example, if this was set to 'UiTest', then Hypershard will only process classes annotated with @UiTest. --not-annotation-name TEXT Class annotation name not to process. For example, if this was set to 'UiTest', then Hypershard will not process classes annotated with @UiTest. -h, --help Show this message and exit
Arguments: dirs Dir(s) to process. The location of the test classes to parse ```
- An example run of hypershard for flank where the the current directory is flank root:
>java -jar hypershard-1.1.2-all.jar ./test_runner/src/test/kotlin/ftl/reports/util/
Results in the following output
ftl.reports.util.EndsWithTextWithOptionalSlashAtTheEndTest.should properly found end suffix matching text
>java -jar hypershard-1.1.2-all.jar ./test_runner/src/test/kotlin/ftl/reports/util/ > hypershardtests
More examples
A python usage example can be found: https://github.com/dropbox/hypershard-android/tree/master/example
Resources
https://github.com/dropbox/hypershard-android