Files
bquarkz cd001ce2d9
Test / Tests and coverage
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
fix(ci): preserve failed test and coverage artifacts
2026-11-16 10:09:06 +00:00
..

Studio Jenkins verification

Jenkinsfile uses the checked-in Gradle wrapper (currently 9.3.1). A compatible Java installation must be available to launch Gradle; project conventions select Java 21 for compilation/tests. The pipeline retains its existing Gradle cache location, worker limit and installed Jenkins report plugins. It does not require a named Jenkins Gradle installation.

The build runs on a Unix agent with Java and dependency/cache access. It sets JAVA_TOOL_OPTIONS=-Djava.awt.headless=true for Gradle and test JVMs. No display, runtime binary, sibling runtime checkout, runtime download/build, or new Jenkins plugin is required by the packer contract suite.

Commands

export JAVA_TOOL_OPTIONS=-Djava.awt.headless=true
./gradlew clean --no-daemon --console=plain
./gradlew test jacocoTestReport --continue --parallel --max-workers=2 --build-cache --no-daemon --console=plain

Clean is a separate stage: when it fails, old reports must not be published as a new test run. Gradle --continue lets independent tasks and reports finish after a test failure; it does not turn a failing command into success. Runtime/desktop opt-in test tasks are not invoked. The ordinary packer test task includes PackerAssetContractTest without skips or a runtime fallback.

Failure reporting

The unconditional post block publishes available JUnit, consolidated JaCoCo XML, HTML and archived test/coverage reports after a failed verification command. Each publisher is isolated so one publisher error does not prevent the others from being attempted. The build console retains compilation/setup diagnostics.

JUnit explicitly completes the Test / Tests and coverage check from the post block. Its name must match the check required by Gitea, independently of the publisher's stage context. The separate coverage check remains JaCoCo Coverage.

Coverage recording is enabled for failed builds so available coverage can still be inspected after test failures. Coverage processing errors fail publication; the isolated HTML and artifact publishers are still attempted. Archiving runs even for failed or unstable builds and retains the original JUnit XML/binary results, test HTML, coverage XML/HTML, and raw **/build/jacoco/*.exec files. JUnit XML includes test failure details and captured output; the raw JaCoCo data is retained even if consolidated XML/HTML generation fails. If no coverage data was produced, there is no coverage artifact to recover; inspect the build console and any available test results. Artifacts follow the Jenkins job's build/artifact retention policy.

An otherwise successful verification must produce JUnit results, the packer contract suite report, consolidated JaCoCo XML and HTML. Missing successful-build evidence fails publication. A failed compilation may have no reports: the original build failure remains authoritative and available diagnostics are still preserved. A failed clean does not publish potentially stale artifacts.

Coverage thresholds are unchanged: CLASS/METHOD/LINE/INSTRUCTION 50%, BRANCH 40%, PROJECT baseline and UNSTABLE criticality. Reports from partially failed test runs are useful diagnostics, not a passing quality gate.

Contract and manual verification boundary

See the packer fixture provenance and coverage. The automated suite checks producer bytes and metadata against independent expectations. Runtime gameplay remains manual with existing games, not a local or CI automated test. Record manual outcomes only after execution.

Local Gradle checks and Groovy parsing cannot certify controller plugin behavior. A Jenkins run is needed to observe actual report publication and coverage checks; report any unavailable controller validation explicitly.

Jenkins behavior references: post conditions and catchError, JUnit check names, coverage recording on failed builds, and artifact archiving.