mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
Fix fast-test
Fix incorrect locations for slowTest in clusterio integration tests and add slowTest to the patch integration tests. Fixes fast-test being broken.
This commit is contained in:
1 parent
b71c392b32
commit
8b9bb59357
2 files changed
+14
-5
No files matched your search
@@ -88,39 +88,39 @@ describe("Integration of Clusterio", function() {
|
||||
});
|
||||
|
||||
describe("create-save", function() {
|
||||
slowTest(this);
|
||||
it("creates a save", async function() {
|
||||
slowTest(this);
|
||||
await clusterctl._commands.get("create-save").run({instance: "test"}, testControl);
|
||||
});
|
||||
});
|
||||
|
||||
describe("start-instance", function() {
|
||||
slowTest(this);
|
||||
it("starts the instance", async function() {
|
||||
slowTest(this);
|
||||
await clusterctl._commands.get("start-instance").run({instance: "test"}, testControl);
|
||||
// TODO check that the instance actually stopped
|
||||
});
|
||||
});
|
||||
|
||||
describe("send-rcon", function() {
|
||||
slowTest(this);
|
||||
it("sends the command", async function() {
|
||||
slowTest(this);
|
||||
await clusterctl._commands.get("send-rcon").run({instance: "test", command: "test"}, testControl);
|
||||
// TODO check that the command was received
|
||||
});
|
||||
});
|
||||
|
||||
describe("stop-instance", function() {
|
||||
slowTest(this);
|
||||
it("stops the instance", async function() {
|
||||
slowTest(this);
|
||||
await clusterctl._commands.get("stop-instance").run({instance: "test"}, testControl);
|
||||
// TODO check that the instance actually stopped
|
||||
});
|
||||
});
|
||||
|
||||
describe("delete-instance", function() {
|
||||
slowTest(this);
|
||||
it("deletes the instance", async function() {
|
||||
slowTest(this);
|
||||
await clusterctl._commands.get("delete-instance").run({instance: "test"}, testControl);
|
||||
assert(!await fs.exists(path.join(instancesDir, "test")), "Instance was not deleted");
|
||||
});
|
||||
|
||||
@@ -10,9 +10,17 @@ const factorio = require("lib/factorio");
|
||||
require("./server")
|
||||
|
||||
describe("Integration of lib/factorio/patch", function() {
|
||||
// Mark that this test depeneds on a test that takes a lot of time.
|
||||
function slowTest(test) {
|
||||
if (process.env.FAST_TEST) {
|
||||
test.skip();
|
||||
}
|
||||
}
|
||||
|
||||
describe("patch()", function() {
|
||||
let savePath = path.join("test", "temp", "integration", "saves", "test.zip");
|
||||
it("should patch a freeplay game", async function() {
|
||||
slowTest(this);
|
||||
await factorio.patch(savePath, [{
|
||||
name: "test",
|
||||
files: [{ path: "test.lua", content: "-- test" }]
|
||||
@@ -23,6 +31,7 @@ describe("Integration of lib/factorio/patch", function() {
|
||||
assert.equal(content, "-- test");
|
||||
});
|
||||
it("should remove old modules in a save", async function() {
|
||||
slowTest(this);
|
||||
await factorio.patch(savePath, [{ name: "test", files: [] }]);
|
||||
let zip = await jszip.loadAsync(await fs.readFile(savePath));
|
||||
assert.equal(zip.file("test/modules/test.lua"), null);
|
||||
|
||||
Reference in new issue
Block a user