From 6efc1e28bd6c029e9f10bbda86ea92ed3e99c7b0 Mon Sep 17 00:00:00 2001 From: Jonah Date: Mon, 13 Jul 2026 16:54:47 +1200 Subject: [PATCH] query tests: list skipped SQL blocks with file:line Previously the skip/undecorated count was reported but not which blocks. Adds a Skipped section listing each skipped block's file, line number, label, and reason (sqltest: skip vs undecorated). --- scripts/test-queries.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/test-queries.js b/scripts/test-queries.js index d0b990e..607e5a7 100644 --- a/scripts/test-queries.js +++ b/scripts/test-queries.js @@ -78,7 +78,23 @@ const allBlocks = files.flatMap((f) => const blocks = allBlocks.filter((b) => b.ann === 'skip' ? false : testAll ? true : b.ann !== null ); -const undecorated = allBlocks.length - blocks.length; +const skipped = allBlocks.filter((b) => !blocks.includes(b)); +const undecorated = skipped.length; + +function printSkipped() { + if (skipped.length === 0) return; + console.log(`${bold}Skipped${reset}`); + let lastFile = null; + for (const b of skipped) { + if (b.file !== lastFile) { + console.log(` ${cyan}${b.file}${reset}`); + lastFile = b.file; + } + const reason = b.ann === 'skip' ? 'sqltest: skip' : 'undecorated'; + console.log(` ${yellow}-${reset}${dim}:${b.line}${reset} ${b.label} ${dim}(${reason})${reset}`); + } + console.log(); +} if (blocks.length === 0) { console.log( @@ -86,6 +102,7 @@ if (blocks.length === 0) { (undecorated ? ` (${undecorated} undecorated — add or pass --all)` : '') + '.' ); + printSkipped(); process.exit(0); } @@ -161,9 +178,12 @@ for (const b of blocks) { } } +console.log(); +printSkipped(); + const passed = blocks.length - failed; console.log( - `\n${bold}${failed ? red : green}${passed} passed${reset}${dim}, ${failed} failed` + + `${bold}${failed ? red : green}${passed} passed${reset}${dim}, ${failed} failed` + (undecorated ? `, ${undecorated} undecorated/skipped` : '') + reset );