Skip to content

Add regression coverage for packager validation paths#5

Draft
cursor[bot] wants to merge 3 commits into
masterfrom
cursor/regression-test-coverage-c5d6
Draft

Add regression coverage for packager validation paths#5
cursor[bot] wants to merge 3 commits into
masterfrom
cursor/regression-test-coverage-c5d6

Conversation

@cursor

@cursor cursor Bot commented May 22, 2026

Copy link
Copy Markdown

Summary

  • Added focused JUnit coverage for commit descriptor validation in PluginTest:
    • non-GitHub repository clone URLs are rejected with actionable help text
    • misspelled/unknown descriptor keys fail fast with file-line context
    • disabled= and unavailable= descriptors preserve their different unavailable-manifest semantics
  • Added UploadConfigurationTest coverage for recursive WebDAV MKCOL behavior when a child directory returns 409 before its parent exists.

Risky Behavior Now Covered

  • Plugin descriptor parsing gates every plugin build; URL validation and typo rejection prevent silently accepting invalid or misspelled metadata.
  • Disabled vs unavailable descriptors control whether broken plugins are only skipped during packaging or also surfaced in unavailable metadata.
  • Upload directory creation must create missing parent directories before retrying child paths, or package uploads can fail during publication.

Test Files Added/Updated

  • package/package/src/test/java/net/runelite/pluginhub/packager/PluginTest.java
  • package/upload/src/test/java/net/runelite/pluginhub/uploader/UploadConfigurationTest.java

Why This Reduces Regression Risk

  • These tests cover high-blast-radius validation and upload code paths rather than low-signal plugin manifest hash updates.
  • The assertions exercise real constructor and HTTP client behavior with existing JUnit/MockWebServer conventions.
  • Mutation checks confirmed the new tests fail if unknown descriptor keys are accepted or 409 parent-directory recovery is disabled.

Validation

  • ./gradlew prep succeeded.
  • Targeted tests passed:
    • ./gradlew :package:test --tests net.runelite.pluginhub.packager.PluginTest.testRepositoryMustBeGithubCloneUrl --tests net.runelite.pluginhub.packager.PluginTest.testUnexpectedCommitDescriptorKeyFailsFast --tests net.runelite.pluginhub.packager.PluginTest.testDisabledCommitDescriptorIsExcludedFromUnavailable --tests net.runelite.pluginhub.packager.PluginTest.testUnavailableCommitDescriptorIsIncludedInUnavailable :upload:test --tests net.runelite.pluginhub.uploader.UploadConfigurationTest
  • Mutation checks failed as expected, then passed after restoring production files.
  • Note: running the full PluginTest class still hits pre-existing generated example-plugin compile failures unrelated to these new constructor-level tests.
Open in Web View Automation 

Tunatroll and others added 3 commits March 7, 2026 09:30
Added grand-flip-out plugin with repository details and warning.
Co-authored-by: Tunatroll <Tunatroll@users.noreply.github.com>
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