-
Notifications
You must be signed in to change notification settings - Fork 20
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
Question about using WAT as an API at runtime #230
Comments
It has been a while since I've done it but it should be possible (barring any recent regressions)
Not at the moment. I'm unsure on what this would look like. Run me through bit of an example of a jump test. I'd imagine we're thinking something like
|
Yes, that would work. In practice, currently, my test looks like this: func validate(scene: Node, _script_text: String):
if not verify(InputMap.has_action("jump"), "no jump action"):
return
var player = scene.get_node("Player")
var position = player.position.y
Input.action_press("jump")
yield(get_tree(),"idle_frame")
yield(get_tree(),"idle_frame")
if not verify(player.position.y < position, "player's y didn't increase when pressing jump"):
return
emit_signal("validation_completed",[])
func verify(statement, message: String) -> bool:
if statement:
return true
emit_signal("validation_completed", [message])
return false Where |
So I ripped out the absolute core guts of WAT to reframe it into a simple API that you can check here. https://github.com/AlexDarigan/WATApi Basically all of the assertions go into an Autoload that emits an event after an assertion result is calculcated, your custom display subscribes to these messages and then does whatever it needs to do with the messages. This is missing a number of other features from the core WAT project, so if there is any in particular you'd like to have in addition to this, let me know. |
Oh this is very cool! Looks neat. Thanks! The project is on pause now; we've made the proof of concept, we'll be looking at funding. If it does pick up, I'll almost certainly get back to you with more questions. In the meantime, I'll play with WATApi, thanks again :) |
Reopening unresolved issue. I can achieve this using TCP Sockets* and the use of minimal "Test Driver" clients that attach to the Scene Under Test. *The sockets might need some configuration for online networking and security but the idea exists. |
We're building a live editor for Godot which runs in the browser and validates custom user code
We have the editor part working (tweet of the early proto), with error reporting and so on, and we're now deciding how to implement validation.
I'd have two questions:
An example case:
The text was updated successfully, but these errors were encountered: