MikeSchulze / gdUnit4

A Godot Unit Test Framework. Support for GDScript and C# unit testing
MIT License
490 stars 28 forks source link

GD-494: Discover test shows an error when the test root folder is set to empty #494

Closed voithos closed 1 month ago

voithos commented 1 month ago

The used GdUnit4 version

4.3.1 (Latest Release)

The used Godot version

v4.2.2.stable.official

Operating System

Windows 11

Describe the bug

After upgrading to 4.3.1 from 4.2.5, I started seeing this error in the output log whenever I run tests:

  ./core/templates/cowdata.h:167 - Index p_index = -1 is out of bounds (size() = 0).

It seems to get printed once per executed GdUnitTestSuite (so if I run only one of the test suites, it only gets printed once). It doesn't seem to affect test success, so only appears to be noise.

Steps to Reproduce

No response

Minimal reproduction project

No response

MikeSchulze commented 1 month ago

These sounds link a .godot cache issue, can you please do the following.

voithos commented 1 month ago

Unfortunately, that didn't seem to do it. :( Still get the same exact errors.

MikeSchulze commented 1 month ago

I'm not able to reproduce. image

Can you give me an example to reproduce, please. Can you please attach the Godot log of your test session?

voithos commented 1 month ago

I tried creating an example project + test like you, and got an even weirder error... Godot can't even find the test unless I rename and/or re-save the .gd file. Here's the log:

Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
Vulkan API 1.3.224 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 4090

TCP Client: wait to connect ..
TCP Client: Connected to Server: -9223370202249365504
Scan for test suites.
Scanning for test suites in: res://addons
Scanning for test suites in: res://addons/gdUnit4
  core/variant/variant_utility.cpp:1091 - Internal Error: Can't find test suite example_test
  core/variant/variant_utility.cpp:1091 - Internal Error: Can't find test case example_test:test_one
Scanning for test suites in: res://test
Scanning of 1 test suites took 52ms
  core/variant/variant_utility.cpp:1091 - Internal Error: Can't find test case example_test:test_one
  core/variant/variant_utility.cpp:1091 - Internal Error: Can't find test suite example_test
--- Debugging process stopped ---
Running test discovery ..
  ./core/templates/cowdata.h:167 - Index p_index = -1 is out of bounds (size() = 0).
Scanning for test suites in: res://addons
Scanning for test suites in: res://addons/gdUnit4
Scanning for test suites in: res://test
1 test suites discovered.

Here's the example I was trying: tempgodot.zip

Godot system info:

Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (NVIDIA; 31.0.15.2849) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)
MikeSchulze commented 1 month ago

Ok I see the error now, it occurs when setting the test root folder empty image

Running test discovery ..
  ./core/templates/cowdata.h:167 - Index p_index = -1 is out of bounds (size() = 0).
Scanning for test suites in: res://addons
Scanning for test suites in: res://addons/gdUnit4
Scanning for test suites in: res://test
1 test suites discovered.