@se-studio/site-check 2.1.2 → 2.1.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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/smoke-test-one.mjs +17 -6
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/smoke-test-one.mjs
CHANGED
|
@@ -151,10 +151,24 @@ function appendTeeLog(buffer, chunk, stream) {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
function attachTeeHandlers(child, buffer) {
|
|
154
|
+
child.stdout?.setEncoding('utf8');
|
|
155
|
+
child.stderr?.setEncoding('utf8');
|
|
154
156
|
child.stdout?.on('data', (chunk) => appendTeeLog(buffer, chunk, process.stdout));
|
|
155
157
|
child.stderr?.on('data', (chunk) => appendTeeLog(buffer, chunk, process.stderr));
|
|
156
158
|
}
|
|
157
159
|
|
|
160
|
+
function runSmokeTests(appDir, smokeEnv) {
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
const child = spawn('pnpm', ['smoke-test:run'], {
|
|
163
|
+
cwd: appDir,
|
|
164
|
+
stdio: 'inherit',
|
|
165
|
+
env: smokeEnv,
|
|
166
|
+
});
|
|
167
|
+
child.on('error', reject);
|
|
168
|
+
child.on('exit', (code) => resolve(code ?? 1));
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
158
172
|
async function loadCacheLogAudit() {
|
|
159
173
|
const modulePath = path.join(packageDir, 'dist/smoke-test/cache-log-audit.js');
|
|
160
174
|
return import(modulePath);
|
|
@@ -256,12 +270,9 @@ try {
|
|
|
256
270
|
}
|
|
257
271
|
|
|
258
272
|
console.log('Running smoke tests...');
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
env: smokeEnv,
|
|
263
|
-
});
|
|
264
|
-
exitCode = runResult.status ?? 1;
|
|
273
|
+
// Must not use spawnSync here when audit pipes server logs — sync blocks the event loop,
|
|
274
|
+
// pipe buffers fill, and the dev server deadlocks mid-compile.
|
|
275
|
+
exitCode = await runSmokeTests(appDir, smokeEnv);
|
|
265
276
|
|
|
266
277
|
if (auditCacheLogsEnabled && spawnedServer) {
|
|
267
278
|
const { auditCacheLogs, formatCacheLogAuditReport, getCacheLogAuditExitCode } =
|