Skip to content

[Unit Tests] Add ExtraOre and ItsATriple mining ability tests - #361

Closed
DiamondDagger590 wants to merge 1 commit into
recodefrom
claude/magical-cray-j2syvz
Closed

DiamondDagger590 wants to merge 1 commit into
recodefrom
claude/magical-cray-j2syvz

Conversation

@DiamondDagger590

@DiamondDagger590 DiamondDagger590 commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add ExtraOreTest (13 tests) covering activation chance formula evaluation with mining_level variable, multiplier map operations (addMultiplier, getMultiplier, isBlockMultiplied), reloadable content accessors, and metadata (ability key, skill key, database name, enabled route, YAML document)
  • Add ItsATripleTest (11 tests) covering tier-based activation chance with formula evaluation using tier variable, tier-specific route preference over all-tiers fallback, literal value passthrough, and metadata (ability key, skill key, database name, max tier from config, enabled route, tier configuration route, YAML document, applicable attributes)

Details

Both test classes follow the established patterns from BleedTest (non-tierable) and DeeperWoundTest (tierable):

  • Extend McRPGBaseTest for MockBukkit setup
  • Mock YamlDocument via FileManager for config value resolution
  • Use @Nested + @DisplayName grouping by method under test
  • Follow action_outcome_whenCondition method naming convention

Coverage target: Mining ability classes (ExtraOre, ItsATriple) previously had 0% test coverage. These 24 tests bring them in line with the existing swords ability test coverage.

Test plan

  • All 24 new tests pass
  • Full test suite passes (./gradlew verifiedShadowJar — BUILD SUCCESSFUL)
  • Testing audit persona (review-testing) returned CLEAN — no findings

🤖 Generated with Claude Code

https://claude.ai/code/session_01PLknRfBuvUWEpfLYbjd9Yb


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Added automated coverage for mining abilities, including activation chance calculations, tier handling, multiplier behavior, fallback values, and configuration access.
    • Added validation for ability metadata, supported block types, reloadable content, and applicable attributes.

Add ExtraOreTest (13 tests) covering activation chance formula evaluation,
multiplier map operations, reloadable content, and metadata accessors.
Add ItsATripleTest (11 tests) covering tier-based activation chance with
formula evaluation, tier-specific route preference, and metadata accessors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PLknRfBuvUWEpfLYbjd9Yb
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Claude finished @DiamondDagger590's task in 1m 8s —— View job


Reviewing PR #361

  • Gather context (PR diff, changed files)
  • Route to review lenses — test-only PR (2 new test files, no src/main or config changes), so only review-testing applies
  • Run review-testing persona
  • Consolidate findings
  • Post final review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Advanced

Run ID: 88fcaa9a-f24d-46ee-b616-98ec2642feb6

📥 Commits

Reviewing files that changed from the base of the PR and between cc181c0 and 4af3948.

📒 Files selected for processing (2)
  • src/test/java/us/eunoians/mcrpg/ability/impl/mining/ExtraOreTest.java
  • src/test/java/us/eunoians/mcrpg/ability/impl/mining/ItsATripleTest.java

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Mining ability tests

Layer / File(s) Summary
ExtraOre behavior and metadata
src/test/java/us/eunoians/mcrpg/ability/impl/mining/ExtraOreTest.java
Adds tests for activation equations, missing skill data, multipliers, reloadable content, valid block types, and metadata accessors.
ItsATriple calculations and metadata
src/test/java/us/eunoians/mcrpg/ability/impl/mining/ItsATripleTest.java
Adds tests for tier-specific configuration routes, fallback routes, formula evaluation, literal values, and metadata accessors.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 4af39

This change adds focused tests without modifying production behavior, and no actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the addition of unit tests for the two mining abilities changed in this pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/magical-cray-j2syvz

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

2 participants