mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 20:35:39 -06:00
fix(qa): require Telegram proof report before publish
This commit is contained in:
@@ -1997,6 +1997,7 @@ const FULL_ARTIFACT_JSON_NAMES = new Set([
|
||||
"telegram-user-crabbox-session-summary.json",
|
||||
]);
|
||||
const FULL_ARTIFACT_FILE_EXTENSIONS = new Set([".gif", ".log", ".md", ".mp4", ".png"]);
|
||||
const FULL_ARTIFACT_PROOF_REPORT = "telegram-user-crabbox-proof.md";
|
||||
const TIMESTAMPED_PROBE_ARTIFACT_JSON = /^probe-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-\d{3}Z\.json$/u;
|
||||
|
||||
function isFullArtifactJsonName(name: string) {
|
||||
@@ -2004,6 +2005,10 @@ function isFullArtifactJsonName(name: string) {
|
||||
}
|
||||
|
||||
export function stageFullSessionArtifacts(outputDir: string) {
|
||||
if (!fs.existsSync(path.join(outputDir, FULL_ARTIFACT_PROOF_REPORT))) {
|
||||
throw new Error(`Missing proof report. Run finish first: ${FULL_ARTIFACT_PROOF_REPORT}`);
|
||||
}
|
||||
|
||||
const publishDir = path.join(outputDir, "publish-full-artifacts");
|
||||
fs.rmSync(publishDir, { force: true, recursive: true });
|
||||
fs.mkdirSync(publishDir, { recursive: true });
|
||||
|
||||
@@ -291,6 +291,21 @@ describe("telegram user Crabbox proof log polling", () => {
|
||||
expect(fs.existsSync(path.join(stagedDir, "stale.txt"))).toBe(false);
|
||||
});
|
||||
|
||||
it("requires finish to write the proof report before full artifact publishing", () => {
|
||||
const outputDir = makeTempDir();
|
||||
fs.writeFileSync(
|
||||
path.join(outputDir, "session.json"),
|
||||
'{"sshKey":"/private/tmp/openclaw/key"}',
|
||||
);
|
||||
fs.writeFileSync(path.join(outputDir, "status.json"), '{"ok":true}');
|
||||
fs.writeFileSync(path.join(outputDir, "telegram-desktop.log"), "log");
|
||||
|
||||
expect(() => stageFullSessionArtifacts(outputDir)).toThrow(
|
||||
"Missing proof report. Run finish first: telegram-user-crabbox-proof.md",
|
||||
);
|
||||
expect(fs.existsSync(path.join(outputDir, "publish-full-artifacts"))).toBe(false);
|
||||
});
|
||||
|
||||
posixIt("does not expand generated remote probe arguments in the shell", () => {
|
||||
const root = makeTempDir();
|
||||
const fakePython = path.join(root, "python3");
|
||||
|
||||
Reference in New Issue
Block a user