Implement new configuration system

Replace current configuration mess with a trimmed down version of the
original vision of #200.  Configs are collection of config groups that
have fields that can be set.  These groups allow organizing the fields
as well as opertunity for plugins to add their own groups.  By default
plugins have an auto generated group with the enabled field.
This commit is contained in:
Hornwitser committed 2020-03-09 20:48:13 +01:00
1 parent 370ee9ed04
commit 5e5149dc93
24 files changed
+2364 -498

No files matched your search

+35 -20
View File
@@ -3,11 +3,19 @@ const path = require('path');
const fs = require('fs-extra');
const link = require("lib/link");
const config = require("lib/config");
const client = require("../client");
describe("Client testing", function() {
describe("class Instance", function() {
let instance = new client._Instance(new link.VirtualConnector(), "dir", "factorioDir", { name:"foo" });
let instance;
before(async function() {
let instanceConfig = new config.InstanceConfig();
await instanceConfig.init();
instanceConfig.set("instance.name", "foo");
instance = new client._Instance(new link.VirtualConnector(), "dir", "factorioDir", instanceConfig);
});
describe(".name", function() {
it("should give the name of the instance", function() {
assert.equal(instance.name, "foo");
@@ -77,24 +85,31 @@ describe("Client testing", function() {
});
describe("symlinkMods()", function() {
// Remove previous test output
let testDir = path.join("test", "temp", "symlink");
fs.removeSync(testDir);
// Add some test mods
fs.outputFileSync(path.join(testDir, "shared", "mod_a.zip"), "a");
fs.outputFileSync(path.join(testDir, "shared", "mod_b.zip"), "b");
fs.outputFileSync(path.join(testDir, "shared", "mod.dat"), "c");
let instance = new client._Instance(
new link.VirtualConnector(), path.join(testDir, "instance"), "factorioDir", { name: "test" }
);
fs.outputFileSync(instance.path("mods", "mod_i.zip"), "i");
let discardingLogger = {
warning: function() { },
log: function() { },
}
let instance;
before(async function() {
// Remove previous test output
await fs.remove(testDir);
// Add some test mods
await fs.outputFile(path.join(testDir, "shared", "mod_a.zip"), "a");
await fs.outputFile(path.join(testDir, "shared", "mod_b.zip"), "b");
await fs.outputFile(path.join(testDir, "shared", "mod.dat"), "c");
let instanceConfig = new config.InstanceConfig();
await instanceConfig.init();
instanceConfig.set("instance.name", "test");
instance = new client._Instance(
new link.VirtualConnector(), path.join(testDir, "instance"), "factorioDir", instanceConfig
);
await fs.outputFile(instance.path("mods", "mod_i.zip"), "i");
});
it("should link mods and data files", async function() {
await client._symlinkMods(instance, path.join(testDir, "shared"), discardingLogger);
@@ -139,15 +154,15 @@ describe("Client testing", function() {
let logger = { log: () => {}, error: () => {} };
let instancePath = path.join("test", "file", "instances");
let instanceInfos = await client._discoverInstances(instancePath, logger);
let referenceConfig = new config.InstanceConfig();
await referenceConfig.init();
referenceConfig.set("instance.id", 1);
referenceConfig.set("instance.name", "test");
assert.deepEqual(instanceInfos, new Map([
[1, {
config: {
id: 1,
name: "test",
factorioPort: null,
clientPort: null,
clientPassword: null
},
config: referenceConfig,
path: path.join(instancePath, "test"),
}],
]));
+1 -1
View File
@@ -30,7 +30,7 @@ describe("clusterctl", function() {
seq: 1, type: 'list_instances_response',
data: {
seq: message.seq,
list: [{ id: 57, slave_id: 4, name: 'Test Instance' }],
list: [{ id: 57, assigned_slave: 4, name: 'Test Instance' }],
},
});
}
-7
View File
@@ -1,7 +0,0 @@
{
"id": 1,
"name": "test",
"factorioPort": null,
"clientPort": null,
"clientPassword": null
}
+11
View File
@@ -0,0 +1,11 @@
{
"groups": [
{
"name": "instance",
"fields": {
"id": 1,
"name": "test"
}
}
]
}
+32 -23
View File
@@ -4,6 +4,7 @@ const path = require("path");
const link = require("lib/link");
const plugin = require("lib/plugin");
const config = require("lib/config");
const master = require("../../master");
const client = require("../../client");
const clusterctl = require("../../clusterctl");
@@ -29,24 +30,22 @@ describe("Integration of Clusterio", function() {
test.timeout(20000);
}
async function createInstanceConfig(id, name, assignedSlave) {
let instanceConfig = new config.InstanceConfig()
await instanceConfig.init();
instanceConfig.set("instance.id", id);
instanceConfig.set("instance.name", name);
instanceConfig.set("instance.assigned_slave", assignedSlave);
return instanceConfig;
}
before(async function() {
master._db.slaves = new Map();
master._db.instances = new Map([
[11, { id: 11, name: "foo", slaveId: 4 }],
[21, { id: 21, name: "bar", slaveId: 5 }],
[11, await createInstanceConfig(11, "foo", 4)],
[21, await createInstanceConfig(21, "bar", 5)],
]);
Object.assign(master._config, {
description: "test",
visibility: { public: false, lan: false },
username: "test",
token: "",
game_password: "",
verify_user_identity: false,
allow_commands: "admins-only",
auto_pause: false,
});
let [controlClient, controlServer] = link.VirtualConnector.makePair();
testControl = new clusterctl._Control(controlClient);
testControlConnection = new master._ControlConnection({ agent: "test", version }, controlServer);
@@ -54,16 +53,19 @@ describe("Integration of Clusterio", function() {
await fs.remove(instancesDir);
await fs.ensureDir(instancesDir)
let slaveConfig = new config.SlaveConfig();
await slaveConfig.init();
slaveConfig.set("slave.id", 4);
slaveConfig.set("slave.name", "slave");
slaveConfig.set("slave.instances_directory", instancesDir);
slaveConfig.set("slave.factorio_directory", "factorio");
slaveConfig.set("slave.master_url", "http://invalid");
slaveConfig.set("slave.master_token", "invalid");
slaveConfig.set("slave.public_address", "invalid");
let [slaveClient, slaveServer] = link.VirtualConnector.makePair();
testSlave = new client._Slave(slaveClient, {
id: 4,
name: "slave",
instanceDirectory: instancesDir,
factorioDirectory: "factorio",
masterURL: "http://invalid",
masterAuthToken: "invalid",
publicIP: "invalid",
}, await plugin.getPluginInfos("plugins"));
testSlave = new client._Slave(slaveClient, slaveConfig, await plugin.loadPluginInfos("plugins"));
testSlaveConnection = new master._SlaveConnection({ agent: "test", version, name: "slave", id: 4}, slaveServer);
master._slaveConnections.set(4, testSlaveConnection);
});
@@ -82,7 +84,14 @@ describe("Integration of Clusterio", function() {
describe("create-instances", function() {
it("creates the instance", async function() {
await clusterctl._commands.get("create-instance").run({name: "test", slave: "slave"}, testControl);
await clusterctl._commands.get("create-instance").run({id: 44, name: "test"}, testControl);
assert(master._db.instances.has(44), "Instance was not created");
});
});
describe("assign-instance", function() {
it("creates the instance", async function() {
await clusterctl._commands.get("assign-instance").run({instance: "test", slave: "slave"}, testControl);
assert(await fs.exists(path.join(instancesDir, "test")), "Instance was not created");
});
});
+1 -1
View File
@@ -45,7 +45,7 @@ describe("Integration of lib/factorio/server", function() {
describe(".exampleSettings()", function() {
let settings;
it("returns an object", async function() {
settings = await factorio.FactorioServer.exampleSettings(path.join("factorio", "data"));
settings = await server.exampleSettings();
assert(typeof settings === "object");
});
+567
View File
@@ -0,0 +1,567 @@
"use strict";
const classes = require("lib/config/classes");
const assert = require("assert").strict;
describe("lib/config/classes", function() {
describe("ConfigGroup", function() {
class TestGroup extends classes.ConfigGroup { }
TestGroup.groupName = "test_group";
describe(".define()", function() {
it("should throw if groupName is not set", function() {
class NoGroupName extends classes.ConfigGroup { }
assert.throws(
() => NoGroupName.define({ name: "a", type: "string", optional: true }),
new Error("Expected ConfigGroup class NoGroupName to have the groupName property set to a string")
);
});
it("should throw on unknown properties", function() {
assert.throws(
() => TestGroup.define({ name: "a", type: "string", optional: true, invalid: true }),
new Error("Unknown property invalid")
);
});
it("should throw on invalid properties", function() {
for (let [def, error] of [
[
{ name: "a", type: "invalid", optional: true },
"invalid is not a valid type"
],
[
{ name: [], type: "string", optional: true },
"name must be a string"
],
[
{ name: "a", type: "string", enum: true, optional: true },
"enum must be an array"
],
[
{ name: "a", title: 2, type: "string", optional: true },
"title must be a string"
],
[
{ name: "a", description: 2, type: "string", optional: true },
"description must be a string"
],
[
{ name: "a", type: "string", optional: "yes" },
"optional must be a boolean"
],
[
{ name: "a", type: "string", initial_value: 1 },
"initial_value must match the type or be a function"
],
[
{ name: "a", type: "string" },
"Non-optional field a needs an initial_value"
],
]) {
assert.throws(() => TestGroup.define(def), new Error(error));
}
});
it("should throw on missing properties", function() {
assert.throws(
() => TestGroup.define({ type: "string", optional: true }),
new Error("name is required when defining an field")
);
assert.throws(
() => TestGroup.define({ name: "a", optional: true }),
new Error("type is required when defining an field")
);
});
it("should allow defining entries", function() {
TestGroup.define({ name: "test", type: "string", optional: true });
TestGroup.define({ name: "func", type: "number", initial_value: () => 42 });
TestGroup.define({ name: "bool", type: "boolean", initial_value: false, optional: true });
TestGroup.define({ name: "json", type: "object", initial_value: {} });
assert(TestGroup._definitions.has("test"), "field test was not defined");
assert(TestGroup._definitions.has("func"), "field func was not defined");
assert(TestGroup._definitions.has("bool"), "field bool was not defined");
assert(TestGroup._definitions.has("json"), "field json was not defined");
});
it("should throw on already defined entries", function() {
assert.throws(
() => TestGroup.define({ name: "test", type: "string", optional: true }),
new Error("Config field test has already been defined")
);
});
it("should set the entries on the class", function() {
let field = {
type: "string",
name: "enum",
title: "Enum",
description: "Enum thingy",
enum: ["a", "b", "c"],
optional: true,
initial_value: "b",
}
TestGroup.define(field);
// Generated properties
field.fullName = "test_group.enum";
assert.deepEqual(TestGroup._definitions.get("enum"), field);
})
});
describe("get definitions", function() {
it("should give the field definitions", function() {
assert.equal(TestGroup.definitions, TestGroup._definitions);
});
});
describe(".finalize()", function() {
it("should throw if groupName is not set", function() {
class NoGroupName extends classes.ConfigGroup { }
assert.throws(
() => NoGroupName.finalize(),
new Error("Expected ConfigGroup class NoGroupName to have the groupName property set to a string")
);
});
it("should throw when creating an instance before finalize", function() {
assert.throws(
() => new TestGroup(),
new Error("Cannot instantiate incomplete ConfigGroup class TestGroup")
);
});
it("should not throw", function() {
TestGroup.finalize();
});
it("should throw when calling define after finalize", function() {
assert.throws(
() => TestGroup.define({}),
new Error("Cannot define field for ConfigGroup class TestGroup after it has been finalized")
);
});
});
describe("constructor", function() {
it("should create an instance", function() {
let testInstance = new TestGroup();
});
});
describe(".init()", function() {
it("should initialize all fields with defaults", async function() {
let testInstance = new TestGroup();
await testInstance.init();
assert.equal(testInstance.get("enum"), "b");
assert.equal(testInstance.get("test"), null);
assert.equal(testInstance.get("func"), 42);
});
});
describe(".serialize()", function() {
it("should serialize a basic group", async function() {
let testInstance = new TestGroup();
await testInstance.init();
assert.deepEqual(testInstance.serialize(), {
name: "test_group",
fields: {
enum: "b",
test: null,
func: 42,
bool: false,
json: {},
},
});
});
});
describe(".load()", function() {
it("should load a basic group", async function() {
let testInstance = new TestGroup();
await testInstance.load({ name: "test_group", fields: {
enum: "c",
test: "blah",
func: 22,
bool: null,
json: { valid: true },
}})
assert.equal(testInstance.get("enum"), "c");
assert.equal(testInstance.get("test"), "blah");
assert.equal(testInstance.get("func"), 22);
assert.equal(testInstance.get("bool"), null);
assert.deepEqual(testInstance.get("json"), { valid: true });
});
it("should load defaults for missing serialized fields", async function() {
let testInstance = new TestGroup();
await testInstance.load({ name: "test_group", fields: { enum: "a" } });
assert.equal(testInstance.get("enum"), "a");
assert.equal(testInstance.get("test"), null);
assert.equal(testInstance.get("func"), 42);
});
it("should preserve unknown fields when serialized back", async function() {
let testFields = {
enum: "a",
test: "blah",
func: 50,
bool: false,
json: {},
alpha: null,
beta: "decay",
gamma: 99,
}
let testInstance = new TestGroup();
await testInstance.load({ name: "test_group", fields: testFields });
assert.deepEqual(testInstance.serialize().fields, testFields);
});
});
describe(".update()", function() {
it("should skip updating invalid values", async function() {
let testInstance = new TestGroup();
await testInstance.init();
testInstance.update({ name: "test_group", fields: { enum: "wrong", test: 3, func: null }});
assert.equal(testInstance.get("enum"), "b");
assert.equal(testInstance.get("test"), null);
assert.equal(testInstance.get("func"), 42);
});
it("should throw on invalid input", function() {
let testInstance = new TestGroup();
assert.throws(
() => testInstance.update(),
new Error("Expected object, not undefined for ConfigGroup")
);
assert.throws(
() => testInstance.update({}),
new Error("Expected group name test_group, not undefined")
);
assert.throws(
() => testInstance.update({ name: "test_group" }),
new Error("Expected fields to be an object, not undefined")
);
assert.throws(
() => testInstance.update({ name: "test_group", fields: []}),
new Error("Expected fields to be an object, not array")
);
assert.throws(
() => testInstance.update({ name: "test_group", fields: null}),
new Error("Expected fields to be an object, not null")
);
});
});
describe(".set()", function() {
let testInstance;
before(function() {
testInstance = new TestGroup();
testInstance.update({ name: "test_group", fields: {
enum: "a", test: "blah", func: 27,
}});
});
it("should throw if field does not exist", function() {
assert.throws(
() => testInstance.set("bar", 1),
new Error("No field named 'bar'")
);
})
it("should throw if field is not in enum", function() {
assert.throws(
() => testInstance.set("enum", "bar"),
new Error("Expected one of [a, b, c], not bar")
);
})
it("should work if field is in enum", function() {
testInstance.set("enum", "c"),
assert.equal(testInstance.get("enum"), "c");
})
it("should throw if field is not optional", function() {
assert.throws(
() => testInstance.set("func", null),
new Error("Field func cannot be null")
);
})
it("should work if field is optional", function() {
testInstance.set("test", "spam"),
assert.equal(testInstance.get("test"), "spam");
})
it("should throw if field is of wrong type", function() {
assert.throws(
() => testInstance.set("test", 1),
new Error("Expected type of test to be string, not number")
);
})
it("should treat empty string as null", function() {
testInstance.set("test", ""),
assert.equal(testInstance.get("test"), null);
})
it("should auto convert string to boolean if possible", function() {
testInstance.set("bool", "true");
assert.equal(testInstance.get("bool"), true);
testInstance.set("bool", "false");
assert.equal(testInstance.get("bool"), false);
assert.throws(
() => testInstance.set("bool", "blah"),
new classes.InvalidValue("Expected type of bool to be boolean, not string")
);
});
it("should auto convert string to number if possible", function() {
for (let s of [
"1",
"+23",
".23e5",
"-.1e-2",
"100.0001",
"Infinity",
]) {
testInstance.set("func", s);
assert.equal(testInstance.get("func"), Number.parseFloat(s));
}
assert.throws(
() => testInstance.set("func", "blah"),
new classes.InvalidValue("Expected type of func to be number, not string")
);
});
it("should auto convert string to object", function() {
testInstance.set("json", '{"json": true}');
assert.deepEqual(testInstance.get("json"), { json: true });
let errMsg;
try { JSON.parse("blah"); }
catch (err) { errMsg = err.message; }
assert.throws(
() => testInstance.set("json", "blah"),
new classes.InvalidValue(`Error parsing value for json: ${errMsg}`)
);
});
});
});
describe("Config", function() {
class AlphaGroup extends classes.ConfigGroup { }
AlphaGroup.groupName = "alpha";
class BetaGroup extends classes.ConfigGroup { }
BetaGroup.groupName = "beta";
class TestConfig extends classes.Config { }
before(function() {
AlphaGroup.define({ name: "foo", type: "string", optional: true });
AlphaGroup.finalize();
TestConfig.registerGroup(AlphaGroup);
BetaGroup.define({ name: "bar", type: "number", initial_value: 2 });
BetaGroup.finalize();
TestConfig.registerGroup(BetaGroup);
});
describe(".registerGroup()", function() {
it("should throw if the class is finalized", function() {
class TestConfig extends classes.Config { }
TestConfig.finalize();
class TestGroup extends classes.ConfigGroup { }
TestGroup.groupName = "test";
TestGroup.finalize();
assert.throws(
() => TestConfig.registerGroup(TestGroup),
new Error("Cannot register group on finalized config")
);
});
it("should throw if the group is not finalized", function() {
class UnfinishedGroup extends classes.ConfigGroup { }
assert.throws(
() => TestConfig.registerGroup(UnfinishedGroup),
new Error("Group must be finalized before it can be registered")
);
});
it("should throw if the group is already registered", function() {
assert.throws(
() => TestConfig.registerGroup(AlphaGroup),
new Error("alpha has already been registered")
);
});
});
describe("constructor", function() {
it("should throw if config is not finalized", function() {
assert.throws(
() => new TestConfig(),
new Error("Cannot instantiate incomplete Config class TestConfig")
);
});
it("should construct a finalized class", function() {
TestConfig.finalize();
new TestConfig();
});
});
describe(".init()", function() {
it("should initialize all fields", async function() {
let testInstance = new TestConfig();
await testInstance.init();
assert.equal(testInstance.get("alpha.foo"), null);
assert.equal(testInstance.get("beta.bar"), 2);
})
});
describe(".serialize()", function() {
it("should serialize a basic config", async function() {
let testInstance = new TestConfig();
await testInstance.init();
assert.deepEqual(testInstance.serialize(), {
groups: [
{
name: "alpha",
fields: { foo: null },
},
{
name: "beta",
fields: { bar: 2 },
}
]
});
})
});
describe(".load()", function() {
it("should reject on incorrect input passed", async function() {
let testInstance = new TestConfig();
await assert.rejects(
testInstance.load(null),
new Error("Expected object, not null for config")
);
await assert.rejects(
testInstance.load(undefined),
new Error("Expected object, not undefined for config")
);
await assert.rejects(
testInstance.load({ groups: null }),
new Error("Expected groups to be an array, not null")
);
});
it("should load defaults for missing serialized groups", async function() {
let testInstance = new TestConfig();
await testInstance.load({ groups: [{ name: "alpha", fields: { foo: "a" }}] });
assert.equal(testInstance.get("alpha.foo"), "a");
assert.equal(testInstance.get("beta.bar"), 2);
});
it("should preserve unknown groups when serialized back", async function() {
let testGroups = [
{
name: "extra",
fields: { blah: true, spam: "foobar" },
},
{
name: "alpha",
fields: { foo: "true" },
},
{
name: "beta",
fields: { bar: 20 },
}
]
let testInstance = new TestConfig();
await testInstance.load({ groups: testGroups });
assert.deepEqual(testInstance.serialize().groups, testGroups);
});
});
describe(".update()", function() {
it("should update a basic config", async function() {
let testInstance = new TestConfig();
await testInstance.init();
testInstance.update({ groups: [
{
name: "extra",
fields: { blah: true, spam: "baz" },
},
{
name: "beta",
fields: { bar: 30 },
}
]});
assert.deepEqual(testInstance.serialize(), {
groups: [
{
name: "extra",
fields: { blah: true, spam: "baz" },
},
{
name: "alpha",
fields: { foo: null },
},
{
name: "beta",
fields: { bar: 30 },
}
],
});
})
});
describe(".group()", function() {
it("should throw if instance is not initialized", function() {
let testInstance = new TestConfig();
assert.throws(
() => testInstance.group("test"),
new Error("TestConfig instance is uninitialized")
);
});
});
describe(".get()", function() {
it("should throw if group does not exist", async function() {
let testInstance = new TestConfig();
await testInstance.init();
assert.throws(() => testInstance.get("invalid"), new Error("No config group named 'invalid'"))
});
it("should throw if no field is specified", async function() {
let testInstance = new TestConfig();
await testInstance.init();
assert.throws(() => testInstance.get("alpha"), new Error("No field named ''"))
});
});
describe(".set()", function() {
it("should set the value", async function() {
let testInstance = new TestConfig();
await testInstance.init();
testInstance.set("alpha.foo", "new value");
assert.equal(testInstance.get("alpha.foo"), "new value");
});
});
describe("get groups", function() {
it("should give the registered group classes", function() {
assert.equal(TestConfig.groups, TestConfig._groups);
});
});
});
});
+7 -22
View File
@@ -34,12 +34,11 @@ describe("lib/plugin", function() {
})
});
describe("getPluginInfos()", function() {
describe("loadPluginInfos()", function() {
let baseDir = path.join('test', 'temp', 'plugin');
let emptyDir = path.join(baseDir, 'emptyDir');
let emptyPlugin = path.join(baseDir, 'emptyPlugin');
let testPlugin = path.join(baseDir, 'testPlugin');
let disabledPlugin = path.join(baseDir, 'disabledPlugin');
let brokenPlugin = path.join(baseDir, 'brokenPlugin');
let invalidPlugin = path.join(baseDir, 'invalidPlugin');
before(async function() {
@@ -54,46 +53,32 @@ describe("lib/plugin", function() {
}
await writePlugin(testPlugin, 'test');
await writePlugin(disabledPlugin, 'disabled');
await fs.outputFile(path.join(disabledPlugin, 'disabled', 'DISABLED'), "");
await writePlugin(brokenPlugin, 'broken');
await fs.outputFile(path.join(brokenPlugin, 'broken', 'info.js'), "Syntax Error");
await writePlugin(invalidPlugin, 'invalid', 'wrong');
});
it("should return an empty array for an empty directory", async function() {
assert.deepEqual(await plugin.getPluginInfos(emptyDir), []);
assert.deepEqual(await plugin.loadPluginInfos(emptyDir), []);
});
it("should ignore plugin dirs without info module", async function() {
assert.deepEqual(await plugin.getPluginInfos(emptyPlugin), []);
assert.deepEqual(await plugin.loadPluginInfos(emptyPlugin), []);
});
it("should discover test plugin", async function() {
assert.deepEqual(
await plugin.getPluginInfos(testPlugin),
[{ name: 'test', enabled: true }]
);
});
it("should discover disabled plugin", async function() {
assert.deepEqual(
await plugin.getPluginInfos(disabledPlugin),
[{ name: 'disabled', enabled: false }]
);
});
it("should discover disabled plugin", async function() {
assert.deepEqual(
await plugin.getPluginInfos(disabledPlugin),
[{ name: 'disabled', enabled: false }]
await plugin.loadPluginInfos(testPlugin),
[{ name: 'test' }]
);
});
it("should reject on broken plugin", async function() {
await assert.rejects(
plugin.getPluginInfos(brokenPlugin),
plugin.loadPluginInfos(brokenPlugin),
{ message: "PluginError: Unexpected identifier" }
);
});
it("should reject on invalid plugin", async function() {
await assert.rejects(
plugin.getPluginInfos(invalidPlugin),
plugin.loadPluginInfos(invalidPlugin),
{ message: `Plugin dir ${invalidPlugin}/invalid does not match the name of the plugin (wrong)` }
);
});
+20 -2
View File
@@ -3,14 +3,32 @@ const request = require('supertest');
const validateHTML = require('html5-validator');
const parallel = require('mocha.parallel');
const config = require("lib/config");
const plugin = require("lib/plugin");
const mock = require('./mock');
const master = require('../master');
master._db.slaves = new Map();
// Fields required in the config
master._config.factorioDirectory = "factorio";
before(async function() {
let pluginInfos = await plugin.loadPluginInfos("plugins");
config.registerPluginConfigGroups(pluginInfos);
config.finalizeConfigs();
let masterConfig = new config.MasterConfig();
await masterConfig.load({
groups: [{
name: "master",
fields: {
auth_secret: "TestSecretDoNotUse",
http_port: 8880,
https_port: 4443,
},
}]
});
master._setConfig(masterConfig);
})
async function get(path) {
return await request(master.app).get(path).expect(200);