-
Notifications
You must be signed in to change notification settings - Fork 0
Add unit testing with Gut framework and GitHub Actions code checks workflow #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: saebyn <185030+saebyn@users.noreply.github.com>
Co-authored-by: saebyn <185030+saebyn@users.noreply.github.com>
@copilot can you troubleshoot the test failure? |
…functionality Co-authored-by: saebyn <185030+saebyn@users.noreply.github.com>
Fixed the test failures! The issue was with signal testing in the integration tests. I replaced the manual signal connection approach with Gut's built-in signal watching functionality ( |
Co-authored-by: saebyn <185030+saebyn@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive unit testing infrastructure for the Godot template using the Gut framework and integrates GitHub Actions workflows to run tests and perform code quality checks.
- Integrated Gut v9.4.0 with test configuration and a test runner script.
- Added several new scripts, configuration files, and UID assets to support the testing framework and CLI tools.
- Updated project documentation and added a GitHub Actions workflow for tests and linting.
Reviewed Changes
Copilot reviewed 220 out of 220 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
addons/gut/collected_script.gd | Adds a meta-information container for parsed test scripts. |
addons/gut/cli/* | Introduces CLI support files (including uid assets and option parsing for tests). |
addons/gut/awaiter.gd and addons/gut/autofree.gd | Implements asynchronous waiting and free management logic for test operations. |
addons/gut/UserFileViewer.tscn and UserFileViewer.gd | Implements a new file viewer scene and corresponding script. |
addons/gut/GutScene.tscn and GutScene.gd | Provides the GUI wrapper for the test-runner interface. |
README.md, .gutconfig.json, .github/workflows/code-checks.yml | Updates documentation and CI/CD configuration for testing and linting support. |
Comments suppressed due to low confidence (1)
addons/gut/collected_script.gd:35
- The property 'name' returns the file path, which might be misleading. Consider renaming the property or updating its getter to clarify its purpose.
var name = '' : get: return path
This PR implements comprehensive unit testing infrastructure for the Godot template using the Gut testing framework and adds automated code quality checks via GitHub Actions.
Changes Made
Testing Infrastructure
.gutconfig.json
with optimized settings for automated testingtest_runner.sh
script for local test executionproject.godot
to enable the Gut addonComprehensive Test Suite
Created 5 test files covering all major components:
test_game_manager.gd
- Tests GameManager singleton functionality, signals, and Score classtest_main.gd
- Tests main scene loading, input actions, and project settingstest_menu.gd
- Tests menu UI components and signal handlingtest_ui_components.gd
- Tests scene loading for all UI components (keybindings, mixer, high scores, credits)test_integration.gd
- Integration tests for game flow, autoload initialization, and component interactionsGitHub Actions Workflow
Added
.github/workflows/code-checks.yml
with two jobs:Documentation
README.md
with testing section and updated project structuretest/README.md
with comprehensive testing documentationTesting Coverage
The test suite validates:
Running Tests
Locally:
In Godot Editor:
CI/CD:
Tests run automatically on push/PR to main branch alongside existing build workflow.
Fixes #9.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.