EnderCloud
Integrate and develop

Test reference

Validation commands and coverage for the orchestrator, plugins, dashboard, and deployment.

Run tests from the package directory shown below. The repository does not have one root test command because Bun and Gradle manage separate dependency graphs.

Test matrix

AreaCommandDocker requiredMain coverage
Orchestrator static checkbun run typecheckNoTypeScript contracts and imports
Orchestrator unitbun run test:unitNoDomain rules, configuration, API, scheduler, logger, executors, and startup policy
Orchestrator integrationbun run test:integrationYes by defaultPostgreSQL transactions, controllers, workers, incidents, and simulations
Java pluginsGradle build and check tasksNoJSON fixtures, client contracts, and Velocity endpoint parsing
Dashboard static checksbun run lint and bun run typecheckNoESLint, React, Next.js, and TypeScript
Dashboard unitbun testNoData shaping, clock, timeline, topology, monitoring, mock data, and route behavior
Dashboard end to endbun run test:e2eNoBuilt dashboard in desktop and mobile Chromium using synthetic data
Deployment smokeTwo-agent Compose stackYesOrchestrator-to-agent HTTP path, ownership labels, placement, and port ranges

Install dependencies

Install each dependency set once:

cd orchestrator
bun install --frozen-lockfile

cd ../dashboard
bun install --frozen-lockfile

cd ../plugins
.\gradlew.bat help

On Linux or macOS, use ./gradlew.

Orchestrator checks

Run the fast checks from orchestrator/:

bun run typecheck
bun run test:unit

These commands do not start Docker.

The integration suite uses Testcontainers to start a disposable PostgreSQL server:

bun run test:integration

Docker Desktop or another Testcontainers-compatible runtime must be available. If native Windows socket discovery fails, run the suite from WSL with Docker integration enabled.

bun test runs both unit and integration directories:

bun test

It therefore needs Docker unless TEST_DATABASE_URL points to a reachable dedicated test database. Never point that variable at a production or shared development database.

Generate Bun's coverage report with:

bun run test:coverage

Java plugin checks

From plugins/, run:

.\gradlew.bat :core:build :paper:check :velocity:check :paper:shadowJar :velocity:shadowJar

This command compiles for Java 25, runs JUnit tests, validates the Paper and Velocity modules, and produces all three documented JARs.

The shared fixture test reads contracts/fixtures/ through the Gradle endercloud.contracts.dir system property. Keep fixture changes compatible with the TypeScript and Java representations.

The Paper and Velocity shaded JARs are under their module build/libs/ directories. Core produces the compile-time client and API JAR.

Use ./gradlew with the same tasks on Linux or macOS.

Dashboard checks

Run these commands from dashboard/:

bun run lint
bun run typecheck
bun test
bun run build

Unit tests do not require the orchestrator. Route tests enable synthetic data or mock their upstream boundary.

Install Chromium once, then run the browser suite:

npx playwright install chromium
bun run test:e2e

Playwright builds the dashboard and starts it on port 3100 with DASHBOARD_MOCK_DATA=true. The suite covers desktop Chromium and a mobile viewport.

If port 3100 is already in use, stop the conflicting process before rerunning the suite.

Full local validation

From the repository root, the complete Windows sequence is:

cd orchestrator
bun run typecheck
bun run test:unit
bun run test:integration

cd ../plugins
.\gradlew.bat :core:build :paper:check :velocity:check :paper:shadowJar :velocity:shadowJar

cd ../dashboard
bun run lint
bun run typecheck
bun test
bun run build
bun run test:e2e

Run independent package checks in separate terminals when you want faster feedback. Do not run multiple integration suites against the same TEST_DATABASE_URL unless that database is isolated per process.

Compose validation

After changing a Compose file or environment example, validate interpolation without starting services:

docker compose config --quiet
docker compose --env-file .env.agent -f compose.agent.yml config --quiet

These commands still require every variable marked as required. Create local environment files from the supplied examples and replace placeholder paths first.

Two-agent deployment smoke test

compose.multi-host.test.yml adds a second agent to the root stack while both agents share the local Docker daemon. Configure these values in .env:

SECONDARY_AGENT_GAME_ADDRESS=192.0.2.11
SECONDARY_AGENT_CPU=4
SECONDARY_AGENT_MEMORY_BYTES=8589934592
SECONDARY_RUNTIME_HOST_ROOT=/absolute/path/to/EnderCloud/runtime-secondary

Start the combined stack:

docker compose -f compose.yml -f compose.multi-host.test.yml up --build

Check that both hosts become ONLINE, instances receive the expected host IDs, their published ports come from separate ranges, and the dashboard can drain and reactivate the secondary host.

Stop the exact same file set after the test:

docker compose -f compose.yml -f compose.multi-host.test.yml down

This is a local control-path test. It does not validate routing or firewalls between physical hosts. See Multi-host execution for that procedure.

What to run for common changes

ChangeMinimum checks before full validation
Pure domain ruleOrchestrator typecheck and focused unit test
Database schema or transactionOrchestrator unit and integration suites
Agent Docker behaviorExecutor unit tests and two-agent smoke test
HTTP contractOrchestrator API and contract tests, Java core build, affected dashboard tests
Paper or Velocity codeRelevant Gradle module check plus core build
Dashboard componentDashboard lint, typecheck, focused unit test, and affected Playwright path
Group or template configurationOrchestrator configuration tests and a real startup synchronization
Environment or Compose changeConfiguration unit tests and both Compose config checks
Documentation onlyMarkdown link check and review every command against current package scripts

On this page