utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
560 stars 38 forks source link

Fix GUT tests #631

Closed chippmann closed 1 month ago

chippmann commented 1 month ago

Our GUT setup was beyond broken. The main reason it kept somewhat going was because we committed the .godot folder which had everything cached for the CI/CD to be happy.

But we have a problem with Any types from kotlin withing GDScript which broke many tests (we just didn't notice) and some tests did not run at all.

This "fixes" the Any issue by simply downcasting any problematic class from kotlin into Object so GDScript needs to rely on ducktyping to call the corresponding methods. This does not solve the issue but it let's our tests run. This issue needs to be investigated and properly fixed but not as part of this PR.

This PR also removes the .godot folder (which we only added at the start of transitioning to godot 4 as godot at the time had quite big import problems). Now we just do an import before we run the tests.

If you now want to test locally, please consider the setup instructions in the newly added readme. The problem is the same as described here: https://mikeschulze.github.io/gdUnit4/faq/solutions/#scriptresource-errors-after-the-plugin-is-installed (link is for GDUnit but GUT suffers from the same problem)