Skip to content

refactor(playerbots): run goals tests through the Package test root - #74

Merged
Mathih13 merged 3 commits into
mainfrom
feat/package-test-surface
Oct 7, 2026
Merged

Mathih13 merged 3 commits into
mainfrom
feat/package-test-surface

Conversation

@Mathih13

@Mathih13 Mathih13 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

The playerbots goals tests reached Core internals through three package-api: exempt lines. They ran a shipped Runtime Script offline through runtime_script and scanned source through test_scan. LyraCoreProject/LyraCore#629 adds crate::package_test, a test-only Package API root for both.

This PR moves the test module out of goals.rs into goals/tests.rs. The new file starts with #![cfg(test)], the gate the lint requires for the root. The tests now call package_test::ask_offline and the scan helpers, and playerbots has no exemption that names runtime_script or test_scan. The production code in goals.rs is byte-identical. Only the inline module became #[cfg(test)]\nmod tests;.

goals.rs is pinned for the Legacy policy comparison. A new pin commit cannot work here, because the squash merge creates a new commit and the branch commit never reaches main. So the pin keeps its commit 50e2cd1 and blob e72a7f9, which are on main. The check now requires the current goals.rs to equal that committed source with its one inline test module replaced by the declaration, and it fails if that module is missing, repeated, or not at the end of the file. The pinned expressions still hold.

The workflows pin Core at the #629 head. Baseline jobs keep their old Core pins.

Pair: LyraCoreProject/LyraCore#629. Merge Core first, then this PR.

Checks run locally against the Core branch: the 85 goals tests pass, and three deliberate breaks made four of them fail before I reverted them. The pin transform reproduces the new goals.rs exactly.

Claude Opus 5.5 made this change in Claude Code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Expanded automated coverage for companion goal selection, movement, quests, combat, loot, party behavior, and character recovery.
    • Added checks for quest timing, invitation rules, and other companion behaviors.
  • Maintenance

    • Updated build and validation workflows to use a newer core revision.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 089f83c8-46e2-4967-b841-53e91e28c373
📥 Commits

Reviewing files that changed from the base of the PR and between 9391e3e and aa9191b.

📒 Files selected for processing (7)
  • .github/workflows/core-tip.yml
  • .github/workflows/playerbots-capacity.yml
  • .github/workflows/playerbots-class-behavior.yml
  • .github/workflows/playerbots-target-claims.yml
  • playerbots/src/goals.rs
  • playerbots/src/goals/tests.rs
  • playerbots/testsuite/tests/playerbots_companion.rs

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


📝 Walkthrough

Walkthrough

Workflow jobs now pin LyraCore to a newer revision. Goal tests moved to a separate module, and the legacy-source comparison now accounts for that separation.

Changes

LyraCore Checkout Pin

Layer / File(s) Summary
Update LyraCore checkout refs
.github/workflows/core-tip.yml, .github/workflows/playerbots-*.yml
The listed workflow jobs now check out LyraCore at revision 7399e78c2e838f8ecba3fe8bd0700d475df69c8b instead of the previous pinned revision.

Goal Test Extraction

Layer / File(s) Summary
Separate goal tests and preserve source comparison
playerbots/src/goals.rs, playerbots/src/goals/tests.rs, playerbots/testsuite/tests/playerbots_companion.rs
The inline goal tests were replaced by a module declaration, with tests and fixtures in a separate file. The companion test compares production source with the legacy source after replacing its trailing inline test module with that declaration.

Priority: ⬇️ Low

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

Change: Refactor

Suggested reviewers: perpersen

Merge Risk: ⚪ Minimal · up to aa919

This PR moves the goals tests to their own file and updates the Core pin used by CI. It does not change production behavior. Core PR #629 should merge first, as the author noted.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: moving the playerbots goals tests to the Package test root.
Docstring Coverage ✅ Passed Docstring coverage is 95.65% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 92 functions across 3 files. (4 skipped: 4 …
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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

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

@Mathih13 Mathih13 removed the full-ci Run the playerbots durable and acceptance suites label Oct 7, 2026
Mathih13 and others added 3 commits October 7, 2026 23:19
The goals tests reached runtime_script and test_scan through three
package-api exemptions. They now live in goals/tests.rs, gated on
#![cfg(test)], and use crate::package_test for the offline Runtime
Script run and the source scans.

goals.rs keeps its production code byte-identical. The Legacy pin keeps
its commit and blob, and now checks that goals.rs equals that committed
source with the inline test module replaced by its declaration.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Mathih13
Mathih13 force-pushed the feat/package-test-surface branch from d5dda16 to aa9191b Compare October 7, 2026 21:19
@Mathih13
Mathih13 merged commit 4b118da into main Oct 7, 2026
18 checks passed
@Mathih13
Mathih13 deleted the feat/package-test-surface branch October 7, 2026 21:22
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