mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 19:32:27 +00:00
fix(test): harden planner artifact cleanup and profile env fallback
This commit is contained in:
@@ -3,6 +3,7 @@ import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createExecutionArtifacts,
|
||||
createTempArtifactWriteStream,
|
||||
resolvePnpmCommandInvocation,
|
||||
resolveVitestFsModuleCachePath,
|
||||
} from "../../scripts/test-planner/executor.mjs";
|
||||
@@ -348,6 +349,24 @@ describe("test planner", () => {
|
||||
expect(fs.existsSync(artifactDir)).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps fd-backed artifact streams writable after temp cleanup", async () => {
|
||||
const artifacts = createExecutionArtifacts({});
|
||||
const artifactDir = artifacts.ensureTempArtifactDir();
|
||||
const logPath = path.join(artifactDir, "lane.log");
|
||||
const stream = createTempArtifactWriteStream(logPath);
|
||||
|
||||
stream.write("before cleanup\n");
|
||||
artifacts.cleanupTempArtifacts();
|
||||
|
||||
await expect(
|
||||
new Promise((resolve, reject) => {
|
||||
stream.on("error", reject);
|
||||
stream.end("after cleanup\n", resolve);
|
||||
}),
|
||||
).resolves.toBeNull();
|
||||
expect(fs.existsSync(artifactDir)).toBe(false);
|
||||
});
|
||||
|
||||
it("builds a CI manifest with planner-owned shard counts and matrices", () => {
|
||||
const manifest = buildCIExecutionManifest(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user