Godot testing patterns

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot testing patterns is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. 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

How to use this skill

Skill file

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

Available Scripts

[basic_unit_test.gd](scripts/basic_unit_test.gd)

Minimal GdUnit4 (GdUnitTestSuite) structure for pure logic.

[signal_emission_test.gd](scripts/signal_emission_test.gd)

Signal emission monitoring for decoupled architectures.

[mock_dependency_test.gd](scripts/mock_dependency_test.gd)

Mocks/doubles to isolate external services.

[scene_integration_test.gd](scripts/scene_integration_test.gd) / [integration_test_base.gd](scripts/integration_test_base.gd)

Scene lifecycle + node interaction fixtures.

[headless_test_runner.gd](scripts/headless_test_runner.gd)

CI headless orchestration and exit codes.

[snapshot_tester.gd](scripts/snapshot_tester.gd)

Dictionary/UI golden snapshot comparison.

[mock_network_provider.gd](scripts/mock_network_provider.gd)

Loopback / offline multiplayer peer for RPC tests.

[performance_benchmark_runner.gd](scripts/performance_benchmark_runner.gd)

Microsecond timers + Performance monitor gates.

[memory_leak_detector.gd](scripts/memory_leak_detector.gd)

Orphan node detection across long suites.

[parameter_fuzz_tester.gd](scripts/parameter_fuzz_tester.gd)

Randomized ranges for edge crashes.

[wait_for_frame_test.gd](scripts/wait_for_frame_test.gd) / [physics_collision_test.gd](scripts/physics_collision_test.gd)

Frame/physics-step async verification.

[test_data_factory.gd](scripts/test_data_factory.gd)

Schema-compliant fixture builders.

NEVER Do in Testing (GdUnit4)

Expert Gates (short)

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

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.