Add NO_EXTERNAL_TEST flag to skip tests using external APIs (#976)

* Add NO_EXTERNAL_TEST flag to skip tests using external APIs

Adds an externalTest(this) helper alongside slowTest that skips the test
when NO_EXTERNAL_TEST is set and raises the timeout to 60s, plus a
no-external-test script. Marks the tests hitting factorio.com, the mod
portal and GitHub with it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Disable user verification in start-all and auto_start tests

Factorio contacts auth.factorio.com on startup when
require_user_verification is enabled, which made these tests fail
offline. Match the other integration tests by turning it off.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cooldude2606andClaude Fable 5 authored and GitHub committed 2026-08-19 15:07:08 +01:00
commit b5a0d43c96
10 files changed
+44 -6

No files matched your search

+5 -1
View File
@@ -8,7 +8,7 @@ const hostServer = require("@clusterio/host/dist/node/src/server");
const lib = require("@clusterio/lib");
const { wait } = lib;
const { testLines } = require("../lib/factorio/lines");
const { slowTest } = require("../integration");
const { slowTest, externalTest } = require("../integration");
describe("host/server", function() {
@@ -137,6 +137,7 @@ describe("host/server", function() {
it("works", async function() {
slowTest(this);
externalTest(this);
const url = "https://github.com/clusterio/clusterio/archive/refs/tags/v2.0.0-alpha.22.zip";
const downloads = path.join("temp", "test", "downloads");
await fs.rm(downloads, { force: true, recursive: true, maxRetries: 10 });
@@ -160,6 +161,8 @@ describe("host/server", function() {
});
it("works", async function() {
slowTest(this);
externalTest(this);
const url = "https://github.com/clusterio/clusterio/archive/refs/tags/v2.0.0-alpha.22.tar.gz";
const downloads = path.join("temp", "test", "downloads");
await fs.rm(downloads, { force: true, recursive: true, maxRetries: 10 });
@@ -479,6 +482,7 @@ describe("host/server", function() {
}
it("should download a version correctly (live api)", async function() {
slowTest(this);
externalTest(this);
if (_platform !== "linux") {
this.skip();
}