Skip to content

Standardize test packages - #367

Merged
BenCodez merged 1 commit into
masterfrom
refactor/standardize-test-packages
Oct 16, 2026
Merged

BenCodez merged 1 commit into
masterfrom
refactor/standardize-test-packages

Conversation

@BenCodez

@BenCodez BenCodez commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Move the remaining test classes under com.bencodez.advancedcore.tests and document the convention. Narrow test-only accessors preserve the existing implementation checks without changing production APIs or assertions.

Validation: clean package build; 1,296 unit tests and the packaged-artifact test passed; fresh shaded JAR excludes test classes; independent read-only review found no actionable issues.

Summary by CodeRabbit

  • Tests
    • Organized test classes under dedicated test packages while leaving application code visibility unchanged.
    • Updated tests to access internal functionality through narrowly scoped test helpers, preserving existing scenarios and assertions.
    • Retained test discovery and build artifact checks.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 8c2faecd-b7f8-4af4-9c5d-0c14da5748a5
📥 Commits

Reviewing files that changed from the base of the PR and between fdd1832 and d83e23e.

📒 Files selected for processing: 38
  • AGENTS.md
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/AdvancedCoreUuidTabCompletionRefreshTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/command/PlayerCommandHandlerTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/javascript/JavascriptEngineConcurrencyTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/javascript/JavascriptPlaceholderBinderTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/javascript/JavascriptSecurityFindingRegressionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/javascript/JavascriptTextTemplateTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/messages/PlaceholderUtilsJavascriptBoundaryTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/misc/PlayerManagerDamageItemTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/permissions/PermissionAccess.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/permissions/PlayerPermissionHandlerThreadingTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/rewards/RewardOptionsTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/time/TimeCheckerRecurringTaskTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/user/presence/CompleteOnlinePresenceTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/user/presence/PlayerHistoryStabilityTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/user/presence/PlayerPresenceBatchScanTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/user/presence/PresenceLookupAccess.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/user/userstorage/mysql/MySQLInitializationTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/build/BuildInputPinningTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/command/CommandLoaderBulkPermissionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/command/gui/UserGUITest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/JdbcDuplicateCanonicalColumnTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/JdbcPostgresBitBooleanTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/JdbcReviewRegressionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/JdbcSqlUserStorageDialectTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/JdbcSqlUserStorageWriteOutcomeTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/JdbcStorageAccess.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/MysqlBackendReviewRegressionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/MysqlBorrowedSchemaReconciliationTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/MysqlConcurrentSchemaTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/MysqlUserBackendAdmissionRaceTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/MysqlUserBackendLifecycleReviewTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/MysqlUserBackendSchemaExpansionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/MysqlUserBackendUuidMigrationTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/SqlUserSchemaDuplicateColumnTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/SqlUserSchemaReservedColumnTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/listeners/PlayerJoinEventSessionTest.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/support/ReflectiveAccess.java

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

📜 Recent review details
⏰ Context from checks skipped due to timeout: 3
  • GitHub Check: build
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (java-kotlin)
🧰 Additional context used
🧠 Learnings: 1
📓 Common learnings
Learnt from: CR
Repo: BenCodez/AdvancedCore

Timestamp: 2026-10-16T18:21:29.789Z
Learning: Source excerpt:
# Maintainer and AI-agent guide

## Build and verification

All test classes and test-only helpers must live under `com.bencodez.advancedcore.tests` or its subpackages, with matching directories under `AdvancedCore/src/test/java`. Keep tests out of production packages. Preserve production visibility when relocating tests; use narrowly scoped test-only reflective helpers when package-private access is required. Preserve test discovery and the package-phase artifact tests.
🪛 ast-grep (0.45.3)
AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/support/ReflectiveAccess.java

[warning] 10-10: Avoid user-generated class names for reflection
Context: Class.forName(name)
Note: [CWE-470] Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').

(unsafe-reflection-java)

📝 Walkthrough

Test classes and test-only helpers move under the designated tests package. Tests that need access to non-public production members use reflective helpers or factories. Existing test scenarios and assertions remain unchanged, and production visibility is not changed.

Changes: Test package isolation

Layer / File(s) Summary
Test package boundary and shared reflection support
AGENTS.md, AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/support/ReflectiveAccess.java, AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/...
The repository guidance specifies the test package and visibility requirements. ReflectiveAccess adds test-only class loading, construction, and method invocation. Package-only test moves add explicit production imports.
Reflective access in API and command tests
AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/AdvancedCoreUuidTabCompletionRefreshTest.java, AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/..., AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/command/...
Tests move out of production packages and use reflection for non-public methods and fields. Permission tests use typed test accessors. Existing scenarios and assertions remain.
Presence lookup test construction
AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/api/user/presence/*
Presence tests use PresenceLookupAccess to construct lookups with public construction or injected readers. Existing scenarios and assertions remain.
JDBC storage test construction
AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/core/user/storage/sql/*
JDBC tests use JdbcStorageAccess to construct storage instances and access dialects. SQL tests add explicit imports for production types. Existing test expectations remain.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to d83e2

The test-package relocation has no identified merge-blocking issue. Proceed with normal build and test checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 142 functions across 37 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: standardizing test package locations.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 142 functions across 37 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

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

@BenCodez
BenCodez marked this pull request as ready for review October 16, 2026 19:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T19:07:50.626018Z d83e23e Draft marked ready
🔒 Security Review ✅ Completed 2026-10-16T19:08:01.463668Z d83e23e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@BenCodez
BenCodez merged commit a7a1a25 into master Oct 16, 2026
6 checks passed
@BenCodez
BenCodez deleted the refactor/standardize-test-packages branch October 16, 2026 19:09
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