From 64cc9c2b64a0ea1a1c1b7a6c1de82563a5ff3d15 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Thu, 12 Sep 2024 19:02:35 +0200 Subject: [PATCH] Use factorioDir for alt-host config Source the factorio installation from the host config for the alt host test like with other tests. --- test/integration/clusterio.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/clusterio.js b/test/integration/clusterio.js index c8225b84..d2f09f47 100644 --- a/test/integration/clusterio.js +++ b/test/integration/clusterio.js @@ -13,7 +13,7 @@ const { wait } = lib; const testStrings = require("../lib/factorio/test_strings"); const { TestControl, TestControlConnector, url, controlToken, slowTest, - get, exec, execCtl, sendRcon, getControl, spawn, instancesDir, + exec, execCtl, sendRcon, getControl, spawn, instancesDir, factorioDir, } = require("./index"); @@ -41,7 +41,8 @@ async function startAltHost() { await execCtl(`host create-config --id 5 --name alt-host --generate-token --output ${config}`); await exec(`node ../../packages/host --config ${config} config set host.tls_ca ../../test/file/tls/cert.pem`); await exec(`node ../../packages/host --config ${config} config set host.instances_directory alt-instances`); - await exec(`node ../../packages/host --config ${config} config set host.factorio_directory ../../factorio`); + const dir = path.isAbsolute(factorioDir) ? factorioDir : path.join("..", "..", factorioDir); + await exec(`node ../../packages/host --config ${config} config set host.factorio_directory ${dir}`); await exec(`node ../../packages/host --config ${config} config set host.mods_directory alt-mods`); return await spawnAltHost(config); }