mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-12-06 00:15:42 -08:00
Expect the legacy skills CLI link source in the e2e test on Node below its floor, as on CI
AI Assisted
This commit is contained in:
1 parent
f640f890f4
commit
280d7ebcb1
1 file changed
+11
-1
@@ -12,6 +12,7 @@ import test, { after } from "node:test";
|
|||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
import { createRequire } from "node:module";
|
||||||
import { spawnSync } from "node:child_process";
|
import { spawnSync } from "node:child_process";
|
||||||
|
|
||||||
import { installRefForRelease, chooseReleaseRef, parseLsRemoteSnapshot } from "../src/web-console/update-check.mjs";
|
import { installRefForRelease, chooseReleaseRef, parseLsRemoteSnapshot } from "../src/web-console/update-check.mjs";
|
||||||
@@ -27,6 +28,9 @@ import {
|
|||||||
writeFixtureSnapshot,
|
writeFixtureSnapshot,
|
||||||
} from "./install-e2e-fixture.mjs";
|
} from "./install-e2e-fixture.mjs";
|
||||||
|
|
||||||
|
// The installer's own rule for which skills CLI pin a Node version gets.
|
||||||
|
const SKILLS_CLI = createRequire(import.meta.url)("../src/installer/skills-cli.js");
|
||||||
|
|
||||||
let fixtureInstance = null;
|
let fixtureInstance = null;
|
||||||
function fixture() {
|
function fixture() {
|
||||||
if (!fixtureInstance) fixtureInstance = createInstallE2EFixture();
|
if (!fixtureInstance) fixtureInstance = createInstallE2EFixture();
|
||||||
@@ -261,7 +265,13 @@ test("e2e: canonical link refresh and benchmark events carry the selected ref wi
|
|||||||
const cli = readSkillsCliLog(run.cliLog);
|
const cli = readSkillsCliLog(run.cliLog);
|
||||||
assert.equal(cli.length, 1, "one canonical-source link refresh, not one CLI add per skill");
|
assert.equal(cli.length, 1, "one canonical-source link refresh, not one CLI add per skill");
|
||||||
assert.equal(cli[0].argv[0], "add");
|
assert.equal(cli[0].argv[0], "add");
|
||||||
assert.equal(cli[0].argv[1], path.join(run.isolated.paths.home, ".agents", "skills"));
|
// The installer runs on this Node, which picks the skills CLI pin: the current pin links from the
|
||||||
|
// canonical store, the legacy one (Node below its floor, as on CI's Node 20) from the built
|
||||||
|
// skills/ folder, since it skips every agent when given the store (agentLinkSource).
|
||||||
|
const pin = SKILLS_CLI.selectSkillsCliVersion(process.versions.node);
|
||||||
|
const linkSource =
|
||||||
|
pin === SKILLS_CLI.SKILLS_CLI_PINS.legacy ? path.join(run.checkout, "skills") : path.join(run.isolated.paths.home, ".agents", "skills");
|
||||||
|
assert.equal(cli[0].argv[1], linkSource, `the link source for skills CLI ${pin}`);
|
||||||
assert.ok(cli[0].argv.includes("-g"));
|
assert.ok(cli[0].argv.includes("-g"));
|
||||||
assert.ok(cli[0].argv.includes("plan2code-3-implement-review"));
|
assert.ok(cli[0].argv.includes("plan2code-3-implement-review"));
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user