Godot godottest
Skill LoogacyStudio/skills/plugins/godot-dotnet/skills/godot-godottest
Use when a Godot/.NET task needs a Layer 4 overlay skill for GoDotTest-based C# testing, and the agent must write, run, debug, or collect coverage for suites, scene wiring, CLI invocation, VS Code debug configs, or coverage commands instead of guessing xUnit/NUnit patterns that do not apply inside Godot runtime.From its SKILL.md
npx -y skills add LoogacyStudio/skills --skill godot-godottestAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
12.1 KB, ~2.8k tokens by cl100k_base, as published. Nobody here has run it
Godot GoDotTest
Use this skill when a Godot 4.6 + .NET/C# project uses Chickensoft GoDotTest for in-engine testing.
GoDotTest is a C#-first test runner that executes inside the Godot process. It is not xUnit, NUnit, or MSTest. Tests extend TestClass, use GoDotTest-specific lifecycle attributes, run sequentially inside the scene tree, and are invoked via Godot command-line arguments. Getting this wrong produces tests that compile but silently never execute, or that crash because of wrong scene wiring.
Prefer this skill whenever the task involves writing, scaffolding, running, debugging, or collecting coverage for GoDotTest-based test suites.
Purpose
This skill is used to:
- write correct GoDotTest test classes with proper lifecycle attributes
- set up the test scene and main-scene redirection for running tests
- produce correct CLI commands for running tests, filtering suites, and collecting coverage
- generate VSCode launch/task configurations for debugging tests
- advise on assertion and mocking library choices compatible with GoDotTest
- guide
GodotTestDriverusage for integration or UI-style GoDotTest suites - separate what belongs in GoDotTest (runtime-dependent) from what can stay in pure .NET tests
- scaffold new test suites using the companion template
Use this skill when
Invoke this skill for tasks such as:
- adding a new GoDotTest test class or test suite
- setting up GoDotTest in a project for the first time
- writing tests that need the scene tree, node references, signals, or engine timing
- configuring VSCode or Visual Studio to debug GoDotTest runs
- running tests from the command line or CI/CD
- collecting code coverage via coverlet for GoDotTest runs
- deciding which tests belong in GoDotTest vs. pure .NET test projects
- troubleshooting tests that do not appear, do not run, or crash on startup
Trigger examples
- "Add a GoDotTest suite for this node"
- "Set up GoDotTest in my Godot project"
- "How do I debug GoDotTest tests in VSCode?"
- "Run only one test suite from the command line"
- "Collect coverage for my Godot C# tests"
- "My GoDotTest tests are not running"
Do not use this skill when
Do not use this skill when:
- the test can run as a pure .NET test with no Godot runtime dependency — use a standard test framework instead
- the user wants a test strategy review rather than implementation — use
test-strategy-review - the user wants to review scene architecture rather than test it — use
scene-architecture-review - the task is about xUnit, NUnit, MSTest, or other non-GoDotTest frameworks
- the user only needs assertion library recommendations without writing GoDotTest suites
Pattern
- Primary pattern: Tool Wrapper
- Secondary pattern: Generator
Why: the skill mainly packages GoDotTest conventions, lifecycle rules, setup patterns, CLI flags, and debugging/coverage guidance. The Generator secondary produces test suite scaffolds.
Companion files
references/godotest-quick-ref.md— distilled API reference: attributes, lifecycle order, CLI flags, project setup, coverage commands, and common pitfalls.assets/test-suite-scaffold.md— fill-in template for a new GoDotTest test class.assets/driver-scaffold.md— reusable template for customGodotTestDriverdrivers and GoDotTest integration-style test usage.
Inputs
Collect or infer these inputs when available:
| Input | Required | Description |
|---|---|---|
| What to test | Yes | The node, system, signal flow, or behavior under test |
| Project structure | Recommended | Whether tests live in the same project or a separate test project |
| Existing test scene | Recommended | Whether a test scene and main-scene redirect are already wired |
| Godot version | Recommended | Godot 4.x version (affects API surface) |
| GoDotTest version | Recommended | NuGet package version (latest is 2.0.x) |
| Assertion/mock library | Optional | Whether the project uses Shouldly, FluentAssertions, LightMock, LightMoq, GodotTestDriver, or others |
| Integration/UI coverage | Optional | Whether the suite needs fixtures, input simulation, node drivers, or wait helpers |
| Coverage requirement | Optional | Whether coverlet integration is needed |
| CI/CD target | Optional | Whether tests run headless in CI |
If the project has no GoDotTest setup yet, guide the full first-time setup before writing tests.
Workflow
1. Confirm GoDotTest is installed and wired
Check for:
Chickensoft.GoDotTestNuGet reference in the.csproj- a test scene (e.g.
test/Tests.tscn) with a root node script that callsGoTest.RunTests - main-scene redirection that checks
TestEnvironment.From(OS.GetCmdlineArgs())and branches into test mode when--run-testsis present
If any piece is missing, guide its creation before writing test classes. See references/godotest-quick-ref.md § Project setup.
2. Write or scaffold the test class
Use assets/test-suite-scaffold.md as the starting point.
Rules:
- extend
TestClass - accept
Node testScenein the constructor and pass it tobase(testScene) - use GoDotTest attributes only:
[Test],[Setup],[Cleanup],[SetupAll],[CleanupAll],[Failure] - do not use xUnit, NUnit, or MSTest attributes — they are ignored by GoDotTest
- tests run in declaration order, not alphabetically
- tests run sequentially — no parallelism
async Tasktests are awaited; synchronous tests returnvoid- add nodes to the scene tree via
testScene.AddChild(node)and clean them up in[Cleanup]or[CleanupAll] - nodes that never enter the scene tree must be freed with
Free(), notQueueFree()
3. Choose assertion, mocking, and integration tools
GoDotTest is a test runner only — it has no built-in assertions or mocks.
Recommended stack:
| Need | Recommended | Notes |
|---|---|---|
| Assertions | Shouldly or FluentAssertions | Any .NET assertion library works |
| Mocking | LightMock.Generator + LightMoq | Compile-time mock generation, safe in Godot runtime |
| Integration / UI | GodotTestDriver | Adds fixtures, node drivers, input simulation, and wait helpers for Godot runtime tests |
Do not recommend Moq — it uses runtime IL emit which can fail in Godot's .NET host.
If the suite is an integration or UI flow test and the project uses GodotTestDriver, guide these specifics explicitly:
- add a
Chickensoft.GodotTestDriverpackage reference together withusing Chickensoft.GodotTestDriver;,using Chickensoft.GodotTestDriver.Drivers;, andusing Chickensoft.GodotTestDriver.Util;when wait extensions such asWithinSecondsare used - remember
GodotTestDriveris not a test executor —GoDotTeststill owns suite discovery and execution - use
Fixtureto create, load, add, and clean up scenes or nodes safely on the main thread - call
await fixture.Cleanup()in afinallyblock or equivalent guaranteed cleanup path when the test allocates runtime objects - prefer built-in drivers like
ButtonDriver,LabelDriver,ControlDriver, or compose custom drivers around producer lambdas - producer functions should return
nullwhen a node is absent instead of throwing - after simulated input, use wait helpers such as
WithinSecondsorDuringSecondswhen state changes require more frames to process
See references/godotest-quick-ref.md for a ready-to-adapt GodotTestDriver example and validation checklist.
4. Configure run and debug
Provide or verify:
- CLI:
$GODOT --run-tests --quit-on-finishto run all suites - CLI filter:
$GODOT --run-tests=SuiteName --quit-on-finishfor one suite;--run-tests=SuiteName.MethodNamefor one method - VSCode launch.json:
Debug TestsandDebug Current Testconfigurations (see quick ref) - Visual Studio:
launchSettings.jsonin the test projectProperties/folder - Stop on error:
--stop-on-errorto halt at first failure - Sequential skip:
--sequentialto skip remaining methods after a failure within a suite
5. Collect coverage (when needed)
Guide coverlet setup:
coverlet \
"./.godot/mono/temp/bin/Debug" --verbosity detailed \
--target $GODOT \
--targetargs "--run-tests --coverage --quit-on-finish" \
--format "opencover" \
--output "./coverage/coverage.xml" \
--exclude-by-file "**/test/**/*.cs" \
--exclude-by-file "**/*Microsoft.NET.Test.Sdk.Program.cs" \
--exclude-by-file "**/Godot.SourceGenerators/**/*.cs" \
--exclude-assemblies-without-sources "missingall"
Key: the --coverage flag tells GoDotTest to force-exit the process so coverlet can capture data correctly. A few harmless error messages appear on exit — disregard them.
6. Exclude tests from release builds
Ensure the .csproj excludes test files from ExportRelease:
<PropertyGroup>
<DefaultItemExcludes Condition="'$(Configuration)' == 'ExportRelease'">
$(DefaultItemExcludes);test/**/*
</DefaultItemExcludes>
</PropertyGroup>
Adjust the glob if tests live in a different folder.
7. Validate
- Build succeeds with
dotnet build --no-restore - Tests appear in GoDotTest output when launched with
--run-tests - Specific suite filtering works with
--run-tests=SuiteName [Setup]/[Cleanup]run in the expected order around each test- Nodes added to the tree in tests are cleaned up
- Coverage report generates without empty results (if coverlet is used)
If the suite uses GodotTestDriver, also validate that:
Chickensoft.GodotTestDriveris referenced and the needed namespaces resolve (Chickensoft.GoDotTest,Chickensoft.GodotTestDriver,Chickensoft.GodotTestDriver.Drivers,Chickensoft.GodotTestDriver.Util)Fixturecleanup always runs, even when assertions fail- driver actions fail with actionable exceptions such as
InvalidOperationException, notNullReferenceException - simulated input plus
WithinSeconds/DuringSecondsproduces the expected state transition - any custom cleanup steps added through the fixture actually execute
Output contract
When this skill generates a test class, the output must include:
- the complete C# test class file
- any required scene or project setup steps that are missing
- the CLI command to run the new tests
- notes on which assertions/mocks are used and why
- fixture or driver setup notes when the suite uses
GodotTestDriver
When this skill guides first-time setup, the output must include:
- NuGet package reference to add
- test scene script
- main-scene redirect (if the project is a game, not a package)
.csprojexclude for release builds- VSCode launch/task configurations
Common pitfalls
- Using xUnit/NUnit attributes alongside GoDotTest — they are silently ignored.
- Forgetting to wire the test scene or main-scene redirect — tests compile but never execute.
- Using
QueueFree()on nodes that were never added to the tree — they leak becauseQueueFreerequires deferred scene-tree processing. - Expecting parallel test execution — GoDotTest is intentionally sequential to avoid race conditions in engine state.
- Missing
--coverageflag when running with coverlet — coverage capture fails silently. - Using
Moqinstead ofLightMock.Generator— runtime IL emit can fail in Godot's .NET host. - Test class name not matching the file name —
--run-tests=FileNamefilter breaks. - Forgetting
awaiton async test methods — test appears to pass instantly without actually running the async body. - Not increasing Godot network limits for logging — test output may be truncated.
- Treating
GodotTestDriveras the test runner — it only helps drive integration tests;GoDotTeststill executes the suite. - Clicking or typing with
GodotTestDriverand then asserting immediately when more frames are needed — use waiting helpers when behavior is asynchronous. - Writing producer lambdas that throw when the node is missing — drivers should handle absent nodes gracefully until used.
What ships with it: 3 files
18.7 KB alongside SKILL.md
assets/
- driver-scaffold.md2.7 KB
- test-suite-scaffold.md3.8 KB
references/
- godotest-quick-ref.md12.3 KB