What is the current state of GitLab
Continuous Integration testing in Godot 4?
#295
-
I was curious about the state of Docker-CI. I am using the Barichello-CI docker image, which is specifically mentioned in the docs. I tried running the scripts from the faq, but I got an error regarding DisplayServerX11. That's fine, I just want to run unit tests against my functions in my scripts, I'm not actually testing anything within a scene. I tried adding the
This seems like a very intentional failure mode, and it sounds like the problem is with Godot itself, but I was wondering if there are any possible workarounds. Again, I just want to write unit tests against my own code, I'm not interested in integration tests or testing in-scene behaviors like pathfinding, etc. I am writing functions like If Godot is just broken for CI, then is there a bug report that I can go throw my support behind? I'd love to be able to use this tool as a part of my CICD pipeline, but I haven't gotten it to work yet. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Hi, CI is fully functional, look here to see my workflows, your problem is the Docker image you are using.
Means you need to install in addition the missing X11 libs. I personally do not use the docker image anymore, it is just simpler to download and cache the specific Godot version instead of downloading and running the full image. At least, you need to run the test script it with a display server. And it is also important to update the project about the Godot cache issues
From the documentation, it needs to update the GitLab CI example. I have no GitLab account to verify, it would be nice when you adapt the GitHub CI and give me a link to it. |
Beta Was this translation helpful? Give feedback.
-
Hi, I was wondering if I could followup with this, and hope someone else came up with a working solution. I've been banging my head against the wall for a couple of days trying to get unit tests to work in a pipeline flow for a new project, using GitLab, and have had zero luck with it as well. I started w/ the error mentioned above, and after trying to follow the same flow provided in the above github links, I run into other issues (using ubuntu:22.04 docker image). To start with, here's my current (WIP) gitlab-ci.yml script. Note that I had to add a bunch of libx libraries to get rid of a bunch of errors related to some libraries apparently missing:
Depending on the Godot version I run, I get one of two problem outputs. Running with v4.2.1 results in the following:
Running the older v4.0.3 results in the following error looping indefinitely (have to force kill the job), which interestingly enough shows in the 4.2.1 release but only once - not forever:
I'm running out of ideas on how to get this to work.... Would love any assistsance anyone may have on this, and whatever the solution is, should probably be updated onto the docs. |
Beta Was this translation helpful? Give feedback.
-
Ugh, I guess it was a rubber ducky situation. Spend forever on it, finally get a fix shortly after asking for help. For anyone who wants to get this thing working in their gitlab-ci, here's my current yaml which appears to be working. 1000% open to cleanup suggestions (I know - godot install is during import-assets...), especially since it's kind of slow as it's pulling software down (couldn't find an existing ubuntu docker image that had all these libraries/tools already built). I went with using both ubuntu:22.04 and godot-ci:4.2.1 in my case due to the export templates, but wouldn't mind hearing of a solution to make it a global ubuntu:22.04 image instead so I only have to change one variable. Future plans would be to integrate this into gitlab pages and junit (or just show the html page that's already given as a result). Would love to know how to get code coverage reports... Is that possible with gdunit4? Haven't looked into that much yet for it :) Anyway here it is:
|
Beta Was this translation helpful? Give feedback.
-
Hi, i just wounder why you need to install in addition the My workflows just do
|
Beta Was this translation helpful? Give feedback.
-
The godot-ci was only for the builds if I wanted them (in my case, only for tagged builds with version numbers). I didn't need it for the unit tests or cache. For the test stages, The ubuntu:22.04 docker image doesn't come with xvfb or any other libraries needed with it which is why I had to install those on it. I'm guessing whatever github uses already comes with that stuff pre-installed or something. The reason I went with just using godot-ci was because the following error shows up in the pipeline when attempting to create a build with just the regular linux binary:
The godot-ci already has these installed, so I was able to just grab them that way to have a successful build. |
Beta Was this translation helpful? Give feedback.
Hi, CI is fully functional, look here to see my workflows, your problem is the Docker image you are using.
Means you need to install in addition the missing X11 libs.
I personally do not use the docker image anymore, it is just simpler to download and cache the specific Godot version instead of downloading and running the full image.
See …