mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
Fix integration tests requiring internet to work
When factorio starts up with with the require_user_verification setting turn on it tries to obtain a server padlock from the matchmaking server and will fail if this does not succeed. Turn off user verification and public visibility which require user verification both of which are on by default for the integration tests so that they work without internet.
This commit is contained in:
1 parent
5b78a86166
commit
55f3dac9b6
2 files changed
+14
No files matched your search
@@ -123,10 +123,18 @@ describe("Integration of Clusterio", function() {
|
||||
|
||||
describe("instance create", function() {
|
||||
it("creates the instance", async function() {
|
||||
this.timeout(6000);
|
||||
await execCtl("instance create test --id 44");
|
||||
let instances = await getInstances();
|
||||
assert(instances.has(44), "instance was not created");
|
||||
assert.equal(instances.get(44).status, "unassigned", "incorrect instance status");
|
||||
|
||||
// Make sure the following tests does not fail due to not having internet
|
||||
let value = JSON.stringify({ lan: true, public: false }).replace(
|
||||
/"/g, process.platform === "win32" ? '""' : '\\"'
|
||||
);
|
||||
await execCtl(`instance config set-prop test factorio.settings visibility "'${value}'"`);
|
||||
await execCtl("instance config set-prop test factorio.settings require_user_verification false");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -103,6 +103,12 @@ describe("Integration of lib/factorio/server", function() {
|
||||
slowTest(this);
|
||||
log(".start()");
|
||||
|
||||
// Make sure the test does not fail due to not having internet
|
||||
let settings = await server.exampleSettings();
|
||||
settings.visibility = { public: false, lan: true };
|
||||
settings.require_user_verification = false;
|
||||
await fs.outputFile(server.writePath("server-settings.json"), JSON.stringify(settings, null, 4));
|
||||
|
||||
// Make sure the test does not fail due to create() failing.
|
||||
let mapPath = server.writePath("saves", "test.zip");
|
||||
assert(await fs.exists(mapPath), "save is missing");
|
||||
|
||||
Reference in new issue
Block a user