thedivergentai/godot-testing-patterns
Expert testing decision trees for GdUnit4: unit vs scene vs CI gates, headless runners, snapshots, and mock networks. Use when choosing test layers, wiring CI, or validating signals/physics without beginner assert catalogs. Keywords: GdUnit4, GdUnitTestSuite, headless CI, snapshot test, mock network, scene integration test, TDD.
npx skills add https://github.com/thedivergentai/GD-Agentic-Skills --skill godot-testing-patterns
Framework: GdUnit4 only (extends GdUnitTestSuite). Do not mix GUT GutTest / watch_signals APIs in new tests.
| 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.
--headless: always read headless_test_runner.gd first (OS.exit_code, GdUnit4 CLI: godot --headless -s addons/gdUnit4/bin/GdUnitCmdTool.gd -a res://test).res://tests/snapshots/<name>.png, re-run to regenerate, commit new golden; never hand-edit PNG bytes.Minimal GdUnit4 (GdUnitTestSuite) structure for pure logic.
Signal emission monitoring for decoupled architectures.
Mocks/doubles to isolate external services.
Scene lifecycle + node interaction fixtures.
CI headless orchestration and exit codes.
Dictionary/UI golden snapshot comparison.
Loopback / offline multiplayer peer for RPC tests.
Microsecond timers + Performance monitor gates.
Orphan node detection across long suites.
Randomized ranges for edge crashes.
Frame/physics-step async verification.
Schema-compliant fixture builders.
before_test / equivalent).sleep / blind timers — Prefer frame steppers from wait_for_frame patterns.--headless + OS.exit_code non-zero on failure (headless_test_runner.gd).mock_network_provider.gd).Performance monitors / draw-call caps in benchmark runner.> 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 |
> 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.
--headless, -s, and exit-code patterns for CI test runners.Performance monitors and custom metrics for benchmark gates and orphan detection._physics_process timing that wait_frames / yield helpers must respect.quit(), and process modes used by headless orchestrators.InputEvent* injection for fuzz and UI interaction tests.res://test/ suite.await, and assert idioms used in every unit/integration test.watch_signals / signal monitors assert against.Performance monitors, draw-call caps) enforce.--headless test entrypoints.Take thedivergentai/godot-testing-patterns from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.