Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

io7m-com/percentpass

Repository files navigation

percentpass

Maven Central Maven Central (snapshot) Codecov Java Version

com.io7m.percentpass

JVM Platform Status
OpenJDK (Temurin) Current Linux Build (OpenJDK (Temurin) Current, Linux)
OpenJDK (Temurin) LTS Linux Build (OpenJDK (Temurin) LTS, Linux)
OpenJDK (Temurin) Current Windows Build (OpenJDK (Temurin) Current, Windows)
OpenJDK (Temurin) LTS Windows Build (OpenJDK (Temurin) LTS, Windows)

Repository Relocation

Development of this project has moved to an open-source but not open-contribution model.

Source code and commits will remain publicly available perpetually, but issues and/or pull requests will be rejected and/or ignored. Additionally, this project will now only be available via a read-only mirror at:

https://codeberg.org/io7m-com/percentpass

percentpass

A minimal Junit 5 extension that allows for executing tests multiple times, and requiring a minimum number of successful executions.

This can be useful when a particular test in a test suite is timing sensitive and cannot be reliably corrected for some reason. Perhaps you decide that working correctly 98% of the time is acceptable.

Features

  • Percentage passing; specify that a percentage of the iterations of a test must succeed.
  • Minimum passing: specify that an integral number of the iterations of a test must succeed.
  • Written in pure Java 17.
  • OSGi ready
  • JPMS ready
  • ISC license
  • High-coverage automated test suite

Usage

Annotate tests with @MinimumPassing or @PercentPassing:

  @PercentPassing(executionCount = 1000, passPercent = 98.0)
  public void testPercentOK()
  {
    // Do something that fails 1% of the time.
  }

  @MinimumPassing(executionCount = 1000, passMinimum = 980)
  public void testMinimumOK()
  {
    // Do something that fails 1% of the time.
  }

About

Percentage-passing extension for JUnit 5

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Contributors