Decision Tree β Scripts
| Need | Choice | Script (MANDATORY when chosen) |
|---|---|---|
| Pure logic / no tree | Unit | basic_unit_test.gd, mock_dependency_test.gd, test_data_factory.gd |
| Node interaction after instantiate | Scene integration | scene_integration_test.gd, integration_test_base.gd |
| Signal contracts | Unit or scene | signal_emission_test.gd |
| Multi-frame / physics step | Async scene | wait_for_frame_test.gd, physics_collision_test.gd |
| Flaky physics / timing races | Frame step gate | MANDATORY wait_for_frame_test.gd β never wall-clock sleep |
| CI / no display | Headless gate | MANDATORY headless_test_runner.gd |
| Save/UI regression | Snapshot | MANDATORY snapshot_tester.gd |
| RPC without live peers | Mock network | MANDATORY mock_network_provider.gd |
| Perf budget in CI | Benchmark gate | performance_benchmark_runner.gd |
| Orphans after suite | Leak detect | memory_leak_detector.gd |
| Edge input space | Fuzz | parameter_fuzz_tester.gd |
Do NOT Load assert-catalog tutorials or manual gameplay checklists into context β pick a row, read the script, implement.
MANDATORY Triggers
- CI /
--headless: always read headless_test_runner.gd first (OS.exit_code, GdUnit4 CLI:godot --headless -s addons/gdUnit4/bin/GdUnitCmdTool.gd -a res://test). - State or visual golden files: read snapshot_tester.gd before writing JSON/image goldens. Approve workflow: first run saves reference; intentional UI change β delete or overwrite
res://tests/snapshots/<name>.png, re-run to regenerate, commit new golden; never hand-edit PNG bytes. - Any RPC / MultiplayerSynchronizer test: read mock_network_provider.gd before standing up real peers.
Available Scripts
basic_unit_test.gd
Minimal GdUnit4 (GdUnitTestSuite) structure for pure logic.
signal_emission_test.gd
Signal emission monitoring for decoupled architectures.
mock_dependency_test.gd
Mocks/doubles to isolate external services.
scene_integration_test.gd / integration_test_base.gd
Scene lifecycle + node interaction fixtures.
headless_test_runner.gd
CI headless orchestration and exit codes.
snapshot_tester.gd
Dictionary/UI golden snapshot comparison.
mock_network_provider.gd
Loopback / offline multiplayer peer for RPC tests.
performance_benchmark_runner.gd
Microsecond timers + Performance monitor gates.
memory_leak_detector.gd
Orphan node detection across long suites.
parameter_fuzz_tester.gd
Randomized ranges for edge crashes.
wait_for_frame_test.gd / physics_collision_test.gd
Frame/physics-step async verification.
test_data_factory.gd
Schema-compliant fixture builders.
NEVER Do in Testing (GdUnit4)
- NEVER test private implementation details β Assert public behavior only.
- NEVER share mutable state between tests β Fresh setup per test (
before_test/ equivalent). - NEVER use wall-clock
sleep/ blind timers β Prefer frame steppers from wait_for_frame patterns. - NEVER skip cleanup β Free instantiated nodes after each test.
- NEVER test randomness without seeding.
- NEVER assert signals without the GdUnit signal assert/monitor helpers from signal_emission_test.gd.
- NEVER mix GUT and GdUnit4 APIs in one suite.
- NEVER rely on editor-only features for CI β Headless-compatible tests only.
- NEVER default to full-level integration tests β Prefer unit + small scene tests; escalate only when the decision tree says so.
- NEVER hardcode brittle absolute file paths in fixtures.
- NEVER test third-party plugin internals β Test your integration only.
Expert Gates (short)
- Snapshot: serialize β compare golden (snapshot_tester.gd); regenerate reference PNG on approved visual changes.
- CI:
--headless+OS.exit_codenon-zero on failure (headless_test_runner.gd). - Network: mock peer before real ENet (
mock_network_provider.gd). - Perf:
Performancemonitors / draw-call caps in benchmark runner.
Deep recipes (on demand)
LLM-ignorance rule: if a general agent would not know it before reading, it lives here or in
scripts/β never delete, only move.
| Topic | Reference |
|---|---|
| Snapshot / CI / fuzz / perf | expert-testing-patterns.md |
| Release smoke checklist | manual-testing-checklist.md |
Reference
Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain β do not preload the whole lattice.
Official Documentation
- Command line tutorial β
--headless,-s, and exit-code patterns for CI test runners. - Overview of debugging tools β debugger, profiler, and remote inspect when a failing test needs engine-side diagnosis.
- Custom performance monitors β
Performancemonitors and custom metrics for benchmark gates and orphan detection. - Idle and physics processing β frame/
_physics_processtiming thatwait_frames/ yield helpers must respect. - Using SceneTree β tree lifecycle,
quit(), and process modes used by headless orchestrators. - Nodes and scene instances β instantiate/add_child/free hygiene for scene integration tests.
- Instancing with signals β signal wiring patterns that signal-emission tests verify.
- High-level multiplayer β RPC/peer APIs mocked via OfflineMultiplayerPeer or latency simulators.
- Using InputEvent β synthetic
InputEvent*injection for fuzz and UI interaction tests. - Random number generation β seeding for deterministic fuzz and Monte Carlo harnesses.
- Saving games β serialize/deserialize patterns behind golden JSON and save/load integration tests.
- Physics introduction β layers/masks and step timing for collision integration tests.
Related Skills
Prerequisites
- godot-project-foundations β project layout, scenes, and resources before standing up a
res://test/suite. - godot-gdscript-mastery β typed GDScript,
await, and assert idioms used in every unit/integration test. - godot-signal-architecture β emit/connect contracts that
watch_signals/ signal monitors assert against.
Complements
- godot-debugging-profiling β profiler and ObjectDB tools when a red test needs runtime evidence, not another assert.
- godot-scene-management β scene packing/load patterns mirrored in scene integration fixtures.
- godot-input-handling β action maps and event parsing exercised by fuzz and UI press tests.
- godot-2d-physics β layer matrices and body APIs that physics collision tests must keep green.
- godot-resource-data-patterns β Resource schemas that test data factories and snapshot dictionaries serialize.
- godot-save-load-systems β persistence pipelines covered by save/load integration and golden-state tests.
Downstream / consumers
- godot-monte-carlo-balancer β seeded headless gameplay sims that reuse these harnesses for Phase 7 golden cells.
- godot-performance-optimization β budgets that CI performance gates (
Performancemonitors, draw-call caps) enforce. - godot-multiplayer-networking β RPC/replication logic validated through mock peers and lag injection.
- godot-export-builds β headless export/CI pipelines that invoke the same
--headlesstest entrypoints.
Master
- godot-master β library router and mirrored module entry for cross-skill discovery.