From c701edd977c8103f8183f153d5bedabee3cba365 Mon Sep 17 00:00:00 2001 From: Andrea Manzi Date: Sun, 1 Nov 2026 14:55:56 +0100 Subject: [PATCH] =?UTF-8?q?Le=20prove=20a=20sezioni:=20lo=20script=20che?= =?UTF-8?q?=20le=20pianifica=20non=20=C3=A8=20pi=C3=B9=20un=20ingresso=20d?= =?UTF-8?q?elle=20prove=20(cambiarlo=20non=20fa=20rifare=20il=20gioco;=20l?= =?UTF-8?q?o=20prova=20verify.test.mjs);=20il=20piano=20dice=20quando=20?= =?UTF-8?q?=C3=A8=20cambiato=20l'elenco=20dei=20file=20e=20non=20un=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GiECd9RWGMKV7n3K1mdy8T --- scripts/verify.mjs | 8 ++++---- tests/verify.test.mjs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/verify.mjs b/scripts/verify.mjs index 98e7455..b672603 100644 --- a/scripts/verify.mjs +++ b/scripts/verify.mjs @@ -16,10 +16,10 @@ import { cpus } from 'node:os'; // Il motore comune a tutto: cambia questo e si riprova ogni minigioco. export const ENGINE = ['index.html', 'style.css', 'src/main.js', 'src/engine/game.js', 'src/engine/render.js', - 'tests/helpers.mjs', 'package-lock.json', 'scripts/verify.mjs']; + 'tests/helpers.mjs', 'package-lock.json']; // Non toccano il gioco nel browser: documenti, strumenti, pubblicazione, versione (make bump la cambia prima di verificare), -// test unitari (girano sempre, a parte). -export const IGNORED = [/^docs\//, /^[^/]*\.md$/, /^src\/version\.js$/, /^package\.json$/, /^Makefile$/, /^scripts\/(?!verify\.mjs)/, +// test unitari (girano sempre, a parte), e questo stesso script (lo prova verify.test.mjs). +export const IGNORED = [/^docs\//, /^[^/]*\.md$/, /^src\/version\.js$/, /^package\.json$/, /^Makefile$/, /^scripts\//, /^tools\//, /^video\//, /^\.gitea\//, /^prompts\//, /^LICENSE$/, /^Dockerfile$/, /^nginx\.conf$/, /^docker-compose/, /^requirements\.txt$/, /^\.(gitignore|dockerignore|verify-ok\.json)$/, /^tests\/[^/]*\.test\.mjs$/, /^tests\/test_[^/]*\.py$/, /^deploy\.local\.mk$/, /(^|\/)__pycache__\//]; @@ -116,7 +116,7 @@ async function main() { const green = Object.keys(SUITES).filter(n => !todo.some(t => t.name === n)); if (!todo.length) { console.log(`Prove nel browser: tutte verdi dall'ultimo giro (${green.length}); niente da rifare.`); return; } for (const t of todo) { - const why = all ? 'tutte' : named.includes(t.name) ? 'chiesta' : !ok[t.name] ? 'mai provata' : `cambiati ${t.changed.slice(0, 4).join(', ')}${t.changed.length > 4 ? ` e altri ${t.changed.length - 4}` : ''}`; + const why = all ? 'tutte' : named.includes(t.name) ? 'chiesta' : !ok[t.name] ? 'mai provata' : !t.changed.length ? "cambiato l'elenco dei file da cui dipende" : `cambiati ${t.changed.slice(0, 4).join(', ')}${t.changed.length > 4 ? ` e altri ${t.changed.length - 4}` : ''}`; console.log(`da rifare: ${t.name}${t.seconds ? ` (~${t.seconds} s)` : ''}: ${why}`); } if (green.length) console.log(`giĆ  verdi: ${green.join(', ')}`); diff --git a/tests/verify.test.mjs b/tests/verify.test.mjs index 872811a..7c78bfb 100644 --- a/tests/verify.test.mjs +++ b/tests/verify.test.mjs @@ -50,7 +50,7 @@ test('il motore comune fa rifare tutto', () => { }); test('versione, package.json, Makefile, documenti, strumenti e test unitari non fanno rifare niente', () => { - for (const path of ['src/version.js', 'package.json', 'Makefile', 'README.md', 'docs/STATO.md', 'scripts/bump.sh', 'tools/slice_sprites.py', 'tests/briscola.test.mjs', 'tests/story.test.mjs', '.verify-ok.json']) { + for (const path of ['src/version.js', 'package.json', 'Makefile', 'README.md', 'docs/STATO.md', 'scripts/bump.sh', 'scripts/verify.mjs', 'tools/slice_sprites.py', 'tests/briscola.test.mjs', 'tests/story.test.mjs', '.verify-ok.json']) { assert.ok(ignored(path), `${path} dovrebbe essere ignorato`); assert.deepEqual(suitesWith(path), [], path); }