@roomi-fields/grillhouse 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +48 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/dist/temporal/circuit/client.d.ts +2 -2
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +4 -4
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +3 -3
- package/dist/temporal/circuit/contrat.js +8 -2
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +3 -3
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +5 -6
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +3 -6
- package/dist/temporal/installation.js +19 -38
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/tickets/activites.d.ts +1 -0
- package/dist/temporal/tickets/activites.js +5 -0
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +10 -0
- package/dist/temporal/tickets/deroule.js +8 -1
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/docs/ARCHITECTURE.md +119 -27
- package/docs/CADRE.md +20 -0
- package/docs/INTERFACE.md +17 -4
- package/hooks/hooks.json +4 -0
- package/package.json +2 -2
- package/scripts/activites.mjs +155 -84
- package/scripts/aiguillage.mjs +35 -11
- package/scripts/attente-au-tour.mjs +99 -0
- package/scripts/avancement.mjs +27 -10
- package/scripts/base-des-workflows.mjs +57 -0
- package/scripts/bilan.mjs +101 -25
- package/scripts/cadre.mjs +5 -2
- package/scripts/circuit.mjs +173 -58
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +5 -3
- package/scripts/conformite.mjs +54 -19
- package/scripts/copies-finies.mjs +8 -1
- package/scripts/dependances-internes.mjs +9 -3
- package/scripts/dernier-vert.mjs +84 -23
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +24 -8
- package/scripts/droits.mjs +40 -15
- package/scripts/effets.mjs +9 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +141 -48
- package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
- package/scripts/etapes.mjs +1 -1
- package/scripts/faits-du-circuit.mjs +1 -1
- package/scripts/flux-des-paquets.mjs +21 -7
- package/scripts/gardes-du-cadre.mjs +9 -3
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +84 -29
- package/scripts/integration/integrer.mjs +70 -24
- package/scripts/integration/rejeu.mjs +26 -9
- package/scripts/jointure.d.ts +10 -1
- package/scripts/journal-des-etats.d.mts +41 -0
- package/scripts/journal-des-etats.mjs +273 -0
- package/scripts/journal.mjs +119 -0
- package/scripts/langages/cargo/commandes.mjs +97 -18
- package/scripts/langages/cargo/composants.mjs +24 -8
- package/scripts/langages/cargo/index.mjs +7 -0
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +3 -1
- package/scripts/langages/python/index.mjs +6 -0
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/frontieres.mjs +112 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +12 -3
- package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
- package/scripts/langages/typescript/tests.mjs +24 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
- package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
- package/scripts/langages/typescript/verdict.mjs +3 -1
- package/scripts/langages/typescript/verifier.mjs +61 -14
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +10 -2
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages.d.mts +20 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/matiere-de-test.d.ts +11 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +9 -3
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
- package/scripts/nuit.sh +24 -0
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.mjs +18 -7
- package/scripts/paquet-npm.mjs +15 -5
- package/scripts/paquets.mjs +12 -4
- package/scripts/passe-de-la-machine.mjs +7 -2
- package/scripts/places-de-la-machine.mjs +72 -12
- package/scripts/preparation.mjs +15 -5
- package/scripts/registre.mjs +6 -2
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +105 -37
- package/scripts/seances.mjs +22 -4
- package/scripts/services-du-noyau.mjs +1 -0
- package/scripts/sous-commandes.mjs +5 -1
- package/scripts/style-a-l-ecriture.mjs +48 -17
- package/scripts/superviseur.mjs +127 -75
- package/scripts/tableau.mjs +133 -10
- package/scripts/taches-du-graphe.mjs +33 -13
- package/scripts/ticket-du-circuit.mjs +40 -0
- package/scripts/transitions.mjs +159 -29
- package/scripts/verrou-de-fichier.mjs +6 -2
- package/scripts/verrou-de-machine.mjs +123 -39
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/explorateur/SKILL.md +8 -2
- package/skills/grill/SKILL.md +3 -57
- package/skills/grill/references/paquets.md +60 -0
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +16 -27
- package/skills/questionneur/SKILL.md +1 -1
- package/skills/relecteur/SKILL.md +2 -2
- package/skills/testwriter/SKILL.md +19 -7
- package/skills/release/SKILL.md +0 -134
- package/skills/release/scripts/update-version.cjs +0 -92
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The subcommand `grillhouse journal [--depuis <ISO>] [--jusqu-a <ISO>] [--ticket <id>]`: the
|
|
3
|
+
// chronology of the journal of states of the project (scripts/journal-des-etats.mjs), its lines in
|
|
4
|
+
// the order of their timestamps, and, after each launch or end of a circuit of the queue, the set
|
|
5
|
+
// of the tickets at work against the ceiling of the circuits (`grillhouse.circuits`): one ticket at
|
|
6
|
+
// work when the ceiling allows two shows at once. Bounds are ISO 8601 with the local offset,
|
|
7
|
+
// included; a line unreadable is left out; no journal or no line in the range is said, exit 0.
|
|
8
|
+
// Exit 2 for an option unknown or a date unreadable.
|
|
9
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
import { pathToFileURL } from 'node:url';
|
|
12
|
+
import { reglageDesCircuits } from './circuits-cles.mjs';
|
|
13
|
+
import { dossierDuJournal, ensemblesEnTravail, lireLeJournal } from './journal-des-etats.mjs';
|
|
14
|
+
|
|
15
|
+
const USAGE = 'usage : grillhouse journal [--depuis <ISO>] [--jusqu-a <ISO>] [--ticket <id>]\n';
|
|
16
|
+
const ISO = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?([+-]\d{2}:\d{2}|Z)?)?$/;
|
|
17
|
+
|
|
18
|
+
// The options of <argv>, `{ depuis, jusquA, ticket }`, or `{ faute }`.
|
|
19
|
+
function options(argv) {
|
|
20
|
+
const cles = { '--depuis': 'depuis', '--jusqu-a': 'jusquA', '--ticket': 'ticket' };
|
|
21
|
+
const o = {};
|
|
22
|
+
for (let i = 0; i < argv.length; i += 2) {
|
|
23
|
+
const cle = cles[argv[i]];
|
|
24
|
+
if (!cle) {
|
|
25
|
+
return { faute: `option inconnue : ${argv[i]}` };
|
|
26
|
+
}
|
|
27
|
+
const v = argv[i + 1];
|
|
28
|
+
if (v === undefined) {
|
|
29
|
+
return { faute: `${argv[i]} attend une valeur` };
|
|
30
|
+
}
|
|
31
|
+
if (cle !== 'ticket' && (!ISO.test(v) || Number.isNaN(Date.parse(v)))) {
|
|
32
|
+
return { faute: `${argv[i]} : « ${v} » n'est pas une date ISO 8601` };
|
|
33
|
+
}
|
|
34
|
+
o[cle] = v;
|
|
35
|
+
}
|
|
36
|
+
return o;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// The ceiling of the circuits of the project at <racine>: its key, 1 when absent.
|
|
40
|
+
function plafond(racine) {
|
|
41
|
+
const f = path.join(racine, 'package.json');
|
|
42
|
+
try {
|
|
43
|
+
return reglageDesCircuits(existsSync(f) ? JSON.parse(readFileSync(f, 'utf8')) : {}).max ?? 1;
|
|
44
|
+
} catch {
|
|
45
|
+
return 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const heure = ts => ts.slice(11);
|
|
50
|
+
|
|
51
|
+
const ligneDe = l =>
|
|
52
|
+
[
|
|
53
|
+
l.ts,
|
|
54
|
+
String(l.genre ?? '').padEnd(7),
|
|
55
|
+
l.ticket ?? '-',
|
|
56
|
+
l.etape ?? '-',
|
|
57
|
+
...(l.boucle === null || l.boucle === undefined ? [] : [`boucle ${l.boucle}`]),
|
|
58
|
+
...(l.place ? [`place ${l.place}`] : []),
|
|
59
|
+
...(l.raison ? [`— ${l.raison}`] : []),
|
|
60
|
+
].join(' ');
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The subcommand: writes the chronology through <out>, its faults through <err>; the exit code.
|
|
64
|
+
* @param {string[]} argv
|
|
65
|
+
* @param {{ racine?: string, out?: (t: string) => void, err?: (t: string) => void }} [contexte]
|
|
66
|
+
* @returns {number}
|
|
67
|
+
*/
|
|
68
|
+
export function journal(
|
|
69
|
+
argv,
|
|
70
|
+
{
|
|
71
|
+
racine = process.cwd(),
|
|
72
|
+
out = t => process.stdout.write(`${t}\n`),
|
|
73
|
+
err = t => process.stderr.write(`${t}\n`),
|
|
74
|
+
} = {}
|
|
75
|
+
) {
|
|
76
|
+
const o = options(argv);
|
|
77
|
+
if (o.faute) {
|
|
78
|
+
err(`⛔ grillhouse journal : ${o.faute}\n${USAGE.trimEnd()}`);
|
|
79
|
+
return 2;
|
|
80
|
+
}
|
|
81
|
+
let dossier = null;
|
|
82
|
+
try {
|
|
83
|
+
dossier = dossierDuJournal(racine);
|
|
84
|
+
} catch {
|
|
85
|
+
// no git project: no journal
|
|
86
|
+
}
|
|
87
|
+
if (!dossier || !existsSync(dossier)) {
|
|
88
|
+
out('Aucun journal pour ce projet.');
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
// The sets are rebuilt from the start of the journal up to the end of the range, so that a range
|
|
92
|
+
// that starts mid-work knows who was already at work.
|
|
93
|
+
const jusqua = o.jusquA === undefined ? {} : { jusquA: o.jusquA };
|
|
94
|
+
const toutes = lireLeJournal(racine, jusqua).lignes;
|
|
95
|
+
const depuis = o.depuis === undefined ? -Infinity : Date.parse(o.depuis);
|
|
96
|
+
const affichees = toutes.filter(
|
|
97
|
+
l => Date.parse(l.ts) >= depuis && (o.ticket === undefined || l.ticket === o.ticket)
|
|
98
|
+
);
|
|
99
|
+
if (affichees.length === 0) {
|
|
100
|
+
out('Aucune ligne dans la plage.');
|
|
101
|
+
return 0;
|
|
102
|
+
}
|
|
103
|
+
const max = plafond(racine);
|
|
104
|
+
const parInstant = new Map(ensemblesEnTravail(toutes).map(e => [e.ts, e.enTravail]));
|
|
105
|
+
for (const l of affichees) {
|
|
106
|
+
out(ligneDe(l));
|
|
107
|
+
const ensemble = l.genre === 'file' ? parInstant.get(l.ts) : undefined;
|
|
108
|
+
if (ensemble) {
|
|
109
|
+
out(
|
|
110
|
+
` ${heure(l.ts)} en travail ${ensemble.length}/${max}${ensemble.length ? ` : ${ensemble.join(', ')}` : ''}`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
118
|
+
process.exitCode = journal(process.argv.slice(2));
|
|
119
|
+
}
|
|
@@ -119,6 +119,7 @@ import {
|
|
|
119
119
|
existsSync,
|
|
120
120
|
mkdirSync,
|
|
121
121
|
openSync,
|
|
122
|
+
readdirSync,
|
|
122
123
|
readFileSync,
|
|
123
124
|
rmSync,
|
|
124
125
|
writeFileSync,
|
|
@@ -285,7 +286,10 @@ function passe(racine, env) {
|
|
|
285
286
|
ecrire();
|
|
286
287
|
return { t, args };
|
|
287
288
|
},
|
|
288
|
-
jouer(
|
|
289
|
+
jouer(
|
|
290
|
+
{ t, args },
|
|
291
|
+
{ junit = null, journal = null, programme = 'cargo', temporaire = {} } = {}
|
|
292
|
+
) {
|
|
289
293
|
// A report of an earlier run is no report of this one, which may write none.
|
|
290
294
|
if (junit) {
|
|
291
295
|
rmSync(junit, { force: true });
|
|
@@ -305,7 +309,7 @@ function passe(racine, env) {
|
|
|
305
309
|
try {
|
|
306
310
|
r = spawnSync(programme, args, {
|
|
307
311
|
cwd: racine,
|
|
308
|
-
env: compilation,
|
|
312
|
+
env: { ...compilation, ...temporaire },
|
|
309
313
|
stdio: ['inherit', fd, fd],
|
|
310
314
|
});
|
|
311
315
|
} finally {
|
|
@@ -314,7 +318,11 @@ function passe(racine, env) {
|
|
|
314
318
|
process.stderr.write(readFileSync(journal, 'utf8'));
|
|
315
319
|
t.journal = path.relative(racine, journal);
|
|
316
320
|
} else {
|
|
317
|
-
r = spawnSync(programme, args, {
|
|
321
|
+
r = spawnSync(programme, args, {
|
|
322
|
+
cwd: racine,
|
|
323
|
+
env: { ...compilation, ...temporaire },
|
|
324
|
+
stdio: 'inherit',
|
|
325
|
+
});
|
|
318
326
|
}
|
|
319
327
|
t.code = r.error ? 127 : (r.status ?? 128 + (constants.signals[r.signal] ?? 0));
|
|
320
328
|
if (junit && dossier && existsSync(junit)) {
|
|
@@ -328,6 +336,15 @@ function passe(racine, env) {
|
|
|
328
336
|
ecrire();
|
|
329
337
|
return t.code;
|
|
330
338
|
},
|
|
339
|
+
// Turns red the first green task of tests of <paquet>: what its tests left in its temporary
|
|
340
|
+
// directory fails it.
|
|
341
|
+
rougir(paquet) {
|
|
342
|
+
const t = taches.find(x => x.paquet === paquet && x.tests && x.code === 0);
|
|
343
|
+
if (t) {
|
|
344
|
+
t.code = 1;
|
|
345
|
+
ecrire();
|
|
346
|
+
}
|
|
347
|
+
},
|
|
331
348
|
code() {
|
|
332
349
|
const rouges = taches.filter(t => t.code !== 0);
|
|
333
350
|
if (rouges.length === 0) {
|
|
@@ -363,7 +380,7 @@ function sousCharge(t, pressions) {
|
|
|
363
380
|
// the build of its test targets first, then nextest, then its doctests; a failed build leaves the
|
|
364
381
|
// crate's other tasks not played. The benches named, each crate's in a task `budget`, are
|
|
365
382
|
// planned with the rest and played by the function this one returns, after the other tests.
|
|
366
|
-
function jouerLesTests(racine, p, choix, options) {
|
|
383
|
+
function jouerLesTests(racine, p, choix, options, temporaire = () => ({})) {
|
|
367
384
|
const m = metadonnees(racine);
|
|
368
385
|
// Nextest's store is `target/nextest` under the workspace's root (its default `store.dir`),
|
|
369
386
|
// whatever the target directory of the compilations (./sccache.mjs).
|
|
@@ -416,21 +433,34 @@ function jouerLesTests(racine, p, choix, options) {
|
|
|
416
433
|
: []
|
|
417
434
|
: nommes;
|
|
418
435
|
const args = [...nextest, '-p', nom, ...selection, ...options];
|
|
419
|
-
prevues.push([
|
|
436
|
+
prevues.push([
|
|
437
|
+
p.prevoir(nom, d, 'nextest', true, args),
|
|
438
|
+
{ junit, temporaire: temporaire(nom) },
|
|
439
|
+
]);
|
|
420
440
|
}
|
|
421
441
|
if (desBancs.length) {
|
|
422
442
|
const args = [...nextestDuBanc, '-p', nom, ...desBancs.flatMap(n => ['--test', n])];
|
|
423
|
-
bancs.push({
|
|
443
|
+
bancs.push({
|
|
444
|
+
nom,
|
|
445
|
+
d,
|
|
446
|
+
temporaire: temporaire(nom),
|
|
447
|
+
args: [...args, '--test-threads', '1', ...options],
|
|
448
|
+
etat,
|
|
449
|
+
});
|
|
424
450
|
}
|
|
425
451
|
}
|
|
426
452
|
const doctests = c.cibles.some(t => t.kind.includes('lib') && t.doctest !== false);
|
|
427
453
|
if ((cibles.length === 0 || avecLeJour) && doctests) {
|
|
428
454
|
const args = ['test', '--doc', ...j, '-p', nom];
|
|
429
|
-
prevues.push([p.prevoir(nom, d, 'doctest', true, args), {}]);
|
|
455
|
+
prevues.push([p.prevoir(nom, d, 'doctest', true, args), { temporaire: temporaire(nom) }]);
|
|
430
456
|
}
|
|
431
457
|
parCrate.push([prevues, etat]);
|
|
432
458
|
}
|
|
433
|
-
const prevusBancs = bancs.map(b => [
|
|
459
|
+
const prevusBancs = bancs.map(b => [
|
|
460
|
+
p.prevoir(b.nom, b.d, BUDGET, true, b.args),
|
|
461
|
+
b.etat,
|
|
462
|
+
b.temporaire,
|
|
463
|
+
]);
|
|
434
464
|
for (const [prevues, etat] of parCrate) {
|
|
435
465
|
for (const [t, o] of prevues) {
|
|
436
466
|
if (p.jouer(t, o) !== 0 && t.t.script === 'build') {
|
|
@@ -440,9 +470,9 @@ function jouerLesTests(racine, p, choix, options) {
|
|
|
440
470
|
}
|
|
441
471
|
}
|
|
442
472
|
return () => {
|
|
443
|
-
for (const [t, etat] of prevusBancs) {
|
|
473
|
+
for (const [t, etat, temporaire] of prevusBancs) {
|
|
444
474
|
if (etat.construit) {
|
|
445
|
-
p.jouer(t, { junit });
|
|
475
|
+
p.jouer(t, { junit, temporaire });
|
|
446
476
|
}
|
|
447
477
|
}
|
|
448
478
|
};
|
|
@@ -597,12 +627,38 @@ const CACHE_DE_NODE = 'node-compile-cache';
|
|
|
597
627
|
// Plays <jouer>(env) under the base of a pass of <genre> in the temporary directory of <env>,
|
|
598
628
|
// named to cargo in TMPDIR, TMP and TEMP: its code, 1 when the tests left something there, named.
|
|
599
629
|
// The base goes at the end, or at an interruption.
|
|
630
|
+
//
|
|
631
|
+
// <jouer>(env, parPaquet) also receives `parPaquet`: `{ temporaire(nom), restes(nom) }`, the
|
|
632
|
+
// sub-directory of the base one package's tests play under (made at the first call, named in
|
|
633
|
+
// TMPDIR, TMP and TEMP) and what is left in it, so a leftover has the package that left it. The
|
|
634
|
+
// base's own line names what lies beside those sub-directories.
|
|
600
635
|
function sousLaBase(genre, env, jouer) {
|
|
601
636
|
const base = ouvrirBase(genre, { dans: env.TMPDIR || tmpdir() });
|
|
602
637
|
const lacher = retirerALInterruption(base.fermer);
|
|
638
|
+
const dossiers = new Map();
|
|
639
|
+
const parPaquet = {
|
|
640
|
+
temporaire(nom) {
|
|
641
|
+
if (!dossiers.has(nom)) {
|
|
642
|
+
const d = path.join(base.dossier, nom);
|
|
643
|
+
mkdirSync(d, { recursive: true });
|
|
644
|
+
dossiers.set(nom, d);
|
|
645
|
+
}
|
|
646
|
+
const d = dossiers.get(nom);
|
|
647
|
+
return { TMPDIR: d, TMP: d, TEMP: d };
|
|
648
|
+
},
|
|
649
|
+
restes(nom) {
|
|
650
|
+
try {
|
|
651
|
+
return readdirSync(dossiers.get(nom)).sort();
|
|
652
|
+
} catch {
|
|
653
|
+
return [];
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
};
|
|
603
657
|
try {
|
|
604
|
-
const code = jouer({ ...env, ...base.env });
|
|
605
|
-
const ligne = ligneDesRestes(
|
|
658
|
+
const code = jouer({ ...env, ...base.env }, parPaquet);
|
|
659
|
+
const ligne = ligneDesRestes(
|
|
660
|
+
base.restes().filter(n => n !== CACHE_DE_NODE && !dossiers.has(n))
|
|
661
|
+
);
|
|
606
662
|
if (!ligne) {
|
|
607
663
|
return code;
|
|
608
664
|
}
|
|
@@ -705,10 +761,12 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
705
761
|
return surUnePlace(e => tester(racine, tous, args, e), { env });
|
|
706
762
|
}
|
|
707
763
|
if (nom === 'tests-du-paquet') {
|
|
708
|
-
return sousLaBase('tests', env, envBase
|
|
764
|
+
return sousLaBase('tests', env, (envBase, pp) =>
|
|
765
|
+
testsDuPaquet(racine, tous, args, envBase, pp)
|
|
766
|
+
);
|
|
709
767
|
}
|
|
710
768
|
if (nom === 'tests-de-nuit') {
|
|
711
|
-
return sousLaBase('tests', env, envBase => testsDeNuit(racine, tous, envBase));
|
|
769
|
+
return sousLaBase('tests', env, (envBase, pp) => testsDeNuit(racine, tous, envBase, pp));
|
|
712
770
|
}
|
|
713
771
|
process.stderr.write(`⛔ commande inconnue du module cargo : ${nom} (${NOMS.join(', ')})\n`);
|
|
714
772
|
return 2;
|
|
@@ -758,7 +816,7 @@ function tester(racine, tous, args, env) {
|
|
|
758
816
|
// The pass of `tests-du-paquet` in <racine>, the crates <tous>, its arguments <args>, under <env>:
|
|
759
817
|
// the body of the task `test:unit` of a crate. The paths its script names, completed by those of
|
|
760
818
|
// the variable of the task that lie in the same crate.
|
|
761
|
-
function testsDuPaquet(racine, tous, args, env) {
|
|
819
|
+
function testsDuPaquet(racine, tous, args, env, parPaquet) {
|
|
762
820
|
const donnes = args.filter(a => !a.startsWith('-'));
|
|
763
821
|
if (donnes.length === 0) {
|
|
764
822
|
process.stderr.write(
|
|
@@ -781,20 +839,41 @@ function testsDuPaquet(racine, tous, args, env) {
|
|
|
781
839
|
return 2;
|
|
782
840
|
}
|
|
783
841
|
const p = passe(racine, env);
|
|
784
|
-
jouerLesTests(
|
|
842
|
+
jouerLesTests(
|
|
843
|
+
racine,
|
|
844
|
+
p,
|
|
845
|
+
r.choix,
|
|
846
|
+
[...args.filter(a => a.startsWith('-')), ...options],
|
|
847
|
+
parPaquet.temporaire
|
|
848
|
+
)();
|
|
849
|
+
restesParPaquet(p, r.choix, parPaquet);
|
|
785
850
|
return p.code();
|
|
786
851
|
}
|
|
787
852
|
|
|
853
|
+
// The line of the guard of each crate of <choix> whose tests left something in its temporary
|
|
854
|
+
// directory, naming it, and its task of tests turned red in the run <p>.
|
|
855
|
+
function restesParPaquet(p, choix, parPaquet) {
|
|
856
|
+
for (const { c } of choix) {
|
|
857
|
+
const nom = c.composant.nom;
|
|
858
|
+
const ligne = ligneDesRestes(parPaquet.restes(nom), nom);
|
|
859
|
+
if (ligne) {
|
|
860
|
+
process.stderr.write(`${ligne}\n`);
|
|
861
|
+
p.rougir(nom);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
788
866
|
// The pass of `tests-de-nuit` in <racine>, the crates <tous>, under <env>: the night tests and the
|
|
789
867
|
// benches of each crate that holds some, each named.
|
|
790
|
-
function testsDeNuit(racine, tous, env) {
|
|
868
|
+
function testsDeNuit(racine, tous, env, parPaquet) {
|
|
791
869
|
const p = passe(racine, env);
|
|
792
870
|
const choix = tous
|
|
793
871
|
.filter(c => joueDesTests(racine, c.composant))
|
|
794
872
|
.map(c => ({ c, cibles: c.cibles.filter(horsDuJour).map(t => t.name) }))
|
|
795
873
|
.filter(x => x.cibles.length);
|
|
796
874
|
if (choix.length) {
|
|
797
|
-
jouerLesTests(racine, p, choix, [])();
|
|
875
|
+
jouerLesTests(racine, p, choix, [], parPaquet.temporaire)();
|
|
876
|
+
restesParPaquet(p, choix, parPaquet);
|
|
798
877
|
}
|
|
799
878
|
return p.code();
|
|
800
879
|
}
|
|
@@ -365,7 +365,9 @@ function partiesHors(a, b) {
|
|
|
365
365
|
const cles = (x, y) => [...new Set([...Object.keys(x), ...Object.keys(y)])].sort();
|
|
366
366
|
const out = [];
|
|
367
367
|
for (const k of cles(a, b)) {
|
|
368
|
-
if (k === DES_TESTS || isDeepStrictEqual(a[k], b[k]))
|
|
368
|
+
if (k === DES_TESTS || isDeepStrictEqual(a[k], b[k])) {
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
369
371
|
if (k !== 'target') {
|
|
370
372
|
const tableau = [a[k], b[k]].some(v => v !== null && typeof v === 'object');
|
|
371
373
|
out.push(tableau ? `[${k}]` : k);
|
|
@@ -375,7 +377,9 @@ function partiesHors(a, b) {
|
|
|
375
377
|
for (const c of cles(ta, tb)) {
|
|
376
378
|
const [ca, cb] = [table(ta[c]), table(tb[c])];
|
|
377
379
|
for (const s of cles(ca, cb)) {
|
|
378
|
-
if (s !== DES_TESTS && !isDeepStrictEqual(ca[s], cb[s]))
|
|
380
|
+
if (s !== DES_TESTS && !isDeepStrictEqual(ca[s], cb[s])) {
|
|
381
|
+
out.push(`[target.${c}.${s}]`);
|
|
382
|
+
}
|
|
379
383
|
}
|
|
380
384
|
}
|
|
381
385
|
}
|
|
@@ -415,7 +419,9 @@ function finDuLexeme(texte, i) {
|
|
|
415
419
|
j++;
|
|
416
420
|
} else if (texte.startsWith('*/', j)) {
|
|
417
421
|
j++;
|
|
418
|
-
if (--profondeur === 0)
|
|
422
|
+
if (--profondeur === 0) {
|
|
423
|
+
return j + 1;
|
|
424
|
+
}
|
|
419
425
|
}
|
|
420
426
|
}
|
|
421
427
|
return texte.length;
|
|
@@ -423,8 +429,12 @@ function finDuLexeme(texte, i) {
|
|
|
423
429
|
for (const re of [BRUTE, CHAINE, CARACTERE]) {
|
|
424
430
|
re.lastIndex = i;
|
|
425
431
|
const m = re.exec(texte);
|
|
426
|
-
if (!m)
|
|
427
|
-
|
|
432
|
+
if (!m) {
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
if (re !== BRUTE) {
|
|
436
|
+
return m.index + m[0].length;
|
|
437
|
+
}
|
|
428
438
|
const fin = texte.indexOf(`"${m[1]}`, i + m[0].length);
|
|
429
439
|
return fin < 0 ? texte.length : fin + 1 + m[1].length;
|
|
430
440
|
}
|
|
@@ -506,8 +516,12 @@ function horsDesTests(chemin, racine, avant, apres) {
|
|
|
506
516
|
const parts = c ? path.relative(c.dossier, abs).split(path.sep) : [];
|
|
507
517
|
return parts[0] === 'src' && !unitaire(parts) ? codeHorsDuModuleDeTest(avant, apres) : null;
|
|
508
518
|
}
|
|
509
|
-
if (path.basename(abs) !== 'Cargo.toml')
|
|
510
|
-
|
|
519
|
+
if (path.basename(abs) !== 'Cargo.toml') {
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
if (!tous.some(c => path.join(c.composant.dossier, 'Cargo.toml') === abs)) {
|
|
523
|
+
return null;
|
|
524
|
+
}
|
|
511
525
|
const { parse } = require('smol-toml');
|
|
512
526
|
const lire = texte => {
|
|
513
527
|
try {
|
|
@@ -517,7 +531,9 @@ function horsDesTests(chemin, racine, avant, apres) {
|
|
|
517
531
|
}
|
|
518
532
|
};
|
|
519
533
|
const [a, b] = [lire(avant), lire(apres)];
|
|
520
|
-
if (a.faute || b.faute)
|
|
534
|
+
if (a.faute || b.faute) {
|
|
535
|
+
return [a.faute ?? b.faute];
|
|
536
|
+
}
|
|
521
537
|
return partiesHors(a.valeur, b.valeur);
|
|
522
538
|
}
|
|
523
539
|
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
import { readFileSync } from 'node:fs';
|
|
39
39
|
import path from 'node:path';
|
|
40
40
|
import { fileURLToPath } from 'node:url';
|
|
41
|
+
import { empreintesDesTaches } from '../../services-du-noyau.mjs';
|
|
41
42
|
import { commandes, fichierHorsDuJour, GARDES } from './commandes.mjs';
|
|
42
43
|
import {
|
|
43
44
|
composantDans,
|
|
@@ -76,6 +77,9 @@ export default {
|
|
|
76
77
|
},
|
|
77
78
|
// The reader of TOML by which the lock judges a Cargo.toml (./composants.mjs, `manifestes`).
|
|
78
79
|
outils: ['smol-toml'],
|
|
80
|
+
// The programs the installer of Temporal requires in the PATH of the workers: cargo's folder is
|
|
81
|
+
// also rustc's, nextest's and sccache's (rustup, `cargo install`).
|
|
82
|
+
executables: ['cargo'],
|
|
79
83
|
// The binaries the module runs, each at an exact version: nextest and cargo-deny at the ones the
|
|
80
84
|
// probe of grillhouse-pkl.1 measured; sccache, the cache of compilation common to the copies
|
|
81
85
|
// (./sccache.mjs), at the last release of mozilla/sccache, v0.19.0 (2026-10-24).
|
|
@@ -120,6 +124,9 @@ export default {
|
|
|
120
124
|
joueDesTests,
|
|
121
125
|
lecteurs,
|
|
122
126
|
elementsDuLot,
|
|
127
|
+
// The hashes of the inputs of the tests tasks of the crates and their dependents, as
|
|
128
|
+
// Turborepo plans them.
|
|
129
|
+
empreintes: (racine, noms) => empreintesDesTaches('turbo', racine, noms),
|
|
123
130
|
commandes,
|
|
124
131
|
verdict,
|
|
125
132
|
estUnTest,
|
|
@@ -55,7 +55,9 @@ export function sansLitteraux(t) {
|
|
|
55
55
|
}
|
|
56
56
|
if (t[i] === '"') {
|
|
57
57
|
i++;
|
|
58
|
-
while (i < t.length && t[i] !== '"')
|
|
58
|
+
while (i < t.length && t[i] !== '"') {
|
|
59
|
+
i += t[i] === '\\' ? 2 : 1;
|
|
60
|
+
}
|
|
59
61
|
i++;
|
|
60
62
|
out += ' ';
|
|
61
63
|
continue;
|
|
@@ -93,19 +95,29 @@ export function lireLeFichier(texte) {
|
|
|
93
95
|
let profondeur = 1;
|
|
94
96
|
let k = jeton.lastIndex;
|
|
95
97
|
while (k < t.length && profondeur > 0) {
|
|
96
|
-
if (t[k] === '[')
|
|
97
|
-
|
|
98
|
+
if (t[k] === '[') {
|
|
99
|
+
profondeur++;
|
|
100
|
+
} else if (t[k] === ']') {
|
|
101
|
+
profondeur--;
|
|
102
|
+
}
|
|
98
103
|
k++;
|
|
99
104
|
}
|
|
100
105
|
const attribut = t.slice(jeton.lastIndex, k - 1).trim();
|
|
101
|
-
if (/^(?:\w+\s*::\s*)*test$/.test(attribut))
|
|
106
|
+
if (/^(?:\w+\s*::\s*)*test$/.test(attribut)) {
|
|
107
|
+
marque = true;
|
|
108
|
+
}
|
|
102
109
|
jeton.lastIndex = k;
|
|
103
110
|
} else if (m[1]) {
|
|
104
|
-
if (m[2] === '{')
|
|
105
|
-
|
|
111
|
+
if (m[2] === '{') {
|
|
112
|
+
pile.push(m[1]);
|
|
113
|
+
} else {
|
|
114
|
+
externes.push([...ici(), m[1]]);
|
|
115
|
+
}
|
|
106
116
|
marque = false;
|
|
107
117
|
} else if (m[3]) {
|
|
108
|
-
if (marque)
|
|
118
|
+
if (marque) {
|
|
119
|
+
tests.push([...ici(), m[3]]);
|
|
120
|
+
}
|
|
109
121
|
marque = false;
|
|
110
122
|
} else if (j === '{') {
|
|
111
123
|
pile.push(null);
|
|
@@ -128,7 +140,9 @@ export function lireLeFichier(texte) {
|
|
|
128
140
|
*/
|
|
129
141
|
export function nomsDeHead(chemin, module, lire) {
|
|
130
142
|
const texte = lire(chemin);
|
|
131
|
-
if (texte === null)
|
|
143
|
+
if (texte === null) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
132
146
|
if (module) {
|
|
133
147
|
return lireLeFichier(texte).tests.map(t => [...module, ...t].join('::'));
|
|
134
148
|
}
|
|
@@ -136,7 +150,9 @@ export function nomsDeHead(chemin, module, lire) {
|
|
|
136
150
|
const vus = new Set();
|
|
137
151
|
// The file <f> of text <tx>, its modules under <dossier>, its tests under <prefixe>.
|
|
138
152
|
const parcourir = (f, tx, dossier, prefixe) => {
|
|
139
|
-
if (vus.has(f))
|
|
153
|
+
if (vus.has(f)) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
140
156
|
vus.add(f);
|
|
141
157
|
const { tests, externes } = lireLeFichier(tx);
|
|
142
158
|
noms.push(...tests.map(t => [...prefixe, ...t].join('::')));
|
|
@@ -263,7 +263,9 @@ function jouerLesTests(p, choix, options) {
|
|
|
263
263
|
// The workers of a session of an agent (GRILLHOUSE_TRAVAILLEURS): `-n` of pytest-xdist, for a
|
|
264
264
|
// package whose test group declares it; a heavy pass, without the variable, plays alone.
|
|
265
265
|
const travailleurs = travailleursDeLaSeance(process.env);
|
|
266
|
-
if (travailleurs !== null && declareXdist(c.dossier))
|
|
266
|
+
if (travailleurs !== null && declareXdist(c.dossier)) {
|
|
267
|
+
args.push('-n', String(travailleurs));
|
|
268
|
+
}
|
|
267
269
|
const entier = chemins.every(ch => ch === '.');
|
|
268
270
|
p.jouer(
|
|
269
271
|
p.prevoir(c.nom, c.dossier, 'pytest', true, [...args, ...selection(chemins), ...options]),
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
import { readFileSync } from 'node:fs';
|
|
34
34
|
import path from 'node:path';
|
|
35
35
|
import { fileURLToPath } from 'node:url';
|
|
36
|
+
import { empreintesDesTaches } from '../../services-du-noyau.mjs';
|
|
36
37
|
import { commandes, GARDES, PYCACHE } from './commandes.mjs';
|
|
37
38
|
import {
|
|
38
39
|
composantDans,
|
|
@@ -68,6 +69,8 @@ export default {
|
|
|
68
69
|
throw new Error('sortie non prise en charge pour python');
|
|
69
70
|
},
|
|
70
71
|
outils: ['smol-toml'],
|
|
72
|
+
// The programs the installer of Temporal requires in the PATH of the workers.
|
|
73
|
+
executables: ['python3'],
|
|
71
74
|
binaires: JSON.parse(readFileSync(ici('binaires.json'), 'utf8')),
|
|
72
75
|
ignorer: ['.venv', '.pytest_cache', PYCACHE],
|
|
73
76
|
sorties: {
|
|
@@ -88,6 +91,9 @@ export default {
|
|
|
88
91
|
joueDesTests,
|
|
89
92
|
lecteurs,
|
|
90
93
|
elementsDuLot,
|
|
94
|
+
// The hashes of the inputs of the tests tasks of the projects and their dependents, as
|
|
95
|
+
// Turborepo plans them.
|
|
96
|
+
empreintes: (racine, noms) => empreintesDesTaches('turbo', racine, noms),
|
|
91
97
|
commandes,
|
|
92
98
|
verdict,
|
|
93
99
|
estUnTest,
|
|
@@ -62,7 +62,11 @@ export function verifier(racine) {
|
|
|
62
62
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
63
63
|
const racine = process.cwd();
|
|
64
64
|
const { refus, lignes } = trancher(racine, GARDE, verifier(racine));
|
|
65
|
-
for (const r of refus)
|
|
66
|
-
|
|
65
|
+
for (const r of refus) {
|
|
66
|
+
process.stderr.write(`⛔ ${r.message}\n`);
|
|
67
|
+
}
|
|
68
|
+
for (const l of lignes) {
|
|
69
|
+
process.stderr.write(`${l}\n`);
|
|
70
|
+
}
|
|
67
71
|
process.exitCode = refus.length ? 1 : 0;
|
|
68
72
|
}
|
|
@@ -12,9 +12,13 @@ function tousDossiers(racine) {
|
|
|
12
12
|
const found = [];
|
|
13
13
|
for (const parent of ['packages', 'src']) {
|
|
14
14
|
const base = path.join(racine, parent);
|
|
15
|
-
if (!existsSync(base))
|
|
15
|
+
if (!existsSync(base)) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
16
18
|
for (const e of readdirSync(base, { withFileTypes: true })) {
|
|
17
|
-
if (e.isDirectory())
|
|
19
|
+
if (e.isDirectory()) {
|
|
20
|
+
found.push({ nom: e.name, dir: path.join(base, e.name) });
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
return found;
|
|
@@ -48,7 +52,9 @@ export function matieres(racine) {
|
|
|
48
52
|
const found = [];
|
|
49
53
|
for (const { nom, dir } of dossiers(racine)) {
|
|
50
54
|
const pj = path.join(dir, 'package.json');
|
|
51
|
-
if (!existsSync(pj))
|
|
55
|
+
if (!existsSync(pj)) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
52
58
|
let paquet;
|
|
53
59
|
try {
|
|
54
60
|
paquet = JSON.parse(readFileSync(pj, 'utf8'));
|