mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Fix status file
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
appendFileSync,
|
||||
readdirSync,
|
||||
rmSync,
|
||||
writeFileSync,
|
||||
} from "node:fs";
|
||||
import { spawn, spawnSync } from "node:child_process";
|
||||
import { tmpdir, hostname, userInfo, homedir } from "node:os";
|
||||
@@ -106,8 +107,14 @@ async function runTests(target, filters) {
|
||||
|
||||
if (isBuildKite) {
|
||||
const { ok, testPath, error, stdout, stdoutPreview } = result;
|
||||
|
||||
const logsPath = join(cwd, "logs");
|
||||
mkdirSync(logsPath, { recursive: true });
|
||||
const logFilePath = join(logsPath, `${testPath}.log`);
|
||||
mkdirSync(dirname(logFilePath), { recursive: true });
|
||||
writeFileSync(logFilePath, stripAnsi(stdout));
|
||||
if (!ok) {
|
||||
uploadArtifactsToBuildKite(logFilePath);
|
||||
}
|
||||
|
||||
const statusFilePath = join(logsPath, ok ? "PASSED.txt" : "FAILED.txt");
|
||||
appendFileSync(statusFilePath, `${testPath}\n`);
|
||||
@@ -115,12 +122,6 @@ async function runTests(target, filters) {
|
||||
uploadArtifactsToBuildKite(statusFilePath);
|
||||
}
|
||||
|
||||
const logFilePath = join(logsPath, `${testPath}.log`);
|
||||
appendFileSync(logFilePath, stripAnsi(stdout));
|
||||
if (!ok) {
|
||||
uploadArtifactsToBuildKite(logFilePath);
|
||||
}
|
||||
|
||||
const markdown = formatTestToMarkdown(result);
|
||||
if (markdown) {
|
||||
reportAnnotationToBuildKite(title, markdown);
|
||||
|
||||
Reference in New Issue
Block a user