Testing¶
TASSEL uses JUnit tests run through Gradle. Tests live
under src/test/java/net/maizegenetics/, mirroring the main source layout.
There are two test entry points with very different roles:
| Task | Blocking? | Purpose |
|---|---|---|
./gradlew statisticsTest |
Yes (CI gate) | Verifies TASSEL's numeric results against R-validated expected values. |
./gradlew test |
No | Runs the full suite, including pipeline/IO tests that are still being stabilized. |
Fetching test data¶
Many tests read from a shared test-data archive that is downloaded into the
git-ignored dataFiles/ directory. Fetch it once after a clean checkout:
This downloads and extracts the tassel_test_data release archive from
maize-genetics/tassel_test_data.
The task is a no-op if dataFiles/ already exists and is non-empty.
OpenBLAS required for statistics tests
The statistical tests exercise native BLAS routines. Install OpenBLAS (see
Building from Source) or set
BLAS_LIB_PATH before running them.
The statistics gate (required)¶
statisticsTest is the enforced CI gate. It runs only the classes that
verify TASSEL's statistical correctness — kinship, MLM, GLM, PCA, linkage
disequilibrium, distance matrices, linear models, and related numeric transforms
— with ignoreFailures = false, so any failure is visible and blocks a merge.
It is wired into check, so ./gradlew check also enforces it. Reports are
written to:
build/reports/tests/statisticsTest/(HTML)build/test-results/statisticsTest/(JUnit XML)
If you change any analysis or statistics code, run this gate locally before opening a pull request.
The full suite (non-blocking)¶
The broad test task runs everything but is currently non-blocking
(ignoreFailures = true) while some pipeline and I/O tests are being fixed, and
it excludes a set of environment-sensitive tests (certain GBS, HDF5, and
hard-coded-path tests). Failures here are informative but do not block CI.
Coverage¶
Coverage is measured with Kover using the JaCoCo engine, focused on branch coverage of the analysis and pipeline logic. Pure GUI/Swing code is excluded from the report so coverage reflects exercised analytical logic.
# Human-readable HTML report
./gradlew koverHtmlReport
# XML report (used by CI / Codecov)
./gradlew koverXmlReport
The HTML report is written under build/reports/kover/.
Excluding generated GUI boilerplate
Auto-generated plugin accessors and GUI hook methods are annotated with
@GeneratedGuiBoilerplate. Because its name contains "Generated", JaCoCo
automatically drops those methods from coverage.
What CI runs¶
The GitHub Actions workflow (.github/workflows/coverage.yml) runs on pull
requests that touch src/**, on Ubuntu with JDK 21 and OpenBLAS installed. It
has two jobs:
- Statistics gate (required) — installs OpenBLAS, downloads the test data,
and runs
./gradlew statisticsTest. Must be green to merge. - Full suite & coverage (non-blocking) — runs
./gradlew test koverXmlReportand uploads coverage to Codecov.
Writing tests¶
- Place tests in
src/test/java/net/maizegenetics/, mirroring the package of the code under test. - For statistical code, prefer asserting against known-good expected values (e.g. R-validated results stored in the test-data archive) rather than re-deriving them in the test.
- If a new statistical test should be enforced, add its fully-qualified class
name to the
statisticsClasseslist inbuild.gradle.ktsso it becomes part of the required gate.