mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
Move slowTest into test/integration/index
Deduplicate slowTest into the shared integration test library.
This commit is contained in:
1 parent
43ce6aa58c
commit
8de3f54bc4
4 files changed
+16
-29
No files matched your search
@@ -4,18 +4,7 @@ const path = require("path");
|
|||||||
const validateHTML = require('html5-validator');
|
const validateHTML = require('html5-validator');
|
||||||
const parallel = require('mocha.parallel');
|
const parallel = require('mocha.parallel');
|
||||||
|
|
||||||
const { get, exec, controlConfigPath, instancesDir } = require("./index");
|
const { slowTest, get, exec, controlConfigPath, instancesDir } = require("./index");
|
||||||
|
|
||||||
|
|
||||||
// Mark that this test takes a lot of time, or depeneds on a test
|
|
||||||
// that takes a lot of time.
|
|
||||||
function slowTest(test) {
|
|
||||||
if (process.env.FAST_TEST) {
|
|
||||||
test.skip();
|
|
||||||
}
|
|
||||||
|
|
||||||
test.timeout(20000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
describe("Integration of Clusterio", function() {
|
describe("Integration of Clusterio", function() {
|
||||||
|
|||||||
@@ -9,6 +9,16 @@ const events = require("events");
|
|||||||
const server = require("lib/factorio/server");
|
const server = require("lib/factorio/server");
|
||||||
|
|
||||||
|
|
||||||
|
// Mark that this test takes a lot of time, or depeneds on a test
|
||||||
|
// that takes a lot of time.
|
||||||
|
function slowTest(test) {
|
||||||
|
if (process.env.FAST_TEST) {
|
||||||
|
test.skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
test.timeout(20000);
|
||||||
|
}
|
||||||
|
|
||||||
async function get(path) {
|
async function get(path) {
|
||||||
let res = await needle("get", `https://localhost:4443${path}`, { rejectUnauthorized: false });
|
let res = await needle("get", `https://localhost:4443${path}`, { rejectUnauthorized: false });
|
||||||
if (res.statusCode != 200) {
|
if (res.statusCode != 200) {
|
||||||
@@ -97,6 +107,7 @@ after(async function() {
|
|||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
slowTest,
|
||||||
get,
|
get,
|
||||||
exec,
|
exec,
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,13 @@ const path = require("path");
|
|||||||
|
|
||||||
const factorio = require("lib/factorio");
|
const factorio = require("lib/factorio");
|
||||||
|
|
||||||
|
const { slowTest } = require("./index");
|
||||||
|
|
||||||
|
|
||||||
// The server integration test is required to run before this one
|
// The server integration test is required to run before this one
|
||||||
require("./server")
|
require("./server")
|
||||||
|
|
||||||
describe("Integration of lib/factorio/patch", function() {
|
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() {
|
describe("patch()", function() {
|
||||||
let savePath = path.join("test", "temp", "integration", "saves", "test.zip");
|
let savePath = path.join("test", "temp", "integration", "saves", "test.zip");
|
||||||
it("should patch a freeplay game", async function() {
|
it("should patch a freeplay game", async function() {
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ const path = require("path");
|
|||||||
const factorio = require("lib/factorio");
|
const factorio = require("lib/factorio");
|
||||||
const errors = require("lib/errors");
|
const errors = require("lib/errors");
|
||||||
|
|
||||||
|
const { slowTest } = require("./index");
|
||||||
|
|
||||||
|
|
||||||
describe("Integration of lib/factorio/server", function() {
|
describe("Integration of lib/factorio/server", function() {
|
||||||
describe("_getVersion()", function() {
|
describe("_getVersion()", function() {
|
||||||
@@ -67,16 +69,6 @@ describe("Integration of lib/factorio/server", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mark that this test takes a lot of time, or depeneds on a test
|
|
||||||
// that takes a lot of time.
|
|
||||||
function slowTest(test) {
|
|
||||||
if (process.env.FAST_TEST) {
|
|
||||||
test.skip();
|
|
||||||
}
|
|
||||||
|
|
||||||
test.timeout(20000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function log(message) {
|
function log(message) {
|
||||||
logFile.write("=================== " + message + "\n");
|
logFile.write("=================== " + message + "\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user