-
Notifications
You must be signed in to change notification settings - Fork 94
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: How to skip Input tests which fail under --headless? #598
Comments
Ah, found an answer to point 1 in https://gut.readthedocs.io/en/latest/New-For-Godot-4.html#what-s-new-changed-in-gut-9-0-0-for-godot-4-0 and sorry for not seeing it before.
|
Well, I was just impatient. Below approach seems to work well enough and this could be just a documentation issue.
|
Unfortunately, I think GUT only looks to see if the var exists, not the value. Which means you have to comment out all that code if you want to run those tests. Adding a check to see if it has a value and only skipping when not null would be a solution, but a more concrete structure would be better. One approach might be to put all your input tests in a different folder and make another gut config to use for headless which does not include that folder. You can specify the gut_config file to use in the command line. |
Line 706 in a627250
|
Yea, that's the only one. I thought I was doing a This isn't how I envisioned this feature working but I really like using it that way. The only potential issue I see is using So maybe the GUT should check for |
My original idea with I never really liked how "magic" it was. "Oh, I just declare a variable and then something different happens?...ok". I probably shouldn't have documented its existence, heh. I think a more formal solution for conditionally skipping scripts would be to create a virtual
Additional benefits of this approach
|
If opting for a bit more design, I wonder whether there's one approach that can work for both complete scripts and for individual inner classes. |
We could add a should_skip_file which would skip the script and any inner classes, so no tests run in the entire file. You could also make your own script class that extends GutTest that has should_skip_script implemented and extend that instead of GutTest to "auto skip" a script/inner. |
I am testing some detailed input handling and the tests work as expected from both the editor and the command-line without the --headless option. However, these fail when headless, probably for the reasons explained in comments in godotengine/godot#73557 .
Accepting this engine behavior, I'm now looking for:
I found @russmatney's comment in #360 useful for point 2, but was hoping in the meantime someone had found a better way.
TIA!
The text was updated successfully, but these errors were encountered: