test: initialize processing control in Discord CLI fixtures
This commit is contained in:
1 parent
eb3abba12f
commit
e6800380dc
2 files changed
+4
No files matched your search
@@ -7,6 +7,7 @@ import { validateBinding, loadBinding, readToken, checkPrivateFile, resolveConte
|
|||||||
import { homedir } from "node:os";
|
import { homedir } from "node:os";
|
||||||
import { DiscordError } from "../src/errors.mjs";
|
import { DiscordError } from "../src/errors.mjs";
|
||||||
import { makeRoot, makeRepo, makeDeployment, rawBinding } from "./helpers.mjs";
|
import { makeRoot, makeRepo, makeDeployment, rawBinding } from "./helpers.mjs";
|
||||||
|
import { initializeControl } from '../../processing-control/src/state.mjs';
|
||||||
|
|
||||||
const cli = join(import.meta.dirname, "..", "src", "cli.mjs");
|
const cli = join(import.meta.dirname, "..", "src", "cli.mjs");
|
||||||
|
|
||||||
@@ -202,6 +203,7 @@ test("cli: run refuses when STOP is present, before any network use", () => {
|
|||||||
const root = makeRoot();
|
const root = makeRoot();
|
||||||
const repo = makeRepo(root);
|
const repo = makeRepo(root);
|
||||||
const dep = makeDeployment(root);
|
const dep = makeDeployment(root);
|
||||||
|
initializeControl(dep.dataRoot);
|
||||||
const r0 = runCli(["stop", "test-seat", "--config", dep.config]);
|
const r0 = runCli(["stop", "test-seat", "--config", dep.config]);
|
||||||
assert.equal(r0.status, 0, r0.stderr);
|
assert.equal(r0.status, 0, r0.stderr);
|
||||||
assert.match(r0.stdout, /STOP written/);
|
assert.match(r0.stdout, /STOP written/);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
} from "../src/journal.mjs";
|
} from "../src/journal.mjs";
|
||||||
import { DiscordError } from "../src/errors.mjs";
|
import { DiscordError } from "../src/errors.mjs";
|
||||||
import { makeRoot, makeRepo, makeDeployment } from "./helpers.mjs";
|
import { makeRoot, makeRepo, makeDeployment } from "./helpers.mjs";
|
||||||
|
import { initializeControl } from '../../processing-control/src/state.mjs';
|
||||||
|
|
||||||
const cli = fileURLToPath(new URL("../src/cli.mjs", import.meta.url));
|
const cli = fileURLToPath(new URL("../src/cli.mjs", import.meta.url));
|
||||||
const worker = fileURLToPath(new URL("../fixtures/legacy-owner-worker.mjs", import.meta.url));
|
const worker = fileURLToPath(new URL("../fixtures/legacy-owner-worker.mjs", import.meta.url));
|
||||||
@@ -146,6 +147,7 @@ test("cli: recover exits 0 when ready, 3 behind a brake or a held binding, and r
|
|||||||
const root = makeRoot();
|
const root = makeRoot();
|
||||||
const repo = makeRepo(root);
|
const repo = makeRepo(root);
|
||||||
const dep = makeDeployment(root);
|
const dep = makeDeployment(root);
|
||||||
|
initializeControl(dep.dataRoot);
|
||||||
const run = (args) => spawnSync(process.execPath, [cli, ...args, "--config", dep.config, "--repo", repo], { encoding: "utf8" });
|
const run = (args) => spawnSync(process.execPath, [cli, ...args, "--config", dep.config, "--repo", repo], { encoding: "utf8" });
|
||||||
let r = run(["recover", "test-seat"]);
|
let r = run(["recover", "test-seat"]);
|
||||||
assert.equal(r.status, 0, r.stderr);
|
assert.equal(r.status, 0, r.stderr);
|
||||||
|
|||||||
Reference in new issue
Block a user