GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Donnerbart/split-tests-java: Divides a test suite into groups with equal execution time, based on prior test timings.

BranchesTags
Open more actions menu

Latest commit

 

History

254 Commits
254 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
gradle
gradle
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
renovate.json5
renovate.json5
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

Unit tests Integration tests Release

Split Tests Java

Divides a test suite into groups with equal execution time, based on prior test timings.

This ensures optimal parallel execution. Since test file runtimes can vary significantly, splitting them evenly without considering timing may result in inefficient grouping.

Compatibility

This tool was written for Java and released as JAR archive.

Usage

Download and extract the latest build from the releases page.

Using the command line

Execute the test split with the required arguments. The tool returns the set of test classes for the current split, joined by spaces.

java -jar split-tests-java.jar --split-index 0 --split-total 10 --glob '**/*Test.java'

Using a JUnit report

For example, check out the project into project and the JUnit reports into reports.

java -jar split-tests-java.jar --split-index 0 --split-total 10 --glob 'project/**/*Test.java' --junit 'reports/**/*.xml'

Arguments

Usage: <main class> [options]
  Options:
  * --split-index, -i
      This test split index.
      Default: 0
  * --split-total, -t
      Total number of test splits.
      Default: 0
  * --glob, -g
      Glob pattern to find test files. Make sure to single-quote the pattern 
      to avoid shell expansion.
    --calculate-optimal-total-split, -c
      Calculates the optimal test split (only on the first split index). Logs 
      a warning if --split-total does not match.
      Default: false
    --debug, -d
      Enables debug logging.
      Default: false
    --exclude-glob, -e
      Glob pattern to exclude test files. Make sure to single-quote the 
      pattern to avoid shell expansion.
    --format, -f
      The output format.
      Default: list
      Possible Values: [list, gradle]
    --help, -h
      Prints the usage.
    --junit-glob, -j
      Glob pattern to find JUnit reports. Make sure to single-quote the 
      pattern to avoid shell expansion.
    --max-optimal-total-split-calculations, -m
      The maximum number of --calculate-optimal-total-split calculations.
      Default: 50
    --new-test-time, -n
      Configures the calculation of the test time for tests without JUnit 
      reports. 
      Default: average
      Possible Values: [zero, average, min, max]
    --working-directory, -w
      The working directory. Defaults to the current directory.

Compilation

This tool is written in Java and uses Gradle as build tool.

  • Install Java 21
  • Checkout the repository
  • ./gradlew shadowJar

Note

split-tests-java is inspired by split-test for Ruby.

In comparison to split-test, split-tests-java works with standard JUnit reports without a file or filepath attribute. The output are also fully qualified class names instead of file names. This makes it compatible with default Java tooling.

About

Divides a test suite into groups with equal execution time, based on prior test timings.

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.