Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Hypershard android usage guide #1791

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions docs/hypershard_android.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Hypershard Android

This is an introduction and breakdown of the steps required to make use of [Hypershard-android](https://github.com/dropbox/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](https://github.com/dropbox/hypershard-android)


### Installation

1. Releases can be found downloaded from [Maven Central](https://search.maven.org/search?q=g:com.dropbox.mobile.hypershard)
1. Ensure that you download the correct suffixed as follows `*-all.jar` library
2. Alternatively cloning the repository found [here](https://github.com/dropbox/hypershard-android)
1. Then running `./gradlew install` will produce a valid jarfile in the build directory.

### Running

1. Open Terminal/cmd/bash

2. Make sure that the hypershard jar file is either copied to the correct location and/or available on the path.

3. 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
```

3. An example run of hypershard for flank where the the current directory is flank root:

```bash
>java -jar hypershard-1.1.2-all.jar ./test_runner/src/test/kotlin/ftl/reports/util/
```

Results in the following output
```bash
ftl.reports.util.EndsWithTextWithOptionalSlashAtTheEndTest.should properly found end suffix matching text
```
4. Which can be saved by simple bash commands such as the > character for example:
```bash
>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
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ nav:
- Domain: "https://github.com/Flank/flank/tree/master/test_runner/src/main/kotlin/ftl/domain#domain"
- Data: "https://github.com/Flank/flank/tree/master/test_runner/src/main/kotlin/ftl/data#data"
- Adapter: "https://github.com/Flank/flank/tree/master/test_runner/src/main/kotlin/ftl/adapter#adapter"
- Hypershard:
- Android: "hypershard_android.md"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quotes not needed


theme:
name: material
Expand Down