Giter VIP home page Giter VIP logo

wat's Issues

CLI Memory Output

When you run the CLI and use yields, it may complain about memory not being freed. This is likely because we are quitting once we're finished which isn't what the GUI does. Might require a simple check on PREDELETE NOTIFICATIONs.

Add Error Handling

Create a system to push errors and warnings to the Player. We should prefix the error with the source script + line along with the fact that it comes from WAT.

stable is not stable

I've created a stable branch which does work but I don't consider it a true stable branch. This is just some prep for the next release. Once I have my first true release, I'll close this issue (which is only acting to serve as a reminder).

Add Asserts that cancel tests on fail

Asserts, unlike expectations, will be used in fixtures (start, pre, post, end) to help ensure certain things are in place for all of the tests. If an assert fails, it will crash/skip the test script/method because the prerequisties are no longer in order.

Seperate Result Calculation from Display.

Right now we calculate a number of things about result lists in the display script itself which leads to an odd, somewhat recursive-lite style code that can be confusing.

Instead we could maybe create a middle-man script that stores all of that data in a struct.

Easy to forget about resume calls after yield

Had a bug where my tests hung because I forgot to call "resume" after the yielded test method. Most obvious solution to this is to make a yield manager that stores yields, pop them on finish (and frees them) while also resuming if no yields left on test.

.... Progress Line hangs on Yielding.

When running tests, you will see a line go up and down in 10 dots. This works fine except for when we're yielding in code. One way is to maybe consider running it in a different thread but maybe other alternatives also exist.

Plugin Crashes When res://tests Directory Is Missing

Problem:

Trying to activate the Plugin without a tests folder in your project results in Godot crashing.

Recreate Problem:

  • Create a new Project
  • Import the Plugin using GIT (not asset library)
  • Activate the Plugin
  • You will receive the Error "res://tests missing"
  • Godot will Close

Workaround:

  • create the folder "tests" in the root of your project

  • activate the Plugin

  • create

Save Test Results

We should be able to save test results in a resource script (if toggled as an option). We can then further use these to track any differences between changes by comparing new results against previous ones. Possibly even adding a counter along with them.

Add Reset Plugin to clear dead data

When I mess with the UI elements of WAT (or sometimes testing servers) WAT goes crazy so I need to fix it via unload - reload. We should add a button to handle it automatically.

Prevent Yields from holding tests up

Some scripts being tested may be waiting for a yield, some of these yields may never be called so we need a way to cancel them after an expected time.

WATemp is created on plugin load only

Trying to set up Docker/CI for WAT I ran into the issue of WATemp not existing. This is because it is only created when you load the plugin, not when you run the tests. Which causes problems with automated git hooked tests.

Offer easy way to hit breakpoints in unit tests

Problem: Hitting a breakpoint in a unit-test is currently not possible through the WAT interface.

Potential solution: I suggest adding a "Debug selected X" button somewhere in the interface that would launch a godot scene running the selected tests (either script or directory, like the current interface)

This would allow the use of in-built godot breakpoints without the users having to create custom debugging scenes.

Add Generic Creation Method

Basically sometimes you need to create an object to suit a purpose and that object needs data. We take in the object script/class, read what it needs, populate it, then return it back up to the test so it would read:

var object = _create_junk_object(object.klass)

Running scene_director.test.gd causes Linux to segfault occassionally.

Sometimes when running the bootstrapped test scene_director.test.gd (either with other tests, its own directory or itself).

It seems this could be caused by trying to free an already freed reference OR by trying to remove a file too quickly/too many times.

It is a pretty specific issue so it probably isn't worth worrying too much overall so I'm just writing this issue to keep myself reminded of it in future.

Autoloads Are Not Recognized When Running Tests

I have an Autoload Script that does not appear to be loading before the Tests begin to run. I am trying to create a sample project for you but I thought I would report it anyway first.

I will update this with more information when my sample project is ready for you.

Refactor Tree Display

This code is messy and unclear but I haven't figured a better way to name it yet due to its recursive nature. We could possibly add more implementation details to the result object instead of display.

Capitalized folders on Linux.

I've just downloaded version 3.0 and got an error message while trying to run a test. It turns out that the script runner.gd had at line 7 the following code:

const COLLECT = preload("res://addons/WAT/runner/collect.gd")

I had to change it to:
const COLLECT = preload("res://addons/WAT/Runner/collect.gd")

Because of Linux. I see that in the newest commit code there is the same problem of capitalized paths.

Double Inner Classes

This was too complicated to handle for the Alpha. It requires quite a bit of instancing/re-instancing and complicated parsing.

Implement Fluent Assertions

Basically change expectations that exist now to fluent assertions.

ie

asserts.has(value, container, context)

we would do

asserts.collection(collection).has(item).give_context("string")

or something like that.

Master is now at 3.2 status

I'd imagine since 3.2 shouldn't be a breaking change, that master should just default to it instead of a separate branch. Keeping this here as a reminder.

Add Precondition Assert

The idea here is that some preconditions must be met before our primary assertion is. However we don't want to write:

asserts.thing(precondition)
execute_test():
asserts.thing(postcondition)

The typical way around this is to store the precondition state in a variable like this:

var precondition = object.method()
execute_test()
asserts.thing(precondition)
asserts.thing(postcondition)

What I could do is create a precondition interface. This would essentially show up similar to asserts but it would specifically only show on failure to avoid any cognitive overload.

check(precondition, "X must be true")
execute_test()
asserts(condition)

Alternatively we could have precondition crash the test there if it is required.

Add Logging System

Add a comprehensive optional logging system that logs everything correctly, outputs to the console and has different levels of output.

Run All/Run Dir buttons freeze (animation only)

The first time you load the editor, the run all or run dir buttons seem to freeze (This is probably due to loading resources). They also seem to intermittently freeze up occasionally.

This is animation only. Their functions don't freeze (thankfully).

Broken tests are shown as success

Sometimes a test breaks and an error is produced. This also means the test never got to run so it has completed 0 of 0 test methods. Should add in a default fail state to handle this.

Add Test Subdirectories

Add an option for additional subdirectories being tested. This allows for different series of tests to be run for different circumstances. The more obvious example would be integration, end-to-end style of tests.

Also need to consider directories within directories, if the first dir is for the test type, the sub-subdirs will be for different configurations.

Change Test Folder

Apologies if this exists somewhere but I did not see it, nor did I find on the Wiki.

Please add the ability to specify the root folder for test scripts. I have several project where the tests are located in folders called

my_project_tests
another_project_tests

this lets me keep things separated and organized.

Ideally this would be a modifiable somewhere in the Project Settings.

filesystem.gd returns paths with two forward slashes between directory and file name

Description

When filesystem._list is called, the paths that it returns are like res://path/to//filename.gd. This caused a few problems when I tried to load the templates to copy them.

Possible Fix

In filesystem.gd at line 27 -

var absolute_path: String = "%s/%s" % [path, name]

here, the / between the two %s could be removed, but when I tried that, WAT.tscn kept causing the editor to crash and the error message indicated cyclic reference.
The crashes happened if the addon was enabled, if the scene was opened or if the scene was run (in this case, only the preview window crashed).

Warnings Spam Output

Not an issue for me personally but it seems to spam the output of anyone using. Need to ignore everything with WAT itself manually with the #warning_ignore comments.

Add Command Line Interface

Add a CLI so people can run and see tests from their CL. Make sure to allow for windows, linux & mac.

Possible Autoload Solution

See #32 and #42 for related discussions.

The primary issue with Autoloads is that they don't seem to be instanced during tests (and or on the same tree?) However we seem to be able to call:

EditorPlugin.new().add_autoload_singleton("AlreadyExistingName", "res://AutoLoad.gd")

With no issues and it works inside tests? On that note however, "remove_autoload" will take it away from the current test and the entire project too so avoid that.

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.