https://github.com/dropbox/hypershard-android
CLI tool for collecting tests
https://github.com/dropbox/hypershard-android
android java kotlin kotlin-library
Last synced: 18 days ago
JSON representation
CLI tool for collecting tests
- Host: GitHub
- URL: https://github.com/dropbox/hypershard-android
- Owner: dropbox
- License: apache-2.0
- Created: 2019-05-15T21:13:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-12T19:56:36.000Z (almost 2 years ago)
- Last Synced: 2025-08-22T13:58:04.049Z (5 months ago)
- Topics: android, java, kotlin, kotlin-library
- Language: Kotlin
- Homepage:
- Size: 1.45 MB
- Stars: 85
- Watchers: 16
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README

# About
A fast and easy CLI tool that leverages AST (Abstract Syntax Tree) to parse test files for the purposes of test collection.
Apps that have a significant number of UI tests – like Paper or Dropbox apps – need to be sharded to run efficiently on CI. Unfortunately, UI test sharding generally requires you to build the entire application. Hypershard removes this first build by performing analysis of the Abstract Syntax Tree to output the list of all available tests.
At Dropbox, we run Android UI tests separately from JVM tests. Using historical data, we shard our UI tests such that each shard is balanced e.g. each shard ends approximately at the same time.
We do this by running tests using [ADB Instrumentation test options](https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner) `-e testFile` where each shard has its own list of tests.
# Download
The `all` jar is executable and can be downloaded from [Maven Central](https://search.maven.org/search?q=g:com.dropbox.mobile.hypershard)
Snapshots of the development version are available in [Sonatype's `snapshots` repository](https://oss.sonatype.org/content/repositories/snapshots/).
Another use case could be to use Hypershard as a dependency in your project
```groovy
implementation 'com.dropbox.mobile.hypershard:hypershard:1.1.3'
```
# Usage
```
java -jar hypershard-1.1.3-all.jar --help
```
Here's an [example Python script](example/run_hypershard.py) that uses Hypershard as a CLI tool.
# Building
This command will build the jar with dependencies
```
./gradlew install
```
# Testing
```
./gradlew check
```
# Contributing
This is a standalone gradle project, you can open this project to start contributing