docs(frontend): clarify Pi management workflow
This commit is contained in:
@@ -238,30 +238,35 @@ test("shows a seven-step host-terminal workflow in scrollable platform tabs", as
|
||||
"Open the project root",
|
||||
"Edit the provider catalog",
|
||||
"Enable the model",
|
||||
"Check the provider credential",
|
||||
"Complete the provider setup",
|
||||
"Reload Pi configuration",
|
||||
"Update the Pi version",
|
||||
"Recover a failed update",
|
||||
"Diagnose and recover a failed operation",
|
||||
]);
|
||||
expect(linux).toHaveTextContent("The deploy directory is beside compose.yaml");
|
||||
expect(linux).toHaveTextContent("All commands below start in this project root");
|
||||
expect(linux).toHaveTextContent("mkdir -p bin");
|
||||
expect(linux).toHaveTextContent("go -C tools/thothctl build -o ../../bin/thothctl ./cmd/thothctl");
|
||||
expect(linux).toHaveTextContent("cd /absolute/path/to/ThothII");
|
||||
expect(linux).toHaveTextContent("tht pi status");
|
||||
expect(linux).toHaveTextContent("tht pi doctor");
|
||||
expect(linux).toHaveTextContent("Invalid JSON");
|
||||
expect(linux).toHaveTextContent("Provider connectivity");
|
||||
expect(linux).toHaveTextContent("If maintenance is inactive");
|
||||
expect(linux).toHaveTextContent("active after an update");
|
||||
expect(linux).toHaveTextContent("active after a restart");
|
||||
expect(linux).toHaveTextContent("run every command in this list from that directory");
|
||||
expect(linux).toHaveTextContent("deploy/pi/models.json");
|
||||
expect(linux).toHaveTextContent("deploy/pi/settings.json");
|
||||
expect(linux).toHaveTextContent("baseUrl is the provider API endpoint");
|
||||
expect(linux).toHaveTextContent("enabledModels uses provider/model identifiers");
|
||||
expect(linux).toHaveTextContent("Pi reads the provider API key from a protected file on the host");
|
||||
expect(linux).toHaveTextContent("Do not put the key in models.json or settings.json");
|
||||
expect(linux).toHaveTextContent("./bin/thothctl pi restart --yes --drain");
|
||||
expect(linux).toHaveTextContent("./bin/thothctl pi update");
|
||||
expect(linux).toHaveTextContent("./bin/thothctl pi update --version <VERSION> --source pull --image <IMAGE>@sha256:<DIGEST> --yes --drain");
|
||||
expect(linux).toHaveTextContent("The command installs the Pi version pinned in docker/core.Dockerfile");
|
||||
expect(linux).toHaveTextContent("./bin/thothctl pi maintenance status");
|
||||
expect(linux).toHaveTextContent("./bin/thothctl pi logs");
|
||||
expect(linux).toHaveTextContent("./bin/thothctl pi rollback --yes");
|
||||
expect(linux).toHaveTextContent("./bin/thothctl pi maintenance recover --yes");
|
||||
expect(linux).not.toHaveTextContent("~/bin/");
|
||||
expect(linux).toHaveTextContent("During the initial installation");
|
||||
expect(linux).toHaveTextContent("Pi credentials file location");
|
||||
expect(linux).toHaveTextContent("tht pi restart --yes --drain");
|
||||
expect(linux).toHaveTextContent("tht pi update");
|
||||
expect(linux).toHaveTextContent("tht pi update --version <VERSION> --source pull --image <IMAGE>@sha256:<DIGEST> --yes --drain");
|
||||
expect(linux).toHaveTextContent("tht pi maintenance status");
|
||||
expect(linux).toHaveTextContent("tht pi logs");
|
||||
expect(linux).toHaveTextContent("tht pi rollback --yes");
|
||||
expect(linux).toHaveTextContent("tht pi maintenance recover --yes");
|
||||
expect(linux).not.toHaveTextContent("PI_AUTH_FILE");
|
||||
expect(linux).not.toHaveTextContent("thothctl");
|
||||
expect(linux).not.toHaveTextContent("~/.pi/agent/");
|
||||
|
||||
await user.click(macosTab);
|
||||
@@ -271,24 +276,22 @@ test("shows a seven-step host-terminal workflow in scrollable platform tabs", as
|
||||
"Open the project root",
|
||||
"Edit the provider catalog",
|
||||
"Enable the model",
|
||||
"Check the provider credential",
|
||||
"Complete the provider setup",
|
||||
"Reload Pi configuration",
|
||||
"Update the Pi version",
|
||||
"Recover a failed update",
|
||||
"Diagnose and recover a failed operation",
|
||||
]);
|
||||
expect(macos).toHaveTextContent("The deploy directory is beside compose.yaml");
|
||||
expect(macos).toHaveTextContent("All commands below start in this project root");
|
||||
expect(macos).toHaveTextContent("go -C tools/thothctl build -o ../../bin/thothctl ./cmd/thothctl");
|
||||
expect(macos).toHaveTextContent("cd /absolute/path/to/ThothII");
|
||||
expect(macos).toHaveTextContent("run every command in this list from that directory");
|
||||
expect(macos).toHaveTextContent("deploy/pi/models.json");
|
||||
expect(macos).toHaveTextContent("deploy/pi/settings.json");
|
||||
expect(macos).toHaveTextContent("./bin/thothctl pi restart --yes --drain");
|
||||
expect(macos).toHaveTextContent("./bin/thothctl pi update");
|
||||
expect(macos).toHaveTextContent("./bin/thothctl pi update --version <VERSION> --source pull --image <IMAGE>@sha256:<DIGEST> --yes --drain");
|
||||
expect(macos).toHaveTextContent("The command installs the Pi version pinned in docker/core.Dockerfile");
|
||||
expect(macos).toHaveTextContent("./bin/thothctl pi maintenance status");
|
||||
expect(macos).toHaveTextContent("./bin/thothctl pi logs");
|
||||
expect(macos).toHaveTextContent("./bin/thothctl pi rollback --yes");
|
||||
expect(macos).toHaveTextContent("./bin/thothctl pi maintenance recover --yes");
|
||||
expect(macos).toHaveTextContent("tht pi restart --yes --drain");
|
||||
expect(macos).toHaveTextContent("tht pi update");
|
||||
expect(macos).toHaveTextContent("tht pi update --version <VERSION> --source pull --image <IMAGE>@sha256:<DIGEST> --yes --drain");
|
||||
expect(macos).toHaveTextContent("tht pi maintenance status");
|
||||
expect(macos).toHaveTextContent("tht pi logs");
|
||||
expect(macos).toHaveTextContent("tht pi rollback --yes");
|
||||
expect(macos).toHaveTextContent("tht pi maintenance recover --yes");
|
||||
|
||||
await user.click(windowsTab);
|
||||
const windows = screen.getByRole("tabpanel", { name: "Windows" });
|
||||
@@ -297,44 +300,26 @@ test("shows a seven-step host-terminal workflow in scrollable platform tabs", as
|
||||
"Open the project root",
|
||||
"Edit the provider catalog",
|
||||
"Enable the model",
|
||||
"Check the provider credential",
|
||||
"Complete the provider setup",
|
||||
"Reload Pi configuration",
|
||||
"Update the Pi version",
|
||||
"Recover a failed update",
|
||||
"Diagnose and recover a failed operation",
|
||||
]);
|
||||
expect(windows).toHaveTextContent("The deploy directory is beside compose.yaml");
|
||||
expect(windows).toHaveTextContent("All commands below start in this project root");
|
||||
expect(windows).toHaveTextContent("Set-Location C:\\absolute\\path\\to\\ThothII");
|
||||
expect(windows).toHaveTextContent("run every command in this list from that directory");
|
||||
expect(windows).toHaveTextContent("deploy\\pi\\models.json");
|
||||
expect(windows).toHaveTextContent("deploy\\pi\\settings.json");
|
||||
expect(windows).toHaveTextContent("New-Item -ItemType Directory -Force bin");
|
||||
expect(windows).toHaveTextContent("go -C tools/thothctl build -o ../../bin/thothctl.exe ./cmd/thothctl");
|
||||
expect(windows).toHaveTextContent('.\\bin\\thothctl.exe pi restart --yes --drain');
|
||||
expect(windows).toHaveTextContent('.\\bin\\thothctl.exe pi update');
|
||||
expect(windows).toHaveTextContent('.\\bin\\thothctl.exe pi update --version <VERSION> --source pull --image <IMAGE>@sha256:<DIGEST> --yes --drain');
|
||||
expect(windows).toHaveTextContent("The command installs the Pi version pinned in docker/core.Dockerfile");
|
||||
expect(windows).toHaveTextContent('.\\bin\\thothctl.exe pi maintenance status');
|
||||
expect(windows).toHaveTextContent('.\\bin\\thothctl.exe pi logs');
|
||||
expect(windows).toHaveTextContent('.\\bin\\thothctl.exe pi rollback --yes');
|
||||
expect(windows).toHaveTextContent('.\\bin\\thothctl.exe pi maintenance recover --yes');
|
||||
expect(windows).not.toHaveTextContent("~\\bin\\");
|
||||
expect(windows).toHaveTextContent('tht pi restart --yes --drain');
|
||||
expect(windows).toHaveTextContent('tht pi update');
|
||||
expect(windows).toHaveTextContent('tht pi update --version <VERSION> --source pull --image <IMAGE>@sha256:<DIGEST> --yes --drain');
|
||||
expect(windows).toHaveTextContent('tht pi maintenance status');
|
||||
expect(windows).toHaveTextContent('tht pi logs');
|
||||
expect(windows).toHaveTextContent('tht pi rollback --yes');
|
||||
expect(windows).toHaveTextContent('tht pi maintenance recover --yes');
|
||||
expect(windows).not.toHaveTextContent("PI_AUTH_FILE");
|
||||
expect(windows).not.toHaveTextContent("thothctl");
|
||||
});
|
||||
|
||||
test("keeps the required PI_AUTH_FILE guidance in one static text node", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderManagement();
|
||||
|
||||
const tablist = await screen.findByRole("tablist", { name: "Pi host platform" });
|
||||
await user.click(within(tablist).getByRole("tab", { name: "Linux" }));
|
||||
const credentialStep = screen.getByRole("heading", { name: "Check the provider credential" }).closest("li");
|
||||
const guidance = credentialStep?.querySelector("p");
|
||||
|
||||
expect(
|
||||
Array.from(guidance?.childNodes ?? []).some(
|
||||
(node) => node.nodeType === Node.TEXT_NODE
|
||||
&& node.textContent?.includes("Pi reads the provider API key from a protected file on the host"),
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
test("reloads installation defaults when the panel is reopened", async () => {
|
||||
let statusCalls = 0;
|
||||
|
||||
Reference in New Issue
Block a user