@mandujs/ate 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -1
- package/src/pipeline.ts +1 -1
- package/src/runner.ts +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mandujs/ate",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.3",
|
|
4
4
|
"description": "Mandu ATE (Automation Test Engine) - extract/generate/run/report/heal/impact in one package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,7 +31,16 @@
|
|
|
31
31
|
"playwright",
|
|
32
32
|
"ts-morph"
|
|
33
33
|
],
|
|
34
|
+
"author": "konamgil",
|
|
34
35
|
"license": "MPL-2.0",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/konamgil/mandu.git",
|
|
39
|
+
"directory": "packages/ate"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
35
44
|
"dependencies": {
|
|
36
45
|
"fast-glob": "^3.3.2",
|
|
37
46
|
"ts-morph": "^26.0.0"
|
package/src/pipeline.ts
CHANGED
|
@@ -197,7 +197,7 @@ export async function runFullPipeline(options: AutoPipelineOptions): Promise<Aut
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// 최종 결과
|
|
200
|
-
result.ok = result.steps.extract.ok && result.steps.generate.ok && result.steps.report.ok;
|
|
200
|
+
result.ok = result.steps.extract.ok && result.steps.generate.ok && result.steps.run.ok && result.steps.report.ok;
|
|
201
201
|
console.log(
|
|
202
202
|
`\n${result.ok ? "✅" : "⚠️"} [ATE Pipeline] 파이프라인 완료 - 전체 성공: ${result.ok}`,
|
|
203
203
|
);
|
package/src/runner.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
1
|
+
import { spawn, execFileSync } from "node:child_process";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { getAtePaths, ensureDir, writeJson } from "./fs";
|
|
4
4
|
import type { RunInput } from "./types";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* bunx 또는 bun x 중 사용 가능한 실행 명령을 반환한다.
|
|
8
|
+
*/
|
|
9
|
+
function resolveBunx(): { cmd: string; args: string[] } {
|
|
10
|
+
try {
|
|
11
|
+
execFileSync("bunx", ["--version"], { stdio: "ignore" });
|
|
12
|
+
return { cmd: "bunx", args: [] };
|
|
13
|
+
} catch {
|
|
14
|
+
return { cmd: "bun", args: ["x"] };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
export interface RunResult {
|
|
7
19
|
runId: string;
|
|
8
20
|
reportDir: string;
|
|
@@ -50,15 +62,17 @@ export async function runPlaywright(input: RunInput): Promise<RunResult> {
|
|
|
50
62
|
BASE_URL: baseURL,
|
|
51
63
|
};
|
|
52
64
|
|
|
65
|
+
const { cmd, args: prefixArgs } = resolveBunx();
|
|
66
|
+
|
|
53
67
|
let child;
|
|
54
68
|
try {
|
|
55
|
-
child = spawn(
|
|
69
|
+
child = spawn(cmd, [...prefixArgs, ...args], {
|
|
56
70
|
cwd: repoRoot,
|
|
57
71
|
stdio: "inherit",
|
|
58
72
|
env,
|
|
59
73
|
});
|
|
60
74
|
} catch (err: unknown) {
|
|
61
|
-
throw new Error(`Playwright 프로세스 시작
|
|
75
|
+
throw new Error(`Playwright 프로세스 시작 실패 (${cmd}): ${err instanceof Error ? err.message : String(err)}`);
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
const exitCode: number = await new Promise((resolve, reject) => {
|
|
@@ -75,8 +89,8 @@ export async function runPlaywright(input: RunInput): Promise<RunResult> {
|
|
|
75
89
|
|
|
76
90
|
child.on("error", (err) => {
|
|
77
91
|
clearTimeout(timeout);
|
|
78
|
-
|
|
79
|
-
|
|
92
|
+
// spawn 자체 실패는 환경 문제 — 테스트 실패와 구분하기 위해 명시적 에러
|
|
93
|
+
reject(new Error(`Playwright 실행기 오류 (환경 문제): ${err.message}`));
|
|
80
94
|
});
|
|
81
95
|
});
|
|
82
96
|
|