fix(sentinel): harden post-deploy report and ssh summaries
This commit is contained in:
@@ -9,7 +9,9 @@ import {
|
||||
createSshStderrForwarder,
|
||||
createSshStdoutForwarder,
|
||||
formatSshStdoutTruncationHint,
|
||||
formatSshTruncationCompletionSummary,
|
||||
parseSshInvocation,
|
||||
sshTruncationCompletionSummary,
|
||||
sshCaptureBackendPlan,
|
||||
sshStderrStreamMaxBytes,
|
||||
sshStdoutStreamMaxBytes,
|
||||
@@ -214,6 +216,20 @@ describe("ssh stdout bounded streaming", () => {
|
||||
expect(hint).toContain("\"forwardedBytes\":5");
|
||||
const payload = JSON.parse(hint!.slice("UNIDESK_SSH_STDOUT_TRUNCATED ".length)) as { dumpPath: string };
|
||||
expect(readFileSync(payload.dumpPath, "utf8")).toBe("abcdefghijkl");
|
||||
const summary = sshTruncationCompletionSummary({
|
||||
invocation,
|
||||
transport: "frontend-websocket",
|
||||
exitCode: 0,
|
||||
timedOut: false,
|
||||
startedAtMs: Date.now() - 1234,
|
||||
stdout: forwarder.summary(),
|
||||
stderr: null,
|
||||
});
|
||||
const formattedSummary = formatSshTruncationCompletionSummary(summary);
|
||||
expect(formattedSummary).toContain("UNIDESK_SSH_TRUNCATION_SUMMARY");
|
||||
expect(formattedSummary).toContain("\"exitCode\":0");
|
||||
expect(formattedSummary).toContain("\"commandOmitted\":true");
|
||||
expect(formattedSummary).toContain("\"dumpPath\"");
|
||||
rmSync(payload.dumpPath, { force: true });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user