bitwes

  • Dec 17, 2020
  • Joined Apr 4, 2016
  • 0 best answers
  • 7.1.0

    Tutorials: * https://github.com/bitwes/Gut/wiki/Tutorials

    Change Highlights

    See https://github.com/bitwes/Gut/releases/tag/v7.1.0 for full change log.

    • prerun_setup, setup, teardown, postrun_teardown deprecation warnings have been enabled.
    • Issue 230 assert_true and assert_false now only accept boolean values. They will fail with anything else.
    • Issue 70 Thanks to @short-story-long for adding "property" asserts assert_property, assert_setget, assert_setget_called.
    • Issue 66 Thanks to @nilold for adding assert_not_between.
    • Added compare_deep, compare_shallow, assert_eq/ne_deep, assert_eq/ne_shallow to aid in comparing dictionaries and arrays. See Comparing Things wiki page for more info.
    • Issue 201 Added pass_test(text), fail_test(text), is_passing(), is_failing() methods to test.gd.
      • No more assert_true(true, 'we got here')! Long live pass_test('we got here')!
    • Issue 184 Asserts in before_all and after_all are now formally supported. They will appear correctly in the output and asserts will be tracked in the summary.
    • Command Line now returns 1 if no sripts could be loaded.
    • Fixed various issues with parameterized tests. All test execution is now treated exactly the same, no more deprecation warnings(Issue195, Issue 196, Issue 197, Issue 202).
    • Issue 211 GDNative scripts cause Error calling built-in function 'inst2dict': Not a script with an instance when used in assertions.
    • Issue 231_ assert_is created an orphan.
  • I do use the Tools tag. I imagine people struggle with how to test their games as they make them so I was thinking the Testing tag could have some broad appeal.

    I'm on the fence about a TDD tag. I don't want my very own tag, hehe. There are two frameworks for Godot that I know of (GUT and WAT). I was thinking that the tag might increase visibility and get used more if it existed. TDD is a pretty well know design pattern but isn't widely used in game development...yet.

  • This tag would be for testing your game (automated or not), not so much for marking something as a "test build". In my case the tool is a Test Driven Development framework that allows you to write unit and integration tests for your game.

  • Can you add a tag for "Testing"? I was looking for a TDD or Testing tag when creating my latest release post for the GUT tool. TDD is probably too specific and wouldn't get much use but a Testing one might.

  • RichTextLabel has get_selection_text()

  • Version 6.6.2 of Gut (Godot Unit Test) released. Doubling, Spying, Stubbing is no longer experimental. You can double Inner Classes now. The "double" method is now super smart and more intuitive to use. A bunch of spelling corrections and a bug fix. New Doubling Strategy experimental feature which allows you to spy on methods from Godot Built-ins you didn't implement. https://github.com/bitwes/Gut/wiki/Doubles Rainware made a setup tutorial to help get you testing faster:

    https://github.com/bitwes/Gut https://github.com/bitwes/Gut/releases/ https://github.com/bitwes/Gut/blob/master/CHANGES.md https://github.com/bitwes/Gut/wiki

    Feedback and Pull Requests always welcomed. Happy testing everyone!

  • @ugly_cat said: Fantastic tool! I set up a little CI pipeline using Drone and Git Tea that automatically runs GUT tests every commit. Maybe a little excessive for my one person project. :smile:

    That's fantastic! Well done.

  • Version 6.1.1 Released. Please upgrade, possible big issue.

    Issue 95 is a doozy and can clear files in res://. I haven't seen this happen in the wild but it did happen a couple times when running the the Gut test suite and only when running the doubler tests (test_doubler.gd).

    Evidently I got lazy and forgot to check output from opening a directory.

    var dir = Directory.new()
    dir.open(_output_dir)
    <delete everything in dir>

    Here's what I should have done:

    var d = Directory.new()
    var result = d.open(_output_dir)
    if(result == OK):
        <delete everything in dir>

    The error resulted in the directory opened being res:// which I then proceed to delete all the files in the root of the project. The error returned was 31 and I'm not 100% sure why it happens but I figured I could sort that out after the fix was up.

    Always check those returns.

    Release Notes: Issue 60: Improved signal assert failure messages in some cases by having them include a list of signals that were emitted for the object. Issue 88: Fixed issue where you couldn't specify the config_file from the command line. * Issue 95: Fixed issue where sometimes Gut can end up clearing files from res:\\ when using doubling.

  • The latest version of the Godot Unit Testing tool has been released. There's some bug fixes, a maximize option and 2 brand new asserts assert_almost_eq and assert_almost_ne for all your ranged assert needs. Thanks to all those contributed PRs.

    It's live on Github, the new version has been submitted to the Asset Library and should be up in a day or so.

    https://github.com/bitwes/Gut/blob/master/CHANGES.md https://github.com/bitwes/Gut/wiki https://github.com/bitwes/Gut

  • Another Gut release (6.4.0). This one introduces Spies and fixes a dumb mistake with original doubles implementation. There's also a new assert and a couple command line options. Thanks goes out to Myrkeim and cmfmcf for their PRs.

    I've been dog fooding this release in my own game and I like where it's heading. Doubling, stubbing and using the new spy asserts has helped me remove some dependencies from tests and made my unit tests more unit-like and less integration-like.

    I've also been having a lot of fun creating Inner Test classes for better organization of my test scripts. Inner Test classes were introduced in the last release and I'm already not sure how I made it this far without them.

    I'd love to hear any feedback. As always...happy testing everybody.

    https://github.com/bitwes/Gut https://github.com/bitwes/Gut/blob/master/CHANGES.md https://github.com/bitwes/Gut/wiki

  • Gut 6.3.0 released.

    The readme has been converted to a wiki for easier consumption.

    You can now have Inner Test classes. This helps organize your tests better in a single test script. It allows you to have multiple contexts for your tests. No more making one setup that works for 100 different unrelated tests. Now you can have 10 Inner Test classes in one script. Each with their own setup/teardown/variables etc.

    Experimental Doubles and Stubs. I'm really excited about this feature but I don't know how right I got it. Looking forward to hearing people's thoughts.

    There was another reorg to the repo, this should be the last. If you have a tool in the Asset Library, and don't know about the .gitattributes file...check it out. It can keep files out of the zip that Github generates which makes distributing your tool MUCH easier for you users, especially when installed directly from the editor.

    More info at: https://github.com/bitwes/Gut/blob/master/CHANGES.md https://github.com/bitwes/Gut https://github.com/bitwes/Gut/wiki

    As always, happy testing everyone!

  • I was just introduced to the .gitattributes file. This file lets you stop files from being exported when Github makes the zip file. Now everything can live in the repo but not be deployed and everything is wonderful.

    example:

    /templates export-ignore

  • I've used call_group to accomplish a similar thing. All the objects have to belong to the group you specify, but you can easily call a method on all the objects in the tree that are that group.

    Here's how I update the speed on all the "traffic cars" in my game. get_tree().call_group_flags(0, _g.TRAFFIC_GROUP, 'set_speed', new_speed)

    I don't know what the 0 does, but in all the places where I'm using it, I pass 0. You can use call_group instead of call_group_flags I think, then you don't have to pass 0. Everything after the 3rd parameter gets passed to the method that is called. So you can actually pass any number of parameters to call_group_flags

    Disclaimer: I'm actually using call_group and passing 3 things but I think that is a bug in my code that is leftover from porting to 3.0. I have to fix it but didn't want to hold up this response while I re-test my entire game.

  • Version 6.1.0 Released

    Some bug fixes and some reorg of the repo so it is a little easier to handle when installing from in-engine AssetLib. No breaking changes.

    New Features: Summary now lists all failing/pending tests and the reason for the fails. No more scrolling back through all your tests to see exactly what went wrong. New yield_to method that allows you to yield to a signal or a maximum amount of time.

  • Thanks for running a great forum. Sorry I kept making G.U.T. posts for each release I had. I didn't much care for getting yelled at for doing that but I was VERY impressed that someone was paying that much attention. Well done keeping the community in shape and making the forums as productive as possible.

  • Less than a minute after posting I found get_instance_id and instance_from_id. This worked flawlessly. I was able to write my script to do something like:

    func get_that_external_obj():
      return instance_from_id(123)