Switch to GDUnit#939
Merged
Merged
Conversation
CedNaru
force-pushed
the
rework/unit_tests
branch
4 times, most recently
from
June 22, 2026 12:17
cf4e99e to
d1805f3
Compare
CI runs Godot without a display, so DisplayServer reports "headless" and GdUnit aborts with exit code 103 (RETURN_ERROR_HEADLESS_NOT_SUPPORTED). Pass GdUnit's --ignoreHeadlessMode flag so the test runner proceeds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Running tests from the exported build was broken two ways: 1. Export crash: with export_filter=all_resources the exporter loads gdUnit's @tool editor scenes (e.g. GdUnitInspector.tscn) and the editor then SIGSEGVs/SIGABRTs on shutdown (gdUnit #1151 / Godot cold-cache teardown bug). Fixed by excluding addons/gdUnit4/*.tscn from the three test export presets - this keeps every gdUnit .gd script (so preloads still compile) but stops the @tool scenes from being instantiated. 2. Editor-coupled runner: GdUnitCmdTool pulls in editor-only code (GdUnitCommandHandler -> EditorInterface) and hangs/fails inside an exported game. gdUnit's supported approach (issues #969/#973, discussion #650) is a minimal runner extending the decoupled GdUnitTestSessionRunner. Adds test_runner/ (outside the addon so version upgrades don't clobber it): ExportTestRunner.gd (discovers + runs tests, disposes gdUnit singletons in quit() to avoid the same teardown crash), ExportTestMain.gd (SceneTree entry point), and README.md explaining the rationale. runExportedGDTests now uses this runner; runGDTests keeps GdUnitCmdTool for the editor run. Verified locally: cold export exits cleanly and the exported run executes all suites and passes with a clean shutdown. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The minimal export runner only returned an exit code. Attach GdUnitConsoleTestReporter for per-test PASS/FAIL console output and point report_base_path at <exported-executable-dir>/reports so the default session hooks write results.xml (JUnit) + HTML reports into harness/tests/export/reports - the directory the CI workflow uploads as the gdunit_reports_* artifact. Verified locally: exported run prints per-test results, writes a JUnit XML report (tests=111, failures=0) and HTML report, and exits 0 with clean shutdown. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CedNaru
force-pushed
the
rework/unit_tests
branch
from
June 22, 2026 15:46
d1805f3 to
f67b721
Compare
Follow-up to the earlier export-test work, fixing the per-OS failures CI surfaced: - tests_macos: terminate the previously broken exclude_filter string (an unterminated quote made Godot swallow export_path -> "preset.5.options nonexistent"), and keep export_path as ./export/tests.dmg. The macOS workflow mounts that .dmg (hdiutil attach tests.dmg) and copies the .app out, so the export must produce a .dmg (an earlier attempt to switch to .app broke that workflow step). - Windows: prepareHostExportTemplates ensured BOTH the debug and release host templates unconditionally, but each export job only downloads the template for its own target (debug for "dev tests", release for "release tests"), causing "Could not find Windows <target> export template". ensure now skips a template that isn't present instead of failing the prepare step; the export only needs the template matching its target. - Linux: run the test executable under `stdbuf -oL -eL` so its stdout/stderr is line-buffered. Godot block-buffers when piped, so on a 30-min timeout the buffered tail (where the exported run actually stalls) was lost, leaving the log truncated at "Starting JVM ...". This surfaces the real progress/stall point in CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CedNaru
force-pushed
the
rework/unit_tests
branch
from
June 22, 2026 18:27
f67b721 to
c45009f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.