Skip to content

Commit c82fd65

Browse files
fix: recurse into subdirectories when parsing conformance output (#148)
parseOutputDir only read one level deep, so scenarios with '/' in their name (e.g. auth/metadata-default) were stored in nested subdirectories and never found. This caused tier-check to report 4/23 client conformance when the actual pass rate was 23/23. Also removes accidentally committed pnpm-lock.yaml.
1 parent 3b4a92b commit c82fd65

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { execSync } from 'child_process';
2-
import { mkdtempSync, readFileSync, readdirSync, existsSync } from 'fs';
3-
import { join } from 'path';
2+
import { mkdtempSync, readFileSync, existsSync, globSync } from 'fs';
3+
import { join, dirname } from 'path';
44
import { tmpdir } from 'os';
55
import { ConformanceResult } from '../types';
66
import { listScenarios, listActiveClientScenarios } from '../../scenarios';
@@ -26,10 +26,13 @@ function parseOutputDir(outputDir: string): ConformanceResult {
2626
let totalPassed = 0;
2727
let totalFailed = 0;
2828

29-
const entries = readdirSync(outputDir);
30-
for (const scenarioName of entries) {
31-
const checksPath = join(outputDir, scenarioName, 'checks.json');
32-
if (!existsSync(checksPath)) continue;
29+
// Find all checks.json files recursively to handle scenarios with '/' in
30+
// their name (e.g. auth/metadata-default) which create nested subdirectories.
31+
const checksFiles = globSync('**/checks.json', { cwd: outputDir });
32+
33+
for (const checksFile of checksFiles) {
34+
const scenarioName = dirname(checksFile);
35+
const checksPath = join(outputDir, checksFile);
3336

3437
try {
3538
const checks: ConformanceCheck[] = JSON.parse(

0 commit comments

Comments
 (0)