Skip to content

Commit 28931d9

Browse files
authored
Fix Windows compatibility in tier-check client conformance
Two issues prevented client conformance tests from running on Windows: 1. Single-quote quoting in execSync: The --command argument was wrapped in single quotes, which cmd.exe treats as literal characters rather than string delimiters. This caused the CLI to receive only the first word of the command. Switched to execFileSync with an args array to bypass shell quoting entirely. 2. Backslash path separators in parseOutputDir: dirname() on Windows returns auth\scenario-name but reconcileWithExpected compares against auth/scenario-name, causing auth scenarios to be double-counted. Normalize backslashes to forward slashes in parsed scenario names.
1 parent a2855b0 commit 28931d9

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

src/tier-check/checks/test-conformance-results.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { execSync } from 'child_process';
1+
import { execFileSync } from 'child_process';
22
import { mkdtempSync, readFileSync, existsSync, globSync } from 'fs';
33
import { join, dirname } from 'path';
44
import { tmpdir } from 'os';
@@ -43,7 +43,7 @@ function parseOutputDir(outputDir: string): ConformanceResult {
4343
const checksFiles = globSync('**/checks.json', { cwd: outputDir });
4444

4545
for (const checksFile of checksFiles) {
46-
const scenarioName = dirname(checksFile);
46+
const scenarioName = dirname(checksFile).replace(/\\/g, '/');
4747
const checksPath = join(outputDir, checksFile);
4848

4949
try {
@@ -181,8 +181,9 @@ export async function checkConformance(options: {
181181
const outputDir = mkdtempSync(join(tmpdir(), 'tier-check-server-'));
182182

183183
try {
184-
execSync(
185-
`node dist/index.js server --url ${options.serverUrl} -o ${outputDir}`,
184+
execFileSync(
185+
process.execPath,
186+
['dist/index.js', 'server', '--url', options.serverUrl, '-o', outputDir],
186187
{
187188
cwd: process.cwd(),
188189
stdio: ['pipe', 'pipe', 'pipe'],
@@ -221,8 +222,18 @@ export async function checkClientConformance(options: {
221222
const outputDir = mkdtempSync(join(tmpdir(), 'tier-check-client-'));
222223

223224
try {
224-
execSync(
225-
`node dist/index.js client --command '${options.clientCmd}' --suite all -o ${outputDir}`,
225+
execFileSync(
226+
process.execPath,
227+
[
228+
'dist/index.js',
229+
'client',
230+
'--command',
231+
options.clientCmd,
232+
'--suite',
233+
'all',
234+
'-o',
235+
outputDir
236+
],
226237
{
227238
cwd: process.cwd(),
228239
stdio: ['pipe', 'pipe', 'pipe'],

0 commit comments

Comments
 (0)