faketorio icon indicating copy to clipboard operation
faketorio copied to clipboard

Run factorio in headless server mode

Open terite opened this issue 6 years ago • 1 comments

For CI systems like travis it's difficult to get the full client for a couple reasons

  • One needs to be logged in to download the full factorio
  • Downloading 800 megabytes repeatedly from Wube servers would be slow (and lots of traffic)
  • re-hosting the full version of factorio on an easier to access host seems like trouble

It would be nice if there was a way to run tests against the headless server. I got this working locally by doing the following

  • call factorio.run() on the first tick
  • intentionally error(...) after all specs have run to stop (crash) the server
  • use --start-server instead of --load-game
  • use a modified server-settings.json that does things like disabling matchmaking and auto-pause

The only major issue with this approach is that it's not possible to get a player in game. This means no GUI testing, or testing of anything that relies on a player.

The benefits are pretty nice however

  • completely automated testing is possible
  • quicker game loading
  • easier to set up on CI.

terite avatar Jun 29 '18 18:06 terite