Skip to content
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

GD-517: Test discovery guard fails on CSharpScript tests when editing #517

Closed
MikeSchulze opened this issue Jun 25, 2024 · 0 comments · Fixed by #523
Closed

GD-517: Test discovery guard fails on CSharpScript tests when editing #517

MikeSchulze opened this issue Jun 25, 2024 · 0 comments · Fixed by #523
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MikeSchulze
Copy link
Owner

The used GdUnit4 version

4.3.2 (Latest Release)

The used Godot version

v4.2.2.stable.mono.official [15073afe3]

Operating System

All

Describe the bug

The test discovery fails on CS test suites during editing. The guard is expecting script type GDScript where is failing for CSharpScript type.

Dev Hints

res://addons/gdUnit4/src/core/discovery/GdUnitTestDiscoverGuard.gd

func discover(script: Script) -> void:
	if GdObjects.is_test_suite(script):
		# a new test suite is discovered
		if not _discover_cache.has(script.resource_path):
			var scanner := GdUnitTestSuiteScanner.new()
			var test_suite := scanner._parse_test_suite(script)

The parser expects GDScript and do fail by

res://addons/gdUnit4/src/core/discovery/GdUnitTestDiscoverGuard.gd:27 - Invalid type in function '_parse_test_suite' in base 'RefCounted (GdUnitTestSuiteScanner)'. The Object-derived class of argument 1 (CSharpScript) is not a subclass of the expected argument class.

Steps to Reproduce

  • open a CS test suite
  • edit and save
res://addons/gdUnit4/src/core/discovery/GdUnitTestDiscoverGuard.gd:27 - Invalid type in function '_parse_test_suite' in base 'RefCounted (GdUnitTestSuiteScanner)'. The Object-derived class of argument 1 (CSharpScript) is not a subclass of the expected argument class.

Minimal reproduction project

No response

@MikeSchulze MikeSchulze added the bug Something isn't working label Jun 25, 2024
@MikeSchulze MikeSchulze self-assigned this Jun 25, 2024
@MikeSchulze MikeSchulze changed the title GD-XXX: Test discovery guard fails on CSharpScript tests when editing GD-517: Test discovery guard fails on CSharpScript tests when editing Jun 25, 2024
@MikeSchulze MikeSchulze added this to the v4.3.3 milestone Jun 25, 2024
MikeSchulze added a commit that referenced this issue Jun 26, 2024
…ting

# Why
see #517

# What
- added rebuild cs scripts before run discovery
- fixed invalid script path resolving by using `localize_path` to convert cs script paths
- fixes test suite scanner to run on Script class to accept GDScript and CSharpScript
MikeSchulze added a commit that referenced this issue Jun 26, 2024
…ting

# Why
see #517

# What
- added rebuild cs scripts before run discovery
- fixed invalid script path resolving by using `localize_path` to convert cs script paths
- fixes test suite scanner to run on Script class to accept GDScript and CSharpScript
MikeSchulze added a commit that referenced this issue Jun 26, 2024
…ting

# Why
see #517

# What
- added rebuild cs scripts before run discovery
- fixed invalid script path resolving by using `localize_path` to convert cs script paths
- fixes test suite scanner to run on Script class to accept GDScript and CSharpScript
MikeSchulze added a commit that referenced this issue Jun 27, 2024
…diting (#523)

# Why
see #517

# What
- added rebuild cs scripts before run discovery
- fixed invalid script path resolving by using `localize_path` to
convert cs script paths
- fixes test suite scanner to run on Script class to accept `GDScript`
and `CSharpScript`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant