Skip to content

Commit 7056d34

Browse files
committed
fix(cli): suppress inspectProject stdout in integration test to avoid node:test IPC corruption (nodejs/node#64061)
1 parent 657783a commit 7056d34

2 files changed

Lines changed: 30 additions & 29 deletions

File tree

‎packages/cli/src/deploy/deploy.integration.test.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ test("inspectProject loads and inspects fixture without error", async () => {
151151
const { inspectProject } = await import("./inspect.js");
152152
const projectDir = await createQuarkFixture();
153153

154-
await inspectProject({ cwd: projectDir });
154+
// Suppress stdout — inspectProject prints a report via console.log, and
155+
// unstructured text on the test runner's stdout pipe can corrupt the
156+
// binary v8-serialized result frames (nodejs/node#64061), flaking CI.
157+
await inspectProject({ cwd: projectDir, output: () => {} });
155158
});
156159

157160
// ---------------------------------------------------------------------------

‎packages/cli/src/deploy/inspect.js‎

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,68 +16,66 @@ function formatBool(value) {
1616
}
1717

1818
export async function inspectProject(options = {}) {
19-
const { cwd = process.cwd() } = options;
19+
const { cwd = process.cwd(), output = console.log } = options;
2020

21-
console.log(chalk.blue.bold("\n🔍 Quark Deploy Inspection\n"));
21+
output(chalk.blue.bold("\n🔍 Quark Deploy Inspection\n"));
2222

2323
// --- Service discovery ---
24-
console.log(chalk.cyan(" Project Services\n"));
24+
output(chalk.cyan(" Project Services\n"));
2525

2626
const discovery = await discoverQuarkDeployProject(cwd);
2727

2828
if (discovery.services.length === 0) {
29-
console.log(chalk.yellow(" No Quark services discovered."));
29+
output(chalk.yellow(" No Quark services discovered."));
3030
} else {
3131
for (const service of discovery.services) {
32-
console.log(` ${chalk.bold(service.name)}`);
33-
console.log(
34-
` Package: ${service.packageName ?? chalk.dim("unknown")}`,
35-
);
36-
console.log(` Root: ${service.relativeRootDir}`);
37-
console.log(` Entrypoint: ${service.runtime.relativeEntrypoint}`);
32+
output(` ${chalk.bold(service.name)}`);
33+
output(` Package: ${service.packageName ?? chalk.dim("unknown")}`);
34+
output(` Root: ${service.relativeRootDir}`);
35+
output(` Entrypoint: ${service.runtime.relativeEntrypoint}`);
3836
if (service.runtime.healthcheckPath) {
39-
console.log(` Health: ${service.runtime.healthcheckPath}`);
37+
output(` Health: ${service.runtime.healthcheckPath}`);
4038
}
41-
console.log(
39+
output(
4240
` Required: ${service.required ? chalk.green("yes") : chalk.dim("no")}`,
4341
);
44-
console.log();
42+
output();
4543
}
4644
}
4745

4846
// --- Diagnostics ---
4947
if (discovery.diagnostics.length > 0) {
50-
console.log(chalk.yellow(" Diagnostics\n"));
48+
output(chalk.yellow(" Diagnostics\n"));
5149
for (const diagnostic of discovery.diagnostics) {
52-
console.log(` ${chalk.yellow("⚠")} ${diagnostic.message}`);
50+
output(` ${chalk.yellow("⚠")} ${diagnostic.message}`);
5351
}
54-
console.log();
52+
output();
5553
}
5654

5755
// --- Railway readiness ---
58-
console.log(chalk.cyan(" Railway Readiness\n"));
56+
output(chalk.cyan(" Railway Readiness\n"));
5957

6058
const railCLIVersion = await checkRailwayCLI();
61-
console.log(` CLI installed: ${formatBool(!!railCLIVersion)}`);
59+
output(` CLI installed: ${formatBool(!!railCLIVersion)}`);
6260
if (railCLIVersion) {
63-
console.log(` Version: ${railCLIVersion}`);
61+
output(` Version: ${railCLIVersion}`);
6462
}
6563

6664
const railUser = await checkRailwayLogin();
67-
console.log(` Logged in: ${formatBool(!!railUser)}`);
65+
output(` Logged in: ${formatBool(!!railUser)}`);
6866
if (railUser) {
69-
console.log(` User: ${railUser}`);
67+
output(` User: ${railUser}`);
7068
}
7169

7270
const linked = await isProjectLinked(cwd);
73-
console.log(` Project linked: ${formatBool(linked)}`);
71+
output(` Project linked: ${formatBool(linked)}`);
7472

7573
if (linked) {
7674
const domains = await getProjectDomains({ cwd });
7775
if (domains.length > 0) {
78-
console.log(chalk.green("\n Deployed Services\n"));
76+
output(chalk.green("\n Deployed Services\n"));
7977
for (const domain of domains) {
80-
console.log(
78+
output(
8179
` ${domain.service ?? chalk.dim("unknown")}: ${domain.domain ?? chalk.dim("no domain")}`,
8280
);
8381
}
@@ -86,7 +84,7 @@ export async function inspectProject(options = {}) {
8684

8785
// --- Service Status ---
8886
if (linked) {
89-
console.log(chalk.cyan(" Service Status\n"));
87+
output(chalk.cyan(" Service Status\n"));
9088

9189
try {
9290
const configPath = path.join(cwd, ".railway", "config.json");
@@ -117,16 +115,16 @@ export async function inspectProject(options = {}) {
117115
coloredStatus = chalk.dim(status);
118116
}
119117
const url = `https://railway.com/project/${projectId}/service/${service.id}`;
120-
console.log(
118+
output(
121119
` ${chalk.bold(service.name)} : ${coloredStatus} (${shortId}) → ${chalk.dim(url)}`,
122120
);
123121
}
124122
} catch (err) {
125-
console.log(
123+
output(
126124
` ${chalk.red("✖")} ${chalk.dim(`Failed to fetch service status: ${err.message}`)}`,
127125
);
128126
}
129127
}
130128

131-
console.log();
129+
output();
132130
}

0 commit comments

Comments
 (0)