-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
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 runshamoo 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.
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-clipnpm 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 checkAdditional release contract validation requires a matching Runtime checkout:
SHAMOO_RUNTIME_ROOT=/absolute/path/to/ShamooRuntime pnpm contract:checkThis 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.
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:verifyVelocityApiCoveragecheck 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 velocityProcessIntegrationRun 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.
- Verify all checksums and attestations before install.
- Start a clean exact-version Paper or Velocity fixture with only the matching Runtime JAR.
- Confirm the Runtime version, protocol, and generated event count in startup logs.
- Deploy a minimal installation to the watched root and verify load, enable, ready, command/event behavior, drain, disable, and unload.
- Change one source file under
shamoo dev, verify one replacement generation, and confirm old commands/listeners are removed. - Test denied permissions and malformed descriptors as well as the happy path.
- Stop the server cleanly and retain logs and the exact artifact hashes.
Sources: ShamooTS scripts, Runtime process tests, and CI workflow.