From 55f2b4b9649b294f5ea4bccaa24b8957050c243e Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Thu, 27 Nov 2025 10:24:41 -0800 Subject: [PATCH] Delete: Cleanup script no longer needed --- scripts/cleanup-results.js | 50 -------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 scripts/cleanup-results.js diff --git a/scripts/cleanup-results.js b/scripts/cleanup-results.js deleted file mode 100644 index 592df32..0000000 --- a/scripts/cleanup-results.js +++ /dev/null @@ -1,50 +0,0 @@ -import { promises as fs } from 'fs'; -import path from 'path'; - -const CWD = process.cwd(); -const TESTS_DIR = path.join(CWD, 'tests'); -const RESULTS_FILE = path.join(CWD, 'results.json'); - -const main = async () => { - // Get list of currently existing test directories - const existingTests = new Set( - (await fs.readdir(TESTS_DIR, { withFileTypes: true })) - .filter(d => d.isDirectory()) - .map(d => d.name) - ); - - // Read results.json - let results = {}; - try { - const content = await fs.readFile(RESULTS_FILE, 'utf-8'); - results = JSON.parse(content); - } catch (e) { - console.error('Could not read results.json', e); - process.exit(1); - } - - let changed = false; - - // Iterate over every model in results - for (const modelKey in results) { - const modelResults = results[modelKey]; - const testsInResult = Object.keys(modelResults); - - for (const testName of testsInResult) { - if (!existingTests.has(testName)) { - console.log(`Removing stale test result: ${testName} for ${modelKey}`); - delete modelResults[testName]; - changed = true; - } - } - } - - if (changed) { - await fs.writeFile(RESULTS_FILE, JSON.stringify(results, null, 2)); - console.log('results.json updated.'); - } else { - console.log('No stale results found.'); - } -}; - -main().catch(console.error);