mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Better handling of mod dependencies (#801)
* Add ModDependency and version types * Add warnings for mod dependencies * Add warning for wrong factorio version * Add fix issues button * Add automatic dependency resolution and download * Add abilty to check for updates * Add extra test coverage * One extra test * Fix copy paste error
This commit is contained in:
1 parent
73cc019d2f
commit
d52931a326
29 files changed
+2763
-403
No files matched your search
@@ -951,7 +951,7 @@ describe("Integration of Clusterio", function() {
|
||||
|
||||
await execCtl("instance start 44");
|
||||
const instance = (await getInstances()).get(44);
|
||||
const isV2 = lib.integerFactorioVersion(instance.factorioVersion) > lib.integerFactorioVersion("2.0.0");
|
||||
const isV2 = lib.integerPartialVersion(instance.factorioVersion) > lib.integerPartialVersion("2.0");
|
||||
const exchangeString = (isV2 ? testStrings.modified_v2 : testStrings.modified).replace(/[\n\r]+/g, "");
|
||||
const args = `base/freeplay --seed 1234 --map-exchange-string "${exchangeString}"`;
|
||||
await execCtl("instance stop 44");
|
||||
|
||||
@@ -117,15 +117,14 @@ class TestHostConnector extends lib.WebSocketClientConnector {
|
||||
}
|
||||
}
|
||||
|
||||
// Mark that this test takes a lot of time, or depeneds on a test
|
||||
// that takes a lot of time.
|
||||
// Mark that this test takes a lot of time, or depends on a test that takes a lot of time.
|
||||
function slowTest(test) {
|
||||
|
||||
if (process.env.FAST_TEST) {
|
||||
test.skip();
|
||||
}
|
||||
|
||||
test.timeout(20000);
|
||||
test.timeout(30000);
|
||||
}
|
||||
|
||||
async function get(urlPath) {
|
||||
@@ -196,7 +195,9 @@ async function execCtlProcess(...args) {
|
||||
return await exec(...args);
|
||||
}
|
||||
|
||||
let inExecCtl = false;
|
||||
async function execCtl(command) {
|
||||
inExecCtl = true;
|
||||
process.chdir("temp/test");
|
||||
try {
|
||||
const initArgs = await initializeCtl(command, control.plugins, true);
|
||||
@@ -209,9 +210,17 @@ async function execCtl(command) {
|
||||
await targetCommand.run(initArgs.args, control);
|
||||
} finally {
|
||||
process.chdir("../..");
|
||||
inExecCtl = false;
|
||||
}
|
||||
}
|
||||
|
||||
afterEach(function() {
|
||||
if (inExecCtl) {
|
||||
// This is needed in case a test times out and never runs the finally block
|
||||
process.chdir("../..");
|
||||
}
|
||||
});
|
||||
|
||||
async function sendRcon(instanceId, command) {
|
||||
return await control.sendTo({ instanceId }, new lib.InstanceSendRconRequest(command));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user