Skip to content

Conversation

@jsvd
Copy link

@jsvd jsvd commented Sep 11, 2025

Introduce MCP commands to run GUT unit and integration tests from the assistant. This enables fast, scriptable test runs for Godot projects and clearer feedback during development.

Adds tool definitions and handlers for:

  • running a single test file
  • running all tests in a directory
  • running all unit or integration tests

Unit tests run headless; integration tests use a display and default to a low-verbosity GUT log for readable output. Parameters are normalized and validated for safer execution.

Documentation in README describes usage, arguments, and macOS Godot auto-detection.


I've used this in a personal project, it is very helpful when coding with codex, because codex kept asking me to approve the execution of the Godot binary with the gut configuration, and this feature just makes gut testing seamless:

▌run unit tests and report back the status

> Running GUT unit tests headlessly now and will summarize results.

tool running...
godot.run_unit_tests_all({"projectPath":"/Users/arkham/project/game","includeSubdirs":true})

tool success, duration: 6.35s
godot.run_unit_tests_all({"projectPath":"/Users/arkham/project/game","includeSubdirs":true})

STDOUT:Godot Engine v4.4.1.stable.official.49a5bc7b6 - https://godotengine.orgGameData singleton initializedGame Manager initializedGame state changed from MENU to MENUWarning: Cannot load
main menu - no current sceneLoaded game settings - Fog enabled: trueGameSettings initializedNo language settings found, using default: enLocalization manager initialized with language:
enFont ...

> All unit tests finished. Here’s the summary.

  Summary

  - Scripts: 73
  - Tests: 545
  - Passing: 545 (100%)
  - Asserts: 5045
  - Time: 3.918s
  - Godot: 4.4.1, GUT: 9.4.0

  Notables

  - Warnings: 9 (e.g., float/int comparisons; various “could not find … monster node/visual node”; effect pool exhaustion).
  - Orphans: 82 total (9 during run); typical for headless/UI-heavy tests but worth tracking.
  - SCRIPT ERROR logged twice despite green run:
      - Invalid assignment to tiles on Resource (Dungeon) at res://test/unit/systems/test_multi_dungeon_fog_persistence.gd:51.

  Recommendations

  - Fix the tiles assignment in test_multi_dungeon_fog_persistence.gd (likely needs a proper setter or using the dungeon API instead of writing to a resource property).
  - Clean float/int comparisons by normalizing types in assertions.
  - Review/test hooks to reduce orphans and silence expected warnings (e.g., effect pools, missing UI overlays like SpellPreparationMenu).

  Want me to open that fog persistence test and implement the tiles fix now?

Introduce MCP commands to run GUT unit and integration tests from the assistant. This enables fast, scriptable test runs for Godot projects and clearer feedback during development.

Adds tool definitions and handlers for:
- running a single test file
- running all tests in a directory
- running all unit or integration tests

Unit tests run headless; integration tests use a display and default to a low-verbosity GUT log for readable output. Parameters are normalized and validated for safer execution.

Documentation in README describes usage, arguments, and macOS Godot auto-detection.
@jsvd
Copy link
Author

jsvd commented Sep 11, 2025

NOTE: this PR was shamelessly coded with the help of an agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant