croconut / godot-tester

A Github Action to handle testing Godot applications with GUT
MIT License
36 stars 14 forks source link

CI run fails: .stex files missing #17

Closed nightblade9 closed 2 years ago

nightblade9 commented 2 years ago

There's something odd about my Godot project. Whether I download/invoke Godot through my own bash scripts, or via this command, the tests hang, and early on, I see this message:

ERROR: Failed loading resource: res://.import/protagonist.png-bc286cb64aca4b0378c3f1855cbf21b8.stex. Make sure resources have been imported by opening the project in the editor at least once.

I can reproduce this locally on Windows with the Ubuntu shell; the file is there, on disk, and running the same command again, doesn't cause that error to appear. It looks like - for some reason - running Godot twice, would solve this. (I tried increasing the import-time value, but that doesn't seem to do anything.)

Am I doing something wrong? Any ideas how I can get this working?

croconut commented 2 years ago

you're not doing anything wrong, i'll see if i cant fix this

nightblade9 commented 2 years ago

I don't think it's a bug in godot-tester. When I had a bash file that downloaded the Godot executable and run the editor manually, it resulted in the same behaviour.

croconut commented 2 years ago

yeah interesting. well its not a bug on my end, or GUTs, but i found ways to potentially work around this, so i'll try to fix it.

this is straight up just not working consistently in godot CLI yet https://github.com/godotengine/godot-proposals/issues/1362 but i'll be implementing one of their solutions here.

specifically looking at this https://github.com/godotengine/godot/pull/39396#issuecomment-641283026 im guessing you're testing image data / using code that requires image importing, you may be able to get around this with standard .load() importing?

btw if it takes a long time to import, you may be better off using git LFS and committing all the .stex files

nightblade9 commented 2 years ago

BTW, I found this repo, which allows you to clone and use a container with Godot pre-installed (Mono and GDscript versions separate), you might want to look into it. It would save you from having to download Godot in your entrypoint.sh script.

Adding the .import directory to Git resolves that error, but I get other errors, and the build hangs (doesn't look like tests are running). Those look something like this:

ERROR:  does not have a library for the current platform.
   at: init_library (modules/gdnative/nativescript/nativescript.cpp:1486)
WARNING: Not a PNG file
     at: check_error (drivers/png/png_driver_common.cpp:56)
ERROR: Condition "!success" is true. Returned: ERR_FILE_CORRUPT
   at: png_to_image (drivers/png/png_driver_common.cpp:69)
ERROR: Error loading image: res://assets/images/ui/skills/more-gems-monochrome.png
   at: load_image (core/io/image_loader.cpp:68)

Of these, I can confirm that res://assets/images/ui/skills/more-gems-monochrome.png exists and is a valid PNG file. I'm also not assigning images using load or preload anywhere - as far as I know, I only ever use sprites, tilemaps, texturerects, etc. and directly set the texture in the editor (e.g. tilesets).

croconut commented 2 years ago

i've already written up a container generator in godot-images, just havent implemented it here yet as it's incredibly annoying to do in github actions.

croconut commented 2 years ago

hmm well i appear to have fixed the import issue. that one looks really funky, is your repo public?

nightblade9 commented 2 years ago

No, unfortunately, it's private.

croconut commented 2 years ago

theres a possibility the test runner just isnt big enough. in that case you may want to use self hosted test runners or compress that file. this issue looks potentially similar: https://godotengine.org/qa/85443/error-loading-texture-to-sprite-node

my last godot-tester based solution is going to be for you to try deleting the .import folder and try again with @master or @2.5 dunno what that'll do for you though.

if you can create a minimal reproduction godot project i'll look into it again, but im closing this issue as i've fixed the import issue as far as i can tell.

nightblade9 commented 2 years ago

Still broken for me. I'll go back to running it from scratch, thanks though.