Page 1 of 1

Add "test" option/mode to headless server

Posted: Sat Jan 25, 2020 6:06 pm
by bNarFProfCrazy
Summary:

I would like to automate the tests for my mod using github actions and also locally.
Therefor I need to be able to launch the game with my mods and validate that they are still working after my commit.

-----------------------
Details

I am a software developer myself and I feel unsafe if there are no automatic tests.
Therefore I would like to launch the game/headless server multiple times with different mod-sets to ensure they work well together.

IIRC in one of the FFFs you mentioned your test suites, but I couldn't find any command line parameters that allows me to run the tests and exit.
Or one a more simplistic level: Only validate the data (+images+translations)
https://wiki.factorio.com/Command_line_parameters

Maybe something like this:

./factorio --mod-directory=only-my-mod --check-unused-prototype-data --validate-and-exit --ensure-locale=en,de,fr
./factorio --mod-directory=test-set1 --validate-and-exit

--validate-and-exit:
Validates that all prototypes are valid and could be loaded by the game.
Also checks the presence of the images that are referenced in the data.
If all data/prototypes could be read the game will exit with errorcode 0,
if one or more data/prototype is broken the game will exit with errorcode 1

--ensure-locale=[Languages]
A comma separated list of languages, that should be checked for their locale completness.
If validate-and-exit is set and a locale entry is missing, then the game will exit with errorcode 2.

--check-unused-prototype-data
[...]
If validate-and-exit is set and there is an unused prototype-data, then the game will exit with errorcode 3.