try to fix windows tests again

This commit is contained in:
Nate 2025-07-19 22:11:30 -07:00
parent 48090f52ae
commit 00c646e67a
2 changed files with 23 additions and 3 deletions

View file

@ -27,6 +27,9 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm test
env:
@ -50,9 +53,6 @@ jobs:
- name: Run linting
run: npm run lint
- name: Build
run: npm run build
# GitHub does not have a way of requiring that all checks pass (you must manually select each job)
# This action at least lets us manage the list of required tests via source control
# so that creators of new jobs can add them to this list

View file

@ -66,6 +66,17 @@ export async function runCLI(
expectError = false,
} = options;
// Windows CI diagnostics
if (process.platform === "win32" && process.env.CI) {
console.log("Windows CI Diagnostics:");
console.log("- CLI Path:", context.cliPath);
console.log("- Absolute CLI Path:", path.resolve(context.cliPath));
console.log("- File exists:", await fs.access(context.cliPath).then(() => true).catch(() => false));
console.log("- Working dir:", context.testDir);
console.log("- Node version:", process.version);
console.log("- Process platform:", process.platform);
}
const execOptions = {
cwd: context.testDir,
env: {
@ -93,6 +104,15 @@ export async function runCLI(
};
try {
// On Windows CI, log the actual command being executed
if (process.platform === "win32" && process.env.CI) {
console.log("Executing command:", {
node: process.execPath,
script: context.cliPath,
args: args,
});
}
const result = await execaNode(context.cliPath, args, execOptions);
// Ensure stdout/stderr are always strings