Skip to content

GUT test framework integration#35

Merged
marcinn merged 1 commit intomainfrom
dev/gut-tests
Dec 26, 2024
Merged

GUT test framework integration#35
marcinn merged 1 commit intomainfrom
dev/gut-tests

Conversation

@carmel4a
Copy link
Contributor

@carmel4a carmel4a commented Dec 4, 2024

Adds GUT framework.
Requires #60 to be merged first.


Tests should inherit from MaszynaGutTest due to lack of wait_idle_frames() bitwes/Gut#675


@carmel4a carmel4a requested review from JezSonic and marcinn December 4, 2024 17:31
@marcinn

This comment was marked as outdated.

@marcinn marcinn self-assigned this Dec 4, 2024
marcinn

This comment was marked as outdated.

@carmel4a
Copy link
Contributor Author

carmel4a commented Dec 4, 2024

Please include GUT addon as a submodule (or something else)

@marcinn we need to discuss that, details on Discord.

@carmel4a carmel4a marked this pull request as draft December 4, 2024 20:02
@carmel4a carmel4a self-assigned this Dec 4, 2024
@marcinn

This comment was marked as outdated.

@marcinn marcinn force-pushed the dev/gut-tests branch 3 times, most recently from 09faeb7 to 0bee2d5 Compare December 14, 2024 16:34
@marcinn
Copy link
Member

marcinn commented Dec 14, 2024

@carmel4a I'll split commits not related to GUT to a separate PR's. It is easier to maintain the project when PR's are as atomic as possible

@marcinn
Copy link
Member

marcinn commented Dec 14, 2024

This branch requires #60 to be merge.

@marcinn marcinn force-pushed the dev/gut-tests branch 2 times, most recently from b1f342c to 4f9afe4 Compare December 15, 2024 01:57
@marcinn marcinn mentioned this pull request Dec 15, 2024
@marcinn marcinn force-pushed the dev/gut-tests branch 5 times, most recently from 2e6637b to 67d41ad Compare December 15, 2024 17:49
@marcinn marcinn marked this pull request as ready for review December 15, 2024 17:52
@marcinn marcinn requested a review from JezSonic December 15, 2024 17:52
@marcinn
Copy link
Member

marcinn commented Dec 15, 2024

@JezSonic I've made some crucial changes to the code initially proposed by @carmel4a:

  • GUT added as a submodule
  • Scons creates a proper copy of the GUT (not symlink) to the demo project
  • There is a Dockerfile which is used by Github CI to run tests, but you can use it to run it locally, too (shortcut is in the Makefile)
  • First tests are more accurate and fully useful - they're not just examples
  • MaszynaGutTest adds wait_idle_frames helper, which isn't available in GUT but will be crucial for many of our tests
  • I've added GitHub Action with caching docker image layers (but the image doesn't need to be pushed to any hub)

IMPORTANT NOTE: Before merging this PR a #60 should be merged first. I've built this branch top of reorganize-repo branch because of issues related to building the project. In the other words: this branch contains same commit as #60.

ALSO please note that this PR includes some fixes of the TrainController. The tests I added detected these issues! :)

Comment on lines 16 to 24
COPY SConstruct ./SConstruct
RUN scons

# Copy project files
COPY addons ./addons
COPY src ./src
RUN mkdir -p demo/addons demo/bin
RUN scons

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scons runned twice without need for that

Copy link
Member

@marcinn marcinn Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be run twice. Every docker build command creates a new layer (overrlayfs), which can be cached. First run is compiling godot-cpp. The second is compiling our code and linking them together, saving the result in a new layer.

Copy link
Member

@JezSonic JezSonic Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that you can use cache from scons builds for Godot cpp there tho, so docker wont need to build it at all if the cache will exist

@marcinn marcinn force-pushed the dev/gut-tests branch 2 times, most recently from 6aec61e to 6d48880 Compare December 17, 2024 20:01
Co-Authored-By: Marcin Nowak <marcin.j.nowak@gmail.com>
Co-Authored-By: Kamil Lewan <kamil.lewan97@gmail.com>

* Dockerfile for executing tests
* GitHub workflow action
* Example test
* Added maszyna_debug=on|off to toggle libmaszyna internal debug macros
* FIX: Mover's initialization routine in TrainController
@marcinn marcinn merged commit a3820b3 into main Dec 26, 2024
6 of 7 checks passed
@marcinn marcinn deleted the dev/gut-tests branch December 26, 2024 10:35
@marcinn
Copy link
Member

marcinn commented Dec 26, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants