Skip to content

test: blank campaign templates in the schedule lifecycle test - #245

Merged
XxFran10xX merged 1 commit into
mainfrom
test/campaign-schedule-template-isolation
Nov 12, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
test/campaign-schedule-template-isolation

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Problem

After #244 merged, main's build (first attempt) and the v4.32.2 release run (twice) failed on one test, while #244's own PR build passed on the same tree:

CampaignScheduleLifecycleCoverageTest.explicitSchedulingPreparesOneRealBattleAndBlocksMissingOrUndecidedTargets:683
  » IllegalArgument Unknown battle template: field_default

The test loads no battle templates and only passes while Cache.battleCampaignTemplateField / Siege are still blank, as they are in a fresh JVM. A test that ran the config loader earlier in the same JVM leaves them set (field_default, or custom_field from ConfigLoaderBattleTemplateDefaultsTest), and BattleFactory.applyCampaignDefault then throws. Test order differs between runners, so this failed on some runs and not on others.

Fix (test only)

The test now remembers both fields (restored after each test, like its other Cache fields) and blanks them, the same as CampaignBattleBoundaryCoverageTest already does. No plugin code changes.

Check

Locally, -Dsurefire.runOrder=alphabetical -Dtest=ConfigLoaderBattleTemplateDefaultsTest,PluginLifecycleCoverageTest,CampaignScheduleLifecycleCoverageTest:

  • before: Unknown battle template: custom_field (the CI failure)
  • after: 33/33 pass

🤖 Generated with Claude Code

CampaignScheduleLifecycleCoverageTest loads no battle templates and only
passed while Cache.battleCampaignTemplateField/Siege were still blank.
A test that ran the config loader earlier in the same JVM (for example
ConfigLoaderBattleTemplateDefaultsTest) leaves them set, and scheduling
then failed with "Unknown battle template". Test order differs between
CI runners, so main's build and the v4.32.2 release failed on it while
the PR build passed. Remember and blank both, as
CampaignBattleBoundaryCoverageTest already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86e4c9cf-328e-4b7a-9aa2-5a5e5fcf2151
Commits

Reviewing files that changed from the base of the PR and between 830c4b3 and 3e430cc.

Files selected for processing: 1

  • src/test/java/net/tfminecraft/simplefactions/war/campaign/schedule/CampaignScheduleLifecycleCoverageTest.java
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added the size:XS 0-9 effective changed lines (tests excluded in mixed PRs). label Nov 12, 2026
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit 0f4fd58 into main Nov 12, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the test/campaign-schedule-template-isolation branch November 12, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant