From dfe132699e7d06304c530d45e904e955e18ea983 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Fri, 26 Jun 2026 15:38:29 +0000 Subject: [PATCH] Add integration test for starting an instance with a release channel Configures an instance with the "experimental" channel and starts it, exercising channel resolution end to end across the controller and host. The resolved version may or may not be installed depending on the host's Factorio install, so the test asserts the instance reaches a terminal state rather than a specific outcome. Co-Authored-By: Claude Opus 4.8 (1M context) --- test/integration/clusterio.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/integration/clusterio.js b/test/integration/clusterio.js index e44f673d..f1aa80c5 100644 --- a/test/integration/clusterio.js +++ b/test/integration/clusterio.js @@ -704,6 +704,28 @@ describe("Integration of Clusterio", function() { await execCtl("instance config set 44 factorio.version latest"); } }); + it("should resolve a release channel target when starting", async function() { + slowTest(this); + try { + // "experimental" is resolved to a concrete version through the + // controller's latest-releases data before the server starts. + // Whether that version is installed (or downloadable) depends on + // the host's Factorio install - CI uses a fixed direct install - + // so the start may succeed or fail, but the channel must resolve + // and the instance must reach a terminal state rather than hang. + await execCtl("instance config set 44 factorio.version experimental"); + await execCtl(`instance ${cmd} test`).catch(() => {}); + const status = (await getInstances()).get(44).status; + assert( + ["running", "stopped"].includes(status), + `instance stuck in unexpected state '${status}'` + ); + + } finally { + await execCtl("instance stop 44").catch(() => {}); + await execCtl("instance config set 44 factorio.version latest"); + } + }); it("should not leave the instance in the stopping state if it fails", async function() { slowTest(this); try {