You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gdUnit4 settings description for Test Lookup Folder states:
Subfolder where test suites are located (or empty to use source folder directly)
However, leaving this setting empty (or set to /, or res://) will cause gdUnit4 to not find any test suites in the root folder. scan_test_directories starts by examining subfolders, though it is very permissive with any of these test directory settings.
This structure would be bad practice in a proper project, since it has to perform a lot of scanning which a dedicated test directory would avoid. However, this should eliminate much confusion when trying to create a minimal reproducible test project, and wondering why the test suite is silently not being detected.
This is not a problem when using the GdUnit4 Test Adapter via VSTest; tests located in the root folder will be correctly located and executed when going through VSCode. This is only an issue when going through the GdUnit4 Godot Editor plugin.
Steps to Reproduce
Configure Test lookup folder in gdUnit4 settings to be blank (or /, or res://)
Create a test case in the root directory of the project:
esainane
changed the title
GD-606: GdUnit4 Godot plugin does not find test suites at the root folder
GD-607: GdUnit4 Godot plugin does not find test suites at the root folder
Dec 3, 2024
# Why
The GdUnit4 Godot Editor plugin currently does not find any tests in the
project root directory, even when configured to do so.
Fixes#607.
# What
- Refactors external calls to `scan_test_directories` into a new
`scan_all_test_directories` instead. These external calls all had the
form `scan_test_directorys("res://", GdUnitSettings.test_root_folder(),
[])`. This provides a cleaner API, and a logical place to add handling
for the "include all resources" special case.
- When `scan_all_test_directories` is called to determine which resource
paths should be included, and the project is configured to include all
resources, it early returns `["res://"]`. Otherwise, it performs the
current subfolder scanning logic via `scan_test_directories("res://",
GdUnitSettings.test_root_folder(), [])`.
- Fixes a typo: `suits` -> `suites`
- Fixes a typo: `scan_test_directorys` -> `scan_test_directories`
---------
Co-authored-by: Nullpointer <mikeschulze.lpz@gmail.com>
The used GdUnit4 version
4.4.4 (Pre Release/Master branch)
The used Godot version
v4.3.1.rc.mono.custom_build [ff9bc0422]
Operating System
6.11.5+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian GNU/Linux trixie/sid 6.11.5-1~bpo12+1 (2024-11-11) x86_64
Describe the bug
The
gdUnit4
settings description forTest Lookup Folder
states:However, leaving this setting empty (or set to
/
, orres://
) will causegdUnit4
to not find any test suites in the root folder.scan_test_directories
starts by examining subfolders, though it is very permissive with any of these test directory settings.This structure would be bad practice in a proper project, since it has to perform a lot of scanning which a dedicated test directory would avoid. However, this should eliminate much confusion when trying to create a minimal reproducible test project, and wondering why the test suite is silently not being detected.
This is not a problem when using the
GdUnit4 Test Adapter
viaVSTest
; tests located in the root folder will be correctly located and executed when going throughVSCode
. This is only an issue when going through theGdUnit4 Godot Editor plugin
.Steps to Reproduce
Test lookup folder
in gdUnit4 settings to be blank (or/
, orres://
)VSCode
. ObserveVSCode
finding the test.Godot Editor
. ObserveGodot Editor
failing to find the same test.Minimal reproduction project
gdunit4-root-test-example.zip
The text was updated successfully, but these errors were encountered: