-
-
Notifications
You must be signed in to change notification settings - Fork 22
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-205: Nested testing suits #205
Comments
Hi @batomow, if I understood you correctly, you have organized your tests incorrectly. A Test-Suite is a collection of test related to a single source. Best practice is to use the context menu on the source file and let GdUnit generate the Test-Suite and tests. Test-Suites should organized like: Please send me your feedback, maybe i understood you wrongly. |
Hmm A and B aren't different sources. Let me give you a concrete example.
So my testing suite looks like this
Which outputs tests like this.
The problem here is that I repeated a lot of code, I could use the before_test but the setup code for the first function could potentially interfere with the setup code of the second function and/or make the testing slower. Another work around is to make another testing suite or to make some setup functions that I would call before each test. But all of this is cumbersome. Now I usually do web development and I've used other testing frameworks, like jest, and this framework allows for grouping and nesting of the tests. Like so
So I thought it could be nice to have something like this in here. |
GdUnit3 is not designed to group tests at the moment.
If you have a specific set of test parameters, you can use a custom fuzzer to simplify the test code.
|
@batomow, is it ok to close this as clarified? BTW i have seen your comment about script parsing on godotengine/godot#33624 (comment) and if you interested you can improve the GdUnit3 script parser. |
Edit* Is very late at night here and my brain dont work propoerly haha, what i meant was: Yes I can help. Let me just update my comment on the other thread with the latest code. Yes close it as clarified, thanks! BTW. I tried implementing the following code to test my code structure and i got the error saying
|
Sounds good ;) |
close as clarified |
Now that im following unit testing best practices and aiming for higher code coverage i end up with lots of tests within the same suite, which makes it a little hard to read. I noticed that you can collapse the tests by their testing suite, I was wondering if there is a way to nest or group related suites.
So that the ui allows to go from this:
To this:
The text was updated successfully, but these errors were encountered: