Skip to content

Testing

Andrew R. edited this page Jul 24, 2026 · 1 revision

Testing

Plugin projects

Keep fast TypeScript contract tests separate from live-host validation:

pnpm exec tsc --project tsconfig.json --pretty false
pnpm exec shamoo doctor
pnpm exec shamoo build
pnpm exec vitest run

shamoo doctor validates project configuration and development paths; it does not start a server or prove Runtime compatibility. shamoo build is important in CI because it runs compiler discovery, permission diagnostics, platform-reachability checks, metadata generation, and bundling.

Use @shamoo/testing to create deterministic platform descriptors for contract tests. It does not simulate Paper, Velocity, Bukkit threading, Folia region ownership, commands, networking, or JVM objects. Compose Container, LifecycleExecutor, communication registries, and invocation helpers directly, as shown in the testing example.

ShamooTS repository

From an exact source checkout:

corepack enable
pnpm install --frozen-lockfile
pnpm check
pnpm codegen:check
pnpm run docs
pnpm test:coverage
pnpm test:packed-cli

pnpm check runs formatting, lint, generated-code drift, typechecking, Vitest, all package builds, package-manifest validation, and API extraction. The generated declarations are large; use:

NODE_OPTIONS=--max-old-space-size=8192 pnpm check

Additional release contract validation requires a matching Runtime checkout:

SHAMOO_RUNTIME_ROOT=/absolute/path/to/ShamooRuntime pnpm contract:check

This verifies synchronized package/tool versions, Runtime base/tag compatibility, manifest fixture, and protocol constants. pnpm codegen:check independently diffs Paper stable, Paper NMS, Paper packets, and Velocity generated trees against pinned models.

ShamooRuntime repository

Use the checked-in Gradle wrapper and Java 21:

./gradlew build
./gradlew check
./gradlew :runtime-codegen-support:diffPlatformApis
./gradlew :runtime-codegen-support:verifyPaperApiCoverage
./gradlew :runtime-codegen-support:verifyVelocityApiCoverage

check includes tests and configured Checkstyle, PMD, and SpotBugs verification. The generated coverage tasks independently rescan pinned APIs and require 100% declaration/member/event/exception inventory coverage.

Full host process tests download and start exact server artifacts:

./gradlew paperProcessIntegration
./gradlew velocityProcessIntegration

Run these on Linux x86-64 with Java 21 and sufficient network/disk resources. They validate each platform independently. They do not run a combined authenticated Paper-to-Velocity player transport.

Release-candidate smoke test

  1. Verify all checksums and attestations before install.
  2. Start a clean exact-version Paper or Velocity fixture with only the matching Runtime JAR.
  3. Confirm the Runtime version, protocol, and generated event count in startup logs.
  4. Deploy a minimal installation to the watched root and verify load, enable, ready, command/event behavior, drain, disable, and unload.
  5. Change one source file under shamoo dev, verify one replacement generation, and confirm old commands/listeners are removed.
  6. Test denied permissions and malformed descriptors as well as the happy path.
  7. Stop the server cleanly and retain logs and the exact artifact hashes.

Sources: ShamooTS scripts, Runtime process tests, and CI workflow.

Clone this wiki locally