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.
This commit is contained in:
Felix Weinberger 2026-02-13 16:13:48 +00:00 • committed by GitHub
commit c82fd65cfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
import { execSync } from 'child_process'; import { execSync } from 'child_process';
import { mkdtempSync, readFileSync, readdirSync, existsSync } from 'fs'; import { mkdtempSync, readFileSync, existsSync, globSync } from 'fs';
import { join } from 'path'; import { join, dirname } from 'path';
import { tmpdir } from 'os'; import { tmpdir } from 'os';
import { ConformanceResult } from '../types'; import { ConformanceResult } from '../types';
import { listScenarios, listActiveClientScenarios } from '../../scenarios'; import { listScenarios, listActiveClientScenarios } from '../../scenarios';
@ -26,10 +26,13 @@ function parseOutputDir(outputDir: string): ConformanceResult {
let totalPassed = 0; let totalPassed = 0;
let totalFailed = 0; let totalFailed = 0;
const entries = readdirSync(outputDir); // Find all checks.json files recursively to handle scenarios with '/' in
for (const scenarioName of entries) { // their name (e.g. auth/metadata-default) which create nested subdirectories.
const checksPath = join(outputDir, scenarioName, 'checks.json'); const checksFiles = globSync('**/checks.json', { cwd: outputDir });
if (!existsSync(checksPath)) continue;
for (const checksFile of checksFiles) {
const scenarioName = dirname(checksFile);
const checksPath = join(outputDir, checksFile);
try { try {
const checks: ConformanceCheck[] = JSON.parse( const checks: ConformanceCheck[] = JSON.parse(