mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-18 06:43:13 +09:00
Merge pull request #481 from bbassie/fix/upstream-plugin-changes
Restore seeding without controller.plugins
This commit is contained in:
1 parent
862fe49b60
commit
53e07aa761
4 files changed
+28
-16
No files matched your search
@@ -42,7 +42,6 @@ async function startPlugin(t2, { withPlugins = true } = {}) {
|
||||
for (const [name, Plugin] of [["exp_roles", RolesPlugin], ["exp_groups", GroupsPlugin]]) {
|
||||
const plugin = new Plugin({ name }, controller, undefined, logger);
|
||||
await plugin.init();
|
||||
controller.plugins.set(name, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ t.test("class ControllerPlugin", t2 => {
|
||||
|
||||
t2.test(".handleSeedRequest() creates the roles and reuses them by name", async t3 => {
|
||||
const { plugin, controller } = await startPlugin(t3);
|
||||
const rolesPlugin = controller.plugins.get("exp_roles");
|
||||
const rolesPlugin = RolesPlugin.get(controller);
|
||||
|
||||
await plugin.handleSeedRequest();
|
||||
t3.strictSame(controller.roles.size, seedRoles.length, "every seed role exists");
|
||||
@@ -80,7 +79,7 @@ t.test("class ControllerPlugin", t2 => {
|
||||
|
||||
t2.test(".handleSeedRequest() creates the groups and resets them by name", async t3 => {
|
||||
const { plugin, controller } = await startPlugin(t3);
|
||||
const groupsPlugin = controller.plugins.get("exp_groups");
|
||||
const groupsPlugin = GroupsPlugin.get(controller);
|
||||
|
||||
await plugin.handleSeedRequest();
|
||||
t3.strictSame(groupsPlugin.groups.size, seedGroups.length, "every seed group exists");
|
||||
@@ -101,7 +100,7 @@ t.test("class ControllerPlugin", t2 => {
|
||||
|
||||
t2.test(".handleSeedRequest() maps each role onto its group by rank", async t3 => {
|
||||
const { plugin, controller } = await startPlugin(t3);
|
||||
const groupsPlugin = controller.plugins.get("exp_groups");
|
||||
const groupsPlugin = GroupsPlugin.get(controller);
|
||||
|
||||
await plugin.handleSeedRequest();
|
||||
const mapped = seedRoles.filter(role => role.group !== undefined);
|
||||
@@ -123,7 +122,7 @@ t.test("class ControllerPlugin", t2 => {
|
||||
|
||||
t2.test(".handleSeedRequest() reuses mappings and keeps clear of other mappings", async t3 => {
|
||||
const { plugin, controller } = await startPlugin(t3);
|
||||
const groupsPlugin = controller.plugins.get("exp_groups");
|
||||
const groupsPlugin = GroupsPlugin.get(controller);
|
||||
|
||||
groupsPlugin.roleMappings.set(new RoleMappingRecord(99, new Set([0, 1]), 5, 2, true));
|
||||
await plugin.handleSeedRequest();
|
||||
|
||||
Reference in new issue
Block a user