Giter VIP home page Giter VIP logo

gdunit3's People

Contributors

alope107 avatar clemens-tolboom avatar derkork avatar mikeschulze avatar rubonnek avatar wcubed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gdunit3's Issues

GD-05: Report shows wrong line number when code is multiline formatted

The used Godot version:
Godot 3.2.1

OS including version:
Windows 10 and MacOS

Describe the bug
When i use multiline formatted code and an assertion reports an failure than the error line is wrong.
Double click jumps to wrong line.

Steps to Reproduce

  1. create a test like this
func test_error_line_number_multiline():
	assert_int(10)\
		.is_not_zero()\
		.is_equal(20)

image

  1. Run the test
  2. Check the GdUnit inspector for report

The failure report shows the line 25 but the error occurs on line 27
image

** Node **
This is an godot script get_stack() bug and already reported to godot godotengine/godot#43326

Wiki references to master/examples

Describe the bug

Visiting https://github.com/MikeSchulze/gdUnit3/wiki/advanced_testing#advanced-testing the link to example is wrong. Checking the wiki there are 4 lines.

advanced_testing.org:5:The example code can be found here [[examples | https://github.com/MikeSchulze/gdUnit3/tree/master/examples]]
advanced_testing.org:128:The example can be find [[here|https://github.com/MikeSchulze/gdUnit3/blob/master/examples/SignalsTestExamples/test/ExampleMockWithSignalTest.gd]]
advanced_testing.org:171:The example can be find [[here|https://github.com/MikeSchulze/gdUnit3/blob/master/examples/SignalsTestExamples/test/ExampleSpyWithSignalTest.gd]]
advanced_testing.org:293:The example can be find [[here|https://github.com/MikeSchulze/gdUnit3/blob/master/examples/MenuDemo2D/test/GameSpyTest.gd]]

For what its worth DRY (Don't repeat yourself) the Wiki could link (only) to the master/gdUnit-example ... it would be cool if the wiki could embed the examples somehow which keeps our eyes dry too ;-)

GD-08: Test executer not executes 'after' on yielded tests over CLI tool

The used Godot version:
Godot Engine v3.2.4.beta4.official

OS including version:
Windows 10 and MacOs

Describe the bug
While preparing the cmd tool i found yielding breaks test suite execution.

Steps to Reproduce

  • run gdUnit CLI tool with debug info
    see testsuites after is not executed

GD-83: Add failure next/previous navigation buttons to the inspector

Is your feature request related to a problem? Please describe.
If many tests fail, we have to manually scroll and select the next test failure. This can be improved by using navigation keys to jump to the next or previous error.

Describe the solution you'd like
Add navigate buttons on top of the GdUnit inspector.

Describe alternatives you've considered
-none-

GD-47: Add test examples to show howto write good/bad tests

Note

${\Large\color{red}GdUnit3\ is\ Now\ in\ Maintenance\ Mode!}$

Meaning that no new features will be added and only bug fixes will be made.

The development of GdUnit continues with GdUnit4, which is designed for use with Godot4.

  • Write some example testsuites to show howto use the API

GD-88: Move internal tests under one directory for easy install exclusion

Is your feature request related to a problem? Please describe.
When installing from the AssetLib, you can choose not to install certain folders. What can be excluded is currently unclear and spread out.

Describe the solution you'd like
Most of the AssetLib assets have a top-level folder for examples and tests, making it easy to exclude those folders for a minimal install. It would be nice if we could move all the test folders to a common one for easy exclusion. This may also make it easier when updating gdUnit3, as the test folder will likely remain unchanged.

Describe alternatives you've considered
N/A

Additional context
N/A

GD-55: Add test timeout for long running tests

** PROBLEM**
Sometimes a test can be run "out of time" because it is "blocking" by a timer or a signal to wait.

Describe the solution you'd like

  • Test cases should have a default timeout
  • If a test run reaches the timeout, the test must be aborted with an error
  • It should be possibe to define a custom timeout for each test
  • make the default timeout configurable

GD-31: Add support to mock and spy on Scenes

Is your feature request related to a problem? Please describe.
gdUnit3 supports only mocking objects, but not the scene itself, so if I need to mock a object from a saved scene (PackedScene) I can't (or at least I don't know how).

Describe the solution you'd like
It should be nice if we can mock the object or the scene, depending on the extension of what is beign called on the mock function:

var mocked_scene = mock("res://scenes/player.tscn", CALL_REAL_FUNC)
self.add_child(mocked_scene)

mocked_scene.do_some_mocked_function()

Describe alternatives you've considered
I've tried to mock the object script and change the scene object instance at runtime, but I think that isn't possible.

Additional context
I have a lot of scenes, like Player.tscn or Mob.tscn which has functions that depends on the scene tree it self, like check collisions using a RayCast or even check if a child node exists.

GD-32: Unable to mock script which uses snake_case naming convention

The used Godot version:
3.3-rc6

OS including version:
Ubuntu 20.04 x64 x11 GTX 1650M (proprietary drives)

Describe the bug
When trying to mock a script which has a snake_case.gd naming convention, gdUnit3 tries to use the file name to find the class, so if I'm trying to mock a class, named main_player.gd or mob.gd, gdUnit3 will extends main_player and mob classes, which doesn't exists.

Since snake_case is the convention recomended by godot style guide, many users will have the same problem.

Steps to Reproduce

  1. Create a new script using snake_case.gd
  2. Try to create a mock of this script
  3. Run any tests and the error will appear

Minimal reproduction project:
N/A

GD-61: Plugin errors out when enabled in Godot 3.3

The used Godot version: 3.3

OS including version: Windows 10 Home

Describe the bug
When enabling the plugin, an error message appears: Unable to load addon script from path: 'res://addons/gdUnit3/plugin.gd' There seems to be an error in the code, please check the syntax.

Steps to Reproduce

  • Create a new Godot project
  • Go to AssetLib and search for GDUnit
  • Download and install the plugin
  • Go to Project > Project Settings > Plugins, and check the "Enable" checkbox for gdUnit3

The error message appears.

Strangely enough, enabling the plugin a second time, succeeds

GD-56: Added extract functionallity to ArrayAssert to improve test readability

Feature

Comparing results via 'assert_array' is sometimes hard to read or implement.
It needs the expected values fully initalized for comparison, which can be difficult for complex objects.
Often we are only interested in a set of characteristics, such as the name.
To allow more accurate checking for arrary values, we need an 'extract' function to check for specific properties.

Describe the solution you'd like

for single value

assert_array(node.get_children())\
		# extract the node name
		.extract("get_name")\
		# now we verify contains_exactly by the Node names
		.contains_exactly(["VBoxContainer", "Spell"])

for multible values

assert_array(node.get_children())\
		# extract the node name
		.extractv(["get_name", "get_foo"])\
		# now we verify contains_exactly by a tuple( <name>, <foo>)
		.contains_exactly([tuple("VBoxContainer", "xx"), tuple("Spell", "yy")])

GD-64: RPC server intercept with built-in GdUnit3 server rpc calls

The used Godot version:
Godot v3.2.3

OS including version:
Windows 10

Describe the bug
When trying to run NetworkedMultiplayerENet server scene in scene_runner , "rpcp: RPC 'receive_event' on yourself is not allowed by selected mode " error occurred.
Annotation 2021-05-19 035726

Steps to Reproduce

  1. Create a Node called Server
  2. Add Server.gd :
extends Node

var network = NetworkedMultiplayerENet.new()
var max_players = 5

var auth_port = 1911

func _ready():
	StartServer()
	emit_signal("hello")
	
func StartServer():
	network.create_server(auth_port, max_players)
	get_tree().set_network_peer(network)
	print("Authentication Server start on port ",auth_port)

	network.connect("peer_connected" , self ,"_Peer_Connected")
	network.connect("peer_disconnected" ,self ,"_Peer_Disconnected")

func _Peer_Connected(gateway_id):
	print("Gateway " + str(gateway_id) + " is connected")

func _Peer_Disconnected(gateway_id):
	print("Gateway "+ str(gateway_id) + " is disconnected")

  1. Right click on StartServer function and Create Test.

ServerTest.gd:

# GdUnit generated TestSuite
class_name ServerTest
extends GdUnitTestSuite

# TestSuite generated from
const __source = 'res://Server.gd'

var spy_scene = null
var spy_instance = null

class CustomClient:
	extends Node
	
	signal done
	var network = NetworkedMultiplayerENet.new()
	var multiplayerAPI = MultiplayerAPI.new()

	var ip = "127.0.0.1"
	var port = 1911
	var temp_node = null
	
	func _ready():
		temp_node = Node.new()
		
	func _process(delta):
		#check whether custom multiplayer api is set
		if  get_custom_multiplayer() == null:
			return
		#check whether custom multiplayer network is set
		if not custom_multiplayer.has_network_peer():
			return
		#start custom_multiplayer poll
		custom_multiplayer.poll()
		
	
	func StartClient():
		print("started")
		emit_signal("done")
		network.create_client(ip ,port)
		set_custom_multiplayer(multiplayerAPI)
		custom_multiplayer.set_root_node(temp_node)
		custom_multiplayer.set_network_peer(network)
		#connect signals
		network.connect("connection_failed" ,self ,"_OnConnectionFailed")
		network.connect("connection_succeeded" ,self ,"_OnConnectionSucceeded")
		
	func _OnConnectionFailed():
		pass
		
	func _OnConnectionSucceeded():
		pass
		

func before():
	# using 'before()' to create only once the spy_scene at beginning of test suite run
	var scene_instance = load("res://Server.tscn").instance()
	# create a spy on this spy_scene instance
	spy_scene = spy(scene_instance)
	

func test_StartServer() -> void:
	
	scene_runner(spy_scene)
	
	spy_instance = spy(auto_free(CustomClient.new()))
	
	spy_instance.StartClient()
	verify(spy_instance).emit_signal("connection_succeeded", any(), any_bool())
	
func after():
	pass


Mock: verify interactions on a func with different Array types results in a useless failure report

The used Godot version:
GdUnit3 9.0.0 beta

Describe the bug
I want to test interactions on a function with argument type 'PoolStringArray'. e.g. func foo(arg :PoolStringArray)
When i useverify(<mock>).foo([]) with an Array type than the validation fails as expected but the report is useless:

Expecting no more interacions!
But found interactions on:

The error has no usefull information what happend.

verify(<mock>).foo(PoolStringArray()) should fail with an report like this.

Expecting interacion on:
   'foo([])' 1 time's
But found interactions on:
'foo' is called one times with arg PoolStringArray()

verify(<mock>).foo(PoolStringArray()) should success

Steps to Reproduce

  • create a simple class
class_name ClassWithPoolStringArrayFunc
extends Reference

var _values :PoolStringArray

func set_values(values :PoolStringArray):
	_values = values
  • write a test
func test_verify_func_interaction_wiht_PoolStringArray():
	var mocked :ClassWithPoolStringArrayFunc = mock(ClassWithPoolStringArrayFunc)
	
	mocked.set_values(PoolStringArray())
	
	verify(mocked).set_values([])

GD-85: Add wiki link to the inspector

Is your feature request related to a problem? Please describe.
It would be nice to have a shout cut/link to the GdUnit wiki on the inspector.
This will help a lot for beginners to get familiar with this tool

Describe the solution you'd like
A button called 'wiki' in the inspector on the top right near the version.
If the button pressed you are redirected by opening the standard browser to the official GdUnit wiki page

GD-01: Test execution runner is disconnecting on Debug mode

The used Godot version:
Godot Engine v3.2.3.stable.mono.official

OS including version:
Windows 10 and MacOS

Describe the bug
The GdUnit Inspecter is spinning endles when run a TestSuite by "Debug Tests" and steping over break points.
The GdUnit console shows "Client disconnectd!"

Steps to Reproduce
1 Open a Testsuite and set a breakpoint
2 Run the TestSuite by "Debug Tests"
3 The Debugger is hold on the line now wait some seconds ~40s
4 Continue debugger running.
5 The TestSuite is finished
But the inspector shows still a spinning item
image

GD-44: Cannot save file "Saved 5 modified resource(s)"

The used Godot version:
3.3.rc7

OS including version:

MacOS 11.2.3

Describe the bug

Running test works ... editing test subject or test file gives:

image

The file is not saved.

Steps to Reproduce

  1. Add a GD file to test against
  2. Create test
  3. Test a function for that file
  4. Run tests
  5. Edit either file
  6. Try to save
  7. Rerun unit tests
  8. File still not saved
  9. Rerun unit tests (debug)
  10. File gets saved!

Minimal reproduction project:

File

extends Reference

class_name StandaloneScript

func add(a:int, b:int) -> int:
	return a + b

Test file

# GdUnit generated TestSuite
class_name standalone_scriptTest
extends GdUnitTestSuite

# TestSuite generated from
const __source = 'res://standalone_script.gd'

func test_add() -> void:
	# remove this line and complete your test
	var t:StandaloneScript = StandaloneScript.new()
	var sum = t.add(2,2)
	assert_int(sum).is_equal(4)

GD-18: Add verify_no_more_interactions for spy and mock

To check if a function is called that often, we have to use verify(<spy>, [times]).<func>.
This is good enough to check whether or not a small set of functions is being called.
When a test checks that only two functions out of a set of 10 functions are called, a full list of verify (<spy>, 0).<func> is required for the excluded functions.

For example we have a class with a set of functions like 'foo1', 'foo2', 'foo3', 'foo4', 'foo5', 'foo6', 'foo7'

var spy := spy(MyClass)

# call functions
spy.foo1()
spy.foo3()
spy.foo3()

# verify foo1 is called one times
verify(spy).foo1()
# verify foo3 is called two times
verify(spy, 2).foo3()

# now we want to verify all other functions are not called
verify(spy, 0).foo2()
verify(spy, 0).foo4()
verify(spy, 0).foo5()
verify(spy, 0).foo6()
verify(spy, 0).foo7()

The last part of this test is unnecessarily complicated.

Describe the solution you'd like
It would be nice to have a one-liner to check that no other functions are called for the spy at this moment.
It would be good to have a "verify_no_more_interactions" (), the test will be smaller.
The test can look like this:

var spy := spy(MyClass)

# call functions
spy.foo1()
spy.foo3()
spy.foo3()

# verify foo1 is called one times
verify(spy).foo1()
# verify foo3 is called two times
verify(spy, 2).foo3()

# verify no other functions are called
verify_no_more_interactions(spy)

GD-90: Some notes on tag gdUnit3-0.9.5-rc

The used Godot version:

Godot-3.3.2

OS including version:

Mac OS Big Sure 11.4

Describe the bug

  • This version is not available in the AssetLib
  • The zip contains a directory examples, can we rename that into gdUnit3-examples?
  • Why is there a (extra) plugin directory GdCommons which is confusing
  • Dropping the zip into existing project generates error. See below

I run using a shell script and the terminal shows this error

/Applications/Godot_v3.3.2-stable_osx.universal.app/Contents/MacOS/Godot --editor
...
SCRIPT ERROR: GDScript::reload: Parse Error: The identifier "TimeUnit" isn't declared in the current scope.
   At: res://addons/GdCommons/DateTime/src/LocalTime.gd:48.
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
   At: modules/gdscript/gdscript.cpp:583.

Steps to Reproduce

  1. Download ZIP version from github
  2. Unzip
  3. Drop all files into an existing project
  4. Start Godot from command-line
  5. Check the script output

Minimal reproduction project:

GD-12: spy on instance with untyped static function results in 'Parser Error: The function signature doesn't match the parent.'

The used Godot version:
Godot Engine v3.2.4.rc2.official
GdUnit 0.9.0-beta

OS including version:
Windows and MacOS

Describe the bug
spy ends up with 'Parser Error: The function signature doesn't match the parent.' on class with static functions without return type
static func bar():fails
static func bar() -> void: works

Steps to Reproduce
create a simple class and try to spy on it

class ClassWithStaticFunctions:
	
	static func foo() -> void:
		pass
	
	static func bar():
		pass
	
func test_create_spy_static_func_untyped():
	var instance = spy(ClassWithStaticFunctions.new())
	assert_object(instance).is_not_null()

fails with error

Parser Error: The function signature doesn't match the parent. Parent signature is: "Variant bar()".

GD-62: Add Option to Disable Orphan Checks

Hi,

Is it possible to add a feature in GDUnit to ignore / not report orphan objects generated in tests?

I spent a fair bit of time investigating, adding auto_free, etc. and I think it's my test code that's faulty, not my production/game code. I would like to ignore this in the future (and just see passing tests instead of a lot of warning tests).

I just noticed that tests that show warnings when run, are failing when I debug; but when I run them, they show up as warnings, not as failures.

GD-58: Refactor type matchers by using type as argument

We have currently a small set of type matchers (bool, int, float, string) and each implementation has similar code like this

func is_match(value) -> bool:
	return typeof(value) == TYPE_BOOL


func is_match(value) -> bool:
	return typeof(value) == TYPE_INT

We can generalisize it to one type matcher with an argument 'type' to simplify it

class_name AnyTypeArgumentMatcher
extends GdUnitArgumentMatcher

var _type :int

_init(type :int):
    _type  = type


func is_match(value) -> bool:
	return typeof(value) == _type

This will allow us to add fast support for all base types

GD-89: Add a option to install examples

Is your feature request related to a problem? Please describe.
With GD-88 we exclude all integration and examples form AssetLib download.
It would be nice to have a option to install examples to can look into and learn how to write tests.

Describe the solution you'd like
Add an option like a button to optional install GdUnit examples.

Describe alternatives you've considered
manual download from GitHub

GD-69: Add assert_vec2 and assert_vec3 to enable vector validation

Currently, I cannot assert equality or check var for null if it's value is Vector2. assert_that/assert_object reports, that Vector2 is not an Object.

The error reported is this: line -1: GdUnitObjectAssert inital error, unexpected type <Vector2>

I am quite new to GDScript, so I don't feel I can suggest good solution, but it looks like new assert_vec2/3 functions would be nice ;-)

GD-27: "Run Tests" always succeed

The used Godot version:
3.3-rc6

OS including version:
Ubuntu 20.04 x64 x11 GTX 1650M (proprietary drives)

Describe the bug
When using the "Run Tests", be it the context manu or the painel button, all tests always returns success. If I Debug Tests the tests works as intended and fails.

Steps to Reproduce

  1. Go to GdUnit panel

  2. Click Run Tests:
    image

  3. Click Debug Tests:
    image

Minimal reproduction project:
test_project.zip

GD-15: Add reset function to mock and spy

I need a reset for used spy or mock for continus testing without creating a new one

Describe the solution you'd like

func test_reset():
	var instance :Node = auto_free(Node.new())
	var spy_node = spy(instance)
	
	# call with different arguments
	spy_node.set_process(false) # 1 times
	spy_node.set_process(true) # 1 times
	spy_node.set_process(true) # 2 times
	
	verify(spy_node, 2).set_process(true)
	verify(spy_node, 1).set_process(false)
	
	# now reset the spy
	reset(spy_node)
	# verify all counters are rested
	verify_no_interactions(spy_node)

This will help a very lot to test different use cases on one spy or mock objet in a single test

GD-77: Fix failing testcase GdObjectsTest:test_string_diff

The used Godot version:
All Godot versions

OS including version:
Ubuntu fails
MacOs fails
Windows 10 success

Describe the bug
The test GdObjectsTest:test_string_diff is failing on linux based os.

Steps to Reproduce
Run testsuite GdObjectsTest

  • test_string_diff is failing

GD-66: GdUnitInspector: Invalid state for failing tests by test timeout

The used Godot version:
Godot 3.3

OS including version:
Windows 10 / MacOs

Describe the bug
Playing around with test timeouts and set the timeout to 4s on project settings.
Some of the test now failing by a timeout error as expecting.
But the GdUnitInspector shows incorrect states.
image
The errors also not counted in the bar on top.

Steps to Reproduce
Go to project settings and set test timeout to 4s.
image

  • run tests
  • check the inspector state

GD-26: Add a option to generate Static Typed GDScript tests

Is your feature request related to a problem? Please describe.
When a new test is generated, it generates the default dynamic GDScript syntax, since I use Static Typed GDScript, I need to convert it, which isn't a big deal, I just need to add -> void: at the end of the function.

Since the number of Static Typed GDScript is increasing, due the Godot 4.0 performance improvements, it would be a good idea to have an option to generate the code using the Static Tyuped GDScript

Describe the solution you'd like
Add a configuration option to generated new code using Static Typed GDScript syntax.

Describe alternatives you've considered
Just keep adding it manually. It isn't a big deal also, just a minor QoL

Additional context
N/A.

GD-76: Selftest on Godot 3.2.x is failing

The used Godot version:
Godot 3.2.1 - 3.2.3
OS including version:
Windows 10 x64

Describe the bug
runtest --selftest is failing

`Debugger Break, Reason: 'Parser Error: invalid index 'NOTIFICATION_POST_ENTER_TREE' in constant expression'
*Frame 0 - res://addons/gdUnit3/src/core/GdObjects.gd:96 in function ''

Debugger Break, Reason: 'Parser Error: The class "GdObjects" couldn't be fully loaded (script error or cyclic dependency).'
*Frame 0 - res://addons/gdUnit3/src/GdUnitValueExtractor.gd:41 in function ''

SCRIPT ERROR: GDScript::reload: Parse Error: The class "GdObjects" couldn't be fully loaded (script error or cyclic dependency).
At: res://addons/gdUnit3/src/GdUnitValueExtractor.gd:41
`
and much more

Steps to Reproduce
Install Godot_v3.2.1-stable_win64.exe
run runtest --selftest
see errors

GD-11: mock and spy results into orphan instances

The used Godot version:
Godot Engine v3.2.4.rc2.official
GdUnit 0.9.0 - beta

OS including version:
Windows and MacOS

Describe the bug
When using an spy or mock on test results into orphan instances.

Steps to Reproduce

  • create a simple test
func test_custom_matcher():
	var mocked_test_class : CustomArgumentMatcherTestClass = mock(CustomArgumentMatcherTestClass)
	
  • run CLI tool with --verbose and see lot of orphan references

GD-28: GdUnit is not working on running multiple Godot instances

The used Godot version:
Godot Engine v3.2.4.beta4.official

OS including version:
Windows 10

Describe the bug
If i running one Godot instance the plugin works so far.
But when i run two or more Godot instances the plugin stops working with an error.

Couldn't create an ENet multiplayer server.
 modules/gdscript/gdscript_functions.cpp:803 - Can't establish server, error code: 20
Loading GdUnit3 Plugin success

Steps to Reproduce

  • Install the GdUnit plugin
  • start one Godot
  • start a second Godot
Couldn't create an ENet multiplayer server.
 modules/gdscript/gdscript_functions.cpp:803 - Can't establish server, error code: 20
Loading GdUnit3 Plugin success

The plugin stops working

Are you aware of GUT and WAT testing frameworks?

I found 3 tools to do unit tests and more.

I use GUT for a while which has a long track record so am reluctant to change tools.

I wonder what your tool does different/better then one of the others.

Your screenshot with progress bar/integration looks better then the GUT scene to run. GUT has a command-line which I use when committing to run all tests. I will study your integration part for sure.

GUT

WAT

gdUnit3

GD-24: [Master] Request for nonexistent project setting: gdunit/report/error_notification

The used Godot version:
3.3.rc6

OS including version:
Ubuntu 20.04 x64 x11 GTX 1650M (proprietary drives)

Describe the bug
I just cloned the master and copied gdUnit3 and GdCommons to /addons folders. When I started godot on my existing project, the following error shows up:
Request for nonexistent project setting: gdunit/report/error_notification.

When testing on a new clean project, there are two more erros:

 Request for nonexistent project setting: gdunit/report/error_notification.
 Couldn't create an ENet multiplayer server.
 modules/gdscript/gdscript_functions.cpp:803 - Can't establish server, error code: 20

Steps to Reproduce
Steps to reproduce the behavior:

  1. Open the test project
  2. See error Request for nonexistent project setting: gdunit/report/error_notification.

Minimal reproduction project:
test_project.zip

GD-71: Allow multiple fuzzers for one test case

Is your feature request related to a problem? Please describe.
It would be nice to use more than one fuzzer in a test case.
I want to write a test where i need different generated values by type and value.

Describe the solution you'd like

func test_foo(fuzzer1=fuzzerFoo(), fuzzer2=fuzzerBar()):
    assert_str(fuzzer1.next_value()).is_not_equal(fuzzer2.next_value())

GD-25: Unable to create a new test script when the script file is on res:// root

The used Godot version:
3.3.rc6

OS including version:
Ubuntu 20.04 x64 x11 GTX 1650M (proprietary drives)

Describe the bug
When using the context menu "Right Click" -> "Create Test" on a script that is on root folder (res://) it create a folder with the same name as the script and no error message is shown, but no new script is generated.

image

This issue was found while trying to reproduce another issue (#24)

Steps to Reproduce

  1. Created a new project
  2. Added a Node scene (Node.tscn)
  3. Attached a new script to Node scene (Node.gd)
  4. right-clicked on the _ready() function to create a new test

Minimal reproduction project:
test_create-test_project.zip

GD-41: GdUnit3 Command Line Tool

In order to use GdUnit3 to trigger a series of tests in an automated manner, a tool is required to run it from the command line.
The tool should have options to run custom sets of test-suites and / or tests and an option to explicitly exclude test-suites or tests.
The tool should generate a report that is HTML-based to show the results of the test execution.

Describe the solution you'd like
open a bash and run the tool like

runtests -add <directory> -exclude <test>

Describe alternatives you've considered
no alternatives

GD-48: Mock and spy fail on class with default build in types

The used Godot version:
Godot Engine v3.2.4.beta4.official
GdUnit3 v0.9.1-beta

OS including version:

Describe the bug
When i try to mock on a class where contains a function with default build in types the mock/spy is failing.

Steps to Reproduce
Create a simple test like this

class X:
	func foo(value :String, color := Color.red):
		pass

func test_mock_func_with_default_place_in_type():
	mock(X)

The run ends up with an error
Parser Error: Error parsing expression, misplaced: Built-In Type

GD-63: Inspector shows success for failing test when orphans are detected

The used Godot version:
Godot 3.3-rc

OS including version:
Windows 10, MacOS

Describe the bug
The icon indicator in the inspector shows wrong status of a failing test when orphans detected during test execution.
This only happens when the step 'before_test' contains orphans.

image

Steps to Reproduce

  • create a new test
extends GdUnitTestSuite

func before_test():
	# create a orphan node
	Node.new()
	pass

func test_ends_with_error():
        # simulate a test failure
	assert_int(200).is_zero()

GD-38: Unable to mock functions that uses variadic arguments

The used Godot version:
3.3-rc6

OS including version:
Ubuntu 20.04 x11 x64 Nvidia 1650M (proprietary drivers)

Describe the bug
When calling mocked function that uses variadic arguments using mocking mode CALL_REAL_FUNC, it fails, because the way mocked functions are current generated doesn't support variadic arguments.

Steps to reproduce the behavior:

  1. Create a mocked node using CALL_REAL_FUNC
  2. Attempt to call some function that uses variadic arguments, like emit_signal or rpc_id
  3. Remember to use parameters, like node.emit_signal("some_signal", var1, var2, var3)
  4. See error
    image

Minimal reproduction project:
test_project_varargs.zip

GD-81: Allow assert_that on not built-in types

Is your feature request related to a problem? Please describe.
I want to test against e.g. Color.red is equal Color.green.

# this line shows an error
assert_that(Color.red).is_equal(Golor.green)

'GdUnitObjectAssert inital error, unexpected type '

Describe the solution you'd like
assert_that() should allow to test against not built-in types

Describe alternatives you've considered
Workaround is to use str()

assert_str(str(Color.red)).is_equal(str(Color.green))

GD-30: Add check to verify if a signal was emitted

Checked the whole documentation and didn't saw any mentions about signals. At moment, is it possible to check if a signal was emitted or even if some object connected to anothers signals?

Anyway, loving the lib ❤️

assert_str(null).is_equal('blabla')

The used Godot version:
Godot-3.3.2

OS including version:
Mac OS Big Sure 11.4

Describe the bug

image

The output from assert_str(null).is_equal('blabla') is confusing.

The diffing somehow inserts <Nu and later > in 'b<Nulabla>'

Diff is done against **string value ** <Null> as colors shows. Same goes for a Dictionary but not for Node2D

I guess using assert_str with a non string value should not call internal _to_string().

What do you think?

Steps to Reproduce

Run the assert in a test.

	assert_str(null).is_equal('blabla')
	assert_str('apple').is_equal('blabla')
	assert_str({}).is_equal('another test')
	assert_str(Node2D.new()).is_equal('tes2ting')

Minimal reproduction project:

GD-86: Add a popup for update notification

Is your feature request related to a problem? Please describe.
It would be nice to receive a notification when a new GdUnit version has been released.

Describe the solution you'd like
When opening your project and the plugin GdUnit3 is activated we should get a popup info to be notified for updates.
This popup should contain

  • new version
  • changes
    The popup should have a checkbox to disable and be configurable on GdUnit settings page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.