Skip to content

test: enforce 100% runtime line coverage - #18

Merged
ryanbarlow97 merged 1 commit into
mainfrom
codex/coverage-100
Oct 2, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
codex/coverage-100

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

WorldBorder had no tests and 0/207 covered executable lines. Add 79 behavioral tests covering region boundaries, player warnings and damage, scheduling, permissions, commands, configuration loading, and plugin lifecycle/resource failures. The suite now covers 207/207 production lines without exclusions.

mvn clean verify now enforces zero missed production lines, fails if no tests run, and preserves the Mockito and JaCoCo agents. CI uploads the HTML/XML coverage reports; README documents the metric. No production behavior changes were needed in this repository.

Validation: Java 21 Maven clean verify/verify, 79 tests passed with no failures or skips; runtime JAR filename/version check passed. JaCoCo: lines 207/207 (100%), instructions 767/769 (99.74%), branches 79/81 (97.53%). The enforced coverage metric is executable lines.

Part of the four lowest runtime-coverage repositories selected from the active workspace, excluding CoreProtect as requested. Any review fixes stay in this PR.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 047558ba-35dc-4996-9bd0-ee90b5dc477b

📥 Commits

Reviewing files that changed from the base of the PR and between a927ee3 and da97056.

📒 Files selected for processing (9)
  • .github/workflows/build.yml
  • README.md
  • pom.xml
  • src/test/java/net/tfminecraft/worldborder/WorldBorderTest.java
  • src/test/java/net/tfminecraft/worldborder/border/BorderManagerTest.java
  • src/test/java/net/tfminecraft/worldborder/border/RegionTest.java
  • src/test/java/net/tfminecraft/worldborder/cache/CacheTest.java
  • src/test/java/net/tfminecraft/worldborder/command/CommandManagerTest.java
  • src/test/java/net/tfminecraft/worldborder/loader/ConfigLoaderTest.java

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Tests
    • Added comprehensive automated tests covering plugin setup, configuration loading, border regions, world filtering, commands, permissions and player warnings.
  • Chores
    • Builds now generate and check coverage reports, failing if production code has uncovered executable lines or no tests are found.
    • Coverage reports are uploaded as build artifacts when available.
  • Documentation
    • Added guidance on running tests, coverage requirements and where to find coverage reports.

Walkthrough

The pull request adds Maven test and coverage configuration, tests for existing plugin and world-border behaviour, documentation of coverage requirements, and a build-workflow upload for the JaCoCo report.

Changes

Test coverage and validation

Layer / File(s) Summary
Test and coverage setup
pom.xml, README.md, .github/workflows/build.yml
Maven configures JUnit, Mockito, MockBukkit, Surefire and JaCoCo, including a line-coverage check. The README describes test and coverage requirements and outputs. The workflow uploads the JaCoCo report when it exists and the run is not cancelled.
Configuration and model tests
src/test/java/net/tfminecraft/worldborder/loader/ConfigLoaderTest.java, src/test/java/net/tfminecraft/worldborder/cache/CacheTest.java, src/test/java/net/tfminecraft/worldborder/border/RegionTest.java
Tests cover configuration defaults, parsing and error handling; cache lookup and state; and region bounds and zone classifications.
Plugin and runtime tests
src/test/java/net/tfminecraft/worldborder/WorldBorderTest.java, src/test/java/net/tfminecraft/worldborder/border/BorderManagerTest.java, src/test/java/net/tfminecraft/worldborder/command/CommandManagerTest.java
Tests cover plugin setup and teardown, border-manager scheduling and player handling, and command permissions, output and tab completion.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to da970

This change adds tests and a coverage gate without altering runtime behavior. No concrete merge-blocking issue was found.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@ryanbarlow97
ryanbarlow97 merged commit a0d8a9f into main Oct 2, 2026
2 checks passed
@ryanbarlow97
ryanbarlow97 deleted the codex/coverage-100 branch October 2, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant