@roomi-fields/grillhouse 0.47.1 → 0.49.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 +116 -0
- package/agents/direct.md +9 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +24 -38
- package/cadre/templates/projet/.github/workflows/machine-vierge.yml +5 -0
- package/cadre/templates/projet/.github/workflows/nuit.yml +14 -2
- package/cadre/templates/projet/CLAUDE.md +31 -10
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/turbo/paquets.json +3 -1
- package/cadre/templates/turbo/sans-paquets.json +3 -1
- package/charte.md +46 -13
- package/dist/temporal/circuit/appel.d.ts +4 -1
- package/dist/temporal/circuit/appel.js +15 -1
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +7 -1
- package/dist/temporal/circuit/client.js +54 -1
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +35 -60
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +2 -1
- package/dist/temporal/circuit/contrat.js +2 -1
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +9 -2
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +2 -13
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/deroules.d.ts +1 -1
- package/dist/temporal/deroules.js +2 -2
- package/dist/temporal/deroules.js.map +1 -1
- package/dist/temporal/file/activites.d.ts +1 -4
- package/dist/temporal/file/activites.js +13 -14
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +34 -91
- package/dist/temporal/file/contrat.js +33 -5
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.d.ts +1 -9
- package/dist/temporal/file/deroule.js +57 -166
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +26 -1
- package/dist/temporal/installation.js +111 -2
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/activites.d.ts +5 -10
- package/dist/temporal/nuits/activites.js +9 -57
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/choix.d.ts +15 -0
- package/dist/temporal/nuits/choix.js +20 -0
- package/dist/temporal/nuits/choix.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +11 -16
- package/dist/temporal/nuits/deroule.js +38 -67
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/client.d.ts +9 -11
- package/dist/temporal/places/client.js +11 -19
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +25 -24
- package/dist/temporal/places/contrat.js +5 -7
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +26 -36
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/tickets/activites.js +4 -2
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +2 -1
- package/docs/ARCHITECTURE.md +453 -133
- package/docs/CADRE.md +16 -13
- package/docs/INTERFACE.md +100 -25
- package/hooks/hooks.json +9 -0
- package/hooks/register.tsx +59 -5
- package/package.json +1 -1
- package/scripts/activites.mjs +319 -52
- package/scripts/aiguillage.mjs +5 -1
- package/scripts/attente-a-l-arret.mjs +2 -5
- package/scripts/attente-au-tour.mjs +2 -5
- package/scripts/bilan.mjs +125 -2
- package/scripts/branche-de-nuit.mjs +32 -44
- package/scripts/ci-de-main.mjs +215 -16
- package/scripts/circuit.mjs +275 -189
- package/scripts/circuits-cles.d.mts +3 -3
- package/scripts/circuits-cles.mjs +6 -5
- package/scripts/coeurs-dedies.mjs +4 -4
- package/scripts/commandes-composees.mjs +12 -5
- package/scripts/composition-des-langages.mjs +2 -0
- package/scripts/crochets.mjs +2 -2
- package/scripts/dette.d.ts +2 -1
- package/scripts/dette.mjs +49 -6
- package/scripts/direct.mjs +343 -0
- package/scripts/droits.mjs +19 -0
- package/scripts/effets.mjs +6 -5
- package/scripts/engendres.mjs +2 -1
- package/scripts/enveloppe/enveloppe.mjs +127 -18
- package/scripts/enveloppe/lancer.sh +14 -3
- package/scripts/enveloppe/paquets-du-plan.mjs +9 -0
- package/scripts/enveloppe/travail-de-la-copie.mjs +121 -21
- package/scripts/etapes.mjs +14 -4
- package/scripts/etat-du-depot.mjs +23 -0
- package/scripts/faits-du-circuit.mjs +24 -34
- package/scripts/fermeture-de-la-machine.d.mts +27 -0
- package/scripts/fermeture-de-la-machine.mjs +98 -0
- package/scripts/fichiers-nommes.mjs +27 -1
- package/scripts/file-des-tickets.d.mts +18 -1
- package/scripts/file-des-tickets.mjs +63 -15
- package/scripts/greffons.mjs +1 -1
- package/scripts/grillhouse-maj.mjs +13 -25
- package/scripts/groupe-cles.d.mts +6 -0
- package/scripts/groupe-cles.mjs +29 -1
- package/scripts/integration/file.mjs +162 -48
- package/scripts/integration/integrer.mjs +2 -0
- package/scripts/jointure.d.ts +22 -3
- package/scripts/journal-des-etats.d.mts +16 -0
- package/scripts/journal-des-etats.mjs +44 -2
- package/scripts/journal.mjs +3 -0
- package/scripts/langages/c/commandes.mjs +5 -5
- package/scripts/langages/c/composants.mjs +13 -5
- package/scripts/langages/c/index.mjs +2 -0
- package/scripts/langages/c/squelette.mjs +1 -1
- package/scripts/langages/cargo/commandes.mjs +5 -6
- package/scripts/langages/cargo/index.mjs +2 -0
- package/scripts/langages/python/commandes.mjs +5 -5
- package/scripts/langages/python/composants.mjs +10 -2
- package/scripts/langages/python/index.mjs +2 -0
- package/scripts/langages/typescript/composants.mjs +10 -3
- package/scripts/langages/typescript/construire.mjs +2 -0
- package/scripts/langages/typescript/exemples.mjs +33 -1
- package/scripts/langages/typescript/index.mjs +22 -0
- package/scripts/langages/typescript/migrations/0.49.0-tests-equipes.mjs +32 -0
- package/scripts/langages/typescript/module-absent.mjs +24 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +152 -32
- package/scripts/langages/typescript/tests-du-poste.mjs +65 -23
- package/scripts/langages/typescript/titres-de-tests.mjs +11 -7
- package/scripts/langages/typescript/turbo-des-paquets.mjs +40 -5
- package/scripts/langages/typescript/verifier.mjs +3 -5
- package/scripts/langages/typescript/verrou-des-dependances.mjs +161 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +57 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +3 -1
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +11 -5
- package/scripts/langages/typescript/vitest.nuit.config.mjs +53 -5
- package/scripts/langages.mjs +25 -3
- package/scripts/machine.mjs +103 -0
- package/scripts/matieres-cles.mjs +17 -0
- package/scripts/matieres-lues.mjs +104 -0
- package/scripts/mesure/base-de-passe.mjs +2 -1
- package/scripts/migrations/0.48.0-ci-declenchee-par-la-file.mjs +32 -0
- package/scripts/migrations/0.48.0-poussee-retiree.mjs +31 -0
- package/scripts/migrations/0.49.0-reservation-de-trois-coeurs.mjs +30 -0
- package/scripts/migrations.mjs +6 -0
- package/scripts/nuit.sh +113 -46
- package/scripts/paquet.mjs +16 -5
- package/scripts/paquets.d.ts +4 -0
- package/scripts/paquets.mjs +57 -0
- package/scripts/passe-de-la-machine.mjs +13 -14
- package/scripts/places-de-la-machine.mjs +120 -44
- package/scripts/places-du-serveur.mjs +29 -8
- package/scripts/plafond-de-la-machine.d.mts +7 -13
- package/scripts/plafond-de-la-machine.mjs +19 -35
- package/scripts/poussee-retiree.mjs +18 -0
- package/scripts/prefixe-des-tickets.mjs +1 -1
- package/scripts/references-changees.mjs +159 -0
- package/scripts/registre.d.mts +2 -2
- package/scripts/regles-des-places.d.mts +20 -12
- package/scripts/regles-des-places.mjs +27 -30
- package/scripts/repli-de-la-nuit.mjs +112 -0
- package/scripts/reponses-du-circuit.d.mts +4 -2
- package/scripts/reponses-du-circuit.mjs +44 -9
- package/scripts/reprise.mjs +27 -8
- package/scripts/resultats.mjs +61 -9
- package/scripts/seances.mjs +258 -40
- package/scripts/services-du-noyau.mjs +3 -0
- package/scripts/sous-commandes.mjs +37 -7
- package/scripts/superviseur.mjs +241 -88
- package/scripts/tableau.mjs +327 -131
- package/scripts/taches-du-graphe.mjs +84 -4
- package/scripts/ticket.mjs +345 -0
- package/scripts/transitions.d.mts +52 -0
- package/scripts/transitions.mjs +194 -16
- package/scripts/un-commit-par-ticket.mjs +4 -3
- package/scripts/verdict-de-la-nuit.mjs +47 -20
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrous/ecriture-hors-enveloppe.mjs +86 -0
- package/scripts/verrous/verrou.mjs +17 -1
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/direct/SKILL.md +57 -0
- package/skills/explorateur/SKILL.md +10 -6
- package/skills/pitmaster/SKILL.md +37 -14
- package/skills/pitmaster/references/consigne-agent.md +7 -1
- package/skills/relecteur/SKILL.md +11 -1
- package/skills/testwriter/SKILL.md +10 -0
- package/scripts/poussee-cles.mjs +0 -46
- package/scripts/ticket.sh +0 -25
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
// through its mounts.
|
|
5
5
|
//
|
|
6
6
|
// node tests-de-nuit.mjs from the root of the copy: the night of the poste
|
|
7
|
-
// node tests-de-nuit.mjs --hors-du-poste the night of
|
|
7
|
+
// node tests-de-nuit.mjs --hors-du-poste the night of an equipped runner: all but @poste
|
|
8
|
+
// node tests-de-nuit.mjs --hors-du-poste --sans-equipement all but @poste and @equipee
|
|
9
|
+
// node tests-de-nuit.mjs --du-poste the tests tagged @poste alone (the night of PC3)
|
|
10
|
+
// node tests-de-nuit.mjs --mesures the benches and the time witnesses alone
|
|
8
11
|
// node tests-de-nuit.mjs --hors-du-poste --tranche i/n its tranche i of n
|
|
9
12
|
//
|
|
10
13
|
// - The files `*.nuit.test.*` and `*.nuit.spec.*` of the copy, outside node_modules, dist and
|
|
@@ -18,6 +21,10 @@
|
|
|
18
21
|
// time (GRILLHOUSE_TESTS_DE_NUIT=mesures), as Bazel plays a test tagged `exclusive` after the
|
|
19
22
|
// others, nothing beside it, and as the module cargo plays its benches after its night tests
|
|
20
23
|
// (grillhouse-bd7). Each run plays when the copy holds its files.
|
|
24
|
+
// - Each run plays one Vitest per unit: the root under the frame's configuration alone, and each
|
|
25
|
+
// directory below it that holds a Vitest configuration (`vitest.config.*`, else `vite.config.*`)
|
|
26
|
+
// with `--root` at that directory, under that configuration merged with the frame's, what the
|
|
27
|
+
// night sets winning (./vitest.nuit.config.mjs, `unitesDeLaNuit`).
|
|
21
28
|
// - With `--hors-du-poste`, the night of a shared machine: the night tests alone, but those that
|
|
22
29
|
// bear the tag `@poste` (`porteLEtiquetteDuPoste` of ./vitest-config/cibles.mjs, which the guard
|
|
23
30
|
// ./tests-du-poste.mjs asks of a night test that depends on the poste), in one run
|
|
@@ -36,11 +43,12 @@
|
|
|
36
43
|
// - The exit code: 0 when every run is green; 75, « à repasser », when every red run is at 75
|
|
37
44
|
// (every failure depended on a duration, one under load, ./vitest-config/duree.reporter.mjs);
|
|
38
45
|
// else the code of the first red run.
|
|
39
|
-
// -
|
|
40
|
-
// scripts/passe-de-la-machine.mjs,
|
|
41
|
-
//
|
|
46
|
+
// - The night tests play on the part of their project (`avecLaPasse` of
|
|
47
|
+
// scripts/passe-de-la-machine.mjs, the sort « Nuit »), the measures of time on dedicated cores
|
|
48
|
+
// (`mesure`, `grillhouse.mesure`), once the temporary directory and the disk of the copy have
|
|
49
|
+
// room, as every pass: a wait that reaches its bound ends at 75.
|
|
42
50
|
import { spawnSync } from 'node:child_process';
|
|
43
|
-
import { readdirSync, rmSync } from 'node:fs';
|
|
51
|
+
import { existsSync, readdirSync, rmSync } from 'node:fs';
|
|
44
52
|
import path from 'node:path';
|
|
45
53
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
46
54
|
import {
|
|
@@ -53,8 +61,10 @@ import {
|
|
|
53
61
|
estUnBanc,
|
|
54
62
|
estUnTestDeNuit,
|
|
55
63
|
fichiersTemoins,
|
|
64
|
+
NUIT_PAQUET,
|
|
56
65
|
NUIT_TRANCHE,
|
|
57
66
|
NUIT_VARIABLE,
|
|
67
|
+
testsDuPoste,
|
|
58
68
|
} from './vitest-config/cibles.mjs';
|
|
59
69
|
import { fichiersDeLaTranche, RAPPORTS } from './tranches.mjs';
|
|
60
70
|
|
|
@@ -65,17 +75,26 @@ import { fichiersDeLaTranche, RAPPORTS } from './tranches.mjs';
|
|
|
65
75
|
*/
|
|
66
76
|
export function lireLesArguments(args) {
|
|
67
77
|
let horsDuPoste = false;
|
|
78
|
+
let sansEquipement = false;
|
|
79
|
+
let duPoste = false;
|
|
80
|
+
let mesuresSeules = false;
|
|
68
81
|
let texte;
|
|
69
82
|
for (let i = 0; i < args.length; i++) {
|
|
70
83
|
const a = args[i];
|
|
71
84
|
if (a === '--hors-du-poste') {
|
|
72
85
|
horsDuPoste = true;
|
|
86
|
+
} else if (a === '--sans-equipement') {
|
|
87
|
+
sansEquipement = true;
|
|
88
|
+
} else if (a === '--du-poste') {
|
|
89
|
+
duPoste = true;
|
|
90
|
+
} else if (a === '--mesures') {
|
|
91
|
+
mesuresSeules = true;
|
|
73
92
|
} else if (a === '--tranche') {
|
|
74
93
|
texte = args[++i] ?? '';
|
|
75
94
|
} else if (a.startsWith('--tranche=')) {
|
|
76
95
|
texte = a.slice('--tranche='.length);
|
|
77
96
|
} else {
|
|
78
|
-
return { horsDuPoste, erreur: `⛔ tests-de-nuit : argument inconnu « ${a} » (usage : tests-de-nuit [--hors-du-poste [--tranche ${LA_FORME}]]).` };
|
|
97
|
+
return { horsDuPoste, erreur: `⛔ tests-de-nuit : argument inconnu « ${a} » (usage : tests-de-nuit [--hors-du-poste [--sans-equipement] [--tranche ${LA_FORME}] | --du-poste | --mesures]).` };
|
|
79
98
|
}
|
|
80
99
|
}
|
|
81
100
|
const tranche = texte === undefined ? undefined : (lireLaTranche(texte) ?? undefined);
|
|
@@ -85,7 +104,13 @@ export function lireLesArguments(args) {
|
|
|
85
104
|
if (tranche && !horsDuPoste) {
|
|
86
105
|
return { horsDuPoste, erreur: '⛔ --tranche découpe la nuit d\'une machine partagée : elle se donne avec --hors-du-poste ; la nuit du poste se joue entière.' };
|
|
87
106
|
}
|
|
88
|
-
|
|
107
|
+
if (sansEquipement && !horsDuPoste) {
|
|
108
|
+
return { horsDuPoste, erreur: '⛔ --sans-equipement choisit la nuit d\'une machine sans équipement : elle se donne avec --hors-du-poste.' };
|
|
109
|
+
}
|
|
110
|
+
if ((duPoste || mesuresSeules) && (horsDuPoste || (duPoste && mesuresSeules))) {
|
|
111
|
+
return { horsDuPoste, erreur: '⛔ --du-poste, --mesures et --hors-du-poste sont trois nuits à part : une seule à la fois.' };
|
|
112
|
+
}
|
|
113
|
+
return { horsDuPoste, sansEquipement, duPoste, mesuresSeules, tranche };
|
|
89
114
|
}
|
|
90
115
|
|
|
91
116
|
const CONFIGURATION = fileURLToPath(new URL('./vitest.nuit.config.mjs', import.meta.url));
|
|
@@ -113,9 +138,20 @@ function enTient(dossier, est) {
|
|
|
113
138
|
* @param {{ horsDuPoste?: boolean }} [options] the night of a shared machine
|
|
114
139
|
* @returns {string[]}
|
|
115
140
|
*/
|
|
116
|
-
export function runsDeLaNuit(
|
|
141
|
+
export function runsDeLaNuit(
|
|
142
|
+
racine,
|
|
143
|
+
{ horsDuPoste = false, sansEquipement = false, duPoste = false, mesuresSeules = false } = {}
|
|
144
|
+
) {
|
|
117
145
|
if (horsDuPoste) {
|
|
118
|
-
return enTient(racine, estUnTestDeNuit)
|
|
146
|
+
return enTient(racine, estUnTestDeNuit)
|
|
147
|
+
? [sansEquipement ? 'hors-poste-sans-equipement' : 'hors-poste']
|
|
148
|
+
: [];
|
|
149
|
+
}
|
|
150
|
+
if (duPoste) {
|
|
151
|
+
return testsDuPoste(racine).length > 0 ? ['du-poste'] : [];
|
|
152
|
+
}
|
|
153
|
+
if (mesuresSeules) {
|
|
154
|
+
return enTient(racine, estUnBanc) || fichiersTemoins(racine).length > 0 ? ['mesures'] : [];
|
|
119
155
|
}
|
|
120
156
|
return [
|
|
121
157
|
enTient(racine, estUnTestDeNuit) && 'nuit',
|
|
@@ -136,27 +172,31 @@ export function testsDeNuit(racine, options = {}) {
|
|
|
136
172
|
if (runs.length === 0) {
|
|
137
173
|
return 0;
|
|
138
174
|
}
|
|
139
|
-
// The night tests
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
racine,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
175
|
+
// The night tests play on the part of the project, as a pass; the measures of time play on
|
|
176
|
+
// dedicated cores (`grillhouse.mesure`) that nobody else touches, once the temporary directory
|
|
177
|
+
// and the disk of the copy have room.
|
|
178
|
+
const codes = runs.map(choix => {
|
|
179
|
+
const mesure = choix === 'mesures';
|
|
180
|
+
try {
|
|
181
|
+
return avecLaPasse(() => jouerLeRun(racine, choix, options), {
|
|
182
|
+
lourde: false,
|
|
183
|
+
mesure,
|
|
184
|
+
racine,
|
|
185
|
+
sorte: mesure ? 'Mesures de nuit' : 'Nuit',
|
|
186
|
+
});
|
|
187
|
+
} catch (e) {
|
|
188
|
+
if (e?.name !== 'AttenteDeLaMachine') {
|
|
189
|
+
throw e;
|
|
190
|
+
}
|
|
191
|
+
process.stdout.write(`${e.message}\n`);
|
|
192
|
+
return e.code;
|
|
151
193
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
194
|
+
});
|
|
195
|
+
return plierLesCodes(codes);
|
|
155
196
|
}
|
|
156
197
|
|
|
157
|
-
// The
|
|
158
|
-
|
|
159
|
-
function jouerLesRuns(racine, runs, options) {
|
|
198
|
+
// The run <choix> of Vitest of the night, in the copy at <racine>: its exit code.
|
|
199
|
+
function jouerLeRun(racine, choix, options) {
|
|
160
200
|
const { tranche } = options;
|
|
161
201
|
const rapports = path.join(racine, RAPPORTS);
|
|
162
202
|
if (tranche) {
|
|
@@ -167,18 +207,38 @@ function jouerLesRuns(racine, runs, options) {
|
|
|
167
207
|
const enTranche = tranche
|
|
168
208
|
? { [NUIT_TRANCHE]: JSON.stringify({ tranche: `${tranche.index}/${tranche.count}`, rapports }) }
|
|
169
209
|
: {};
|
|
170
|
-
|
|
210
|
+
// One run per unit, each under the configuration of its package; the code of the unit runs
|
|
211
|
+
// folds as the runs' do: 0, 75 when every red one is at 75, else the first red code.
|
|
212
|
+
const codes = unitesDeLaNuit(racine).map(({ dossier, config, exclus }) => {
|
|
171
213
|
const r = spawnSync(
|
|
172
214
|
'npx',
|
|
173
|
-
[
|
|
215
|
+
[
|
|
216
|
+
'--no-install',
|
|
217
|
+
'vitest',
|
|
218
|
+
'run',
|
|
219
|
+
'--root',
|
|
220
|
+
dossier,
|
|
221
|
+
'--config',
|
|
222
|
+
CONFIGURATION,
|
|
223
|
+
],
|
|
174
224
|
{
|
|
175
225
|
cwd: racine,
|
|
176
226
|
stdio: 'inherit',
|
|
177
|
-
env: {
|
|
227
|
+
env: {
|
|
228
|
+
...process.env,
|
|
229
|
+
[NUIT_VARIABLE]: choix,
|
|
230
|
+
[NUIT_PAQUET]: JSON.stringify({ config, exclus }),
|
|
231
|
+
...enTranche,
|
|
232
|
+
},
|
|
178
233
|
}
|
|
179
234
|
);
|
|
180
235
|
return r.status ?? 1;
|
|
181
236
|
});
|
|
237
|
+
return plierLesCodes(codes);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// The code of <codes>: 0 when all are, 75 when every red one is, else the first red code.
|
|
241
|
+
function plierLesCodes(codes) {
|
|
182
242
|
const rouges = codes.filter(c => c !== 0);
|
|
183
243
|
if (rouges.length === 0) {
|
|
184
244
|
return 0;
|
|
@@ -186,12 +246,72 @@ function jouerLesRuns(racine, runs, options) {
|
|
|
186
246
|
return rouges.every(c => c === A_REPASSER) ? A_REPASSER : rouges.find(c => c !== A_REPASSER);
|
|
187
247
|
}
|
|
188
248
|
|
|
249
|
+
const SAUTES_DES_UNITES = new Set(['node_modules', 'dist', '.git', '.turbo', '.claude']);
|
|
250
|
+
const CONFIGURATIONS = ['vitest.config', 'vite.config'];
|
|
251
|
+
const EXTENSIONS = ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs'];
|
|
252
|
+
|
|
253
|
+
// The Vitest configuration of the directory <dossier>, as Vitest looks for it: the first
|
|
254
|
+
// `vitest.config.*`, else the first `vite.config.*`; undefined when it has none.
|
|
255
|
+
function configurationDe(dossier) {
|
|
256
|
+
for (const nom of CONFIGURATIONS) {
|
|
257
|
+
for (const ext of EXTENSIONS) {
|
|
258
|
+
const f = path.join(dossier, `${nom}.${ext}`);
|
|
259
|
+
if (existsSync(f)) {
|
|
260
|
+
return f;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The units a run of the night plays in the copy at <racine>: the root, under the frame's
|
|
269
|
+
* configuration alone, and each directory below it that holds a Vitest configuration, under that
|
|
270
|
+
* configuration. Each unit leaves out the directories of the units below it.
|
|
271
|
+
* @param {string} racine the root of the copy
|
|
272
|
+
* @returns {{ dossier: string, config?: string, exclus: string[] }[]}
|
|
273
|
+
*/
|
|
274
|
+
export function unitesDeLaNuit(racine) {
|
|
275
|
+
const configures = [];
|
|
276
|
+
const parcourir = dossier => {
|
|
277
|
+
for (const e of readdirSync(dossier, { withFileTypes: true })) {
|
|
278
|
+
if (e.isDirectory() && !SAUTES_DES_UNITES.has(e.name)) {
|
|
279
|
+
const d = path.join(dossier, e.name);
|
|
280
|
+
const config = configurationDe(d);
|
|
281
|
+
if (config) {
|
|
282
|
+
configures.push({ dossier: d, config });
|
|
283
|
+
}
|
|
284
|
+
parcourir(d);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
parcourir(racine);
|
|
289
|
+
const unites = [{ dossier: racine }, ...configures];
|
|
290
|
+
const dessous = (parent, d) => {
|
|
291
|
+
const r = path.relative(parent, d);
|
|
292
|
+
return r !== '' && !r.startsWith('..') && !path.isAbsolute(r);
|
|
293
|
+
};
|
|
294
|
+
return unites
|
|
295
|
+
.map(u => ({
|
|
296
|
+
...u,
|
|
297
|
+
exclus: configures
|
|
298
|
+
.filter(c => dessous(u.dossier, c.dossier))
|
|
299
|
+
.map(c => `${path.relative(u.dossier, c.dossier).split(path.sep).join('/')}/**`),
|
|
300
|
+
}))
|
|
301
|
+
.filter(
|
|
302
|
+
u =>
|
|
303
|
+
u.dossier === racine ||
|
|
304
|
+
enTient(u.dossier, f => estUnTestDeNuit(f) || estUnBanc(f)) ||
|
|
305
|
+
fichiersTemoins(u.dossier).length > 0
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
189
309
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
190
|
-
const {
|
|
310
|
+
const { erreur, ...options } = lireLesArguments(process.argv.slice(2));
|
|
191
311
|
if (erreur) {
|
|
192
312
|
process.stderr.write(`${erreur}\n`);
|
|
193
313
|
process.exitCode = 2;
|
|
194
314
|
} else {
|
|
195
|
-
process.exitCode = testsDeNuit(process.cwd(),
|
|
315
|
+
process.exitCode = testsDeNuit(process.cwd(), options);
|
|
196
316
|
}
|
|
197
317
|
}
|
|
@@ -30,7 +30,11 @@ import path from 'node:path';
|
|
|
30
30
|
import { pathToFileURL } from 'node:url';
|
|
31
31
|
import { MODE, trancher } from '../../dette.mjs';
|
|
32
32
|
import { testsDuDepot } from './tailles-des-tests.mjs';
|
|
33
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
estUnTestDeNuit,
|
|
35
|
+
porteLEtiquetteDuPoste,
|
|
36
|
+
porteLEtiquetteEquipee,
|
|
37
|
+
} from './vitest-config/cibles.mjs';
|
|
34
38
|
import {
|
|
35
39
|
code,
|
|
36
40
|
IMPORT,
|
|
@@ -42,6 +46,7 @@ import {
|
|
|
42
46
|
|
|
43
47
|
export const GARDE = 'tests-du-poste';
|
|
44
48
|
export const REGLE = 'poste-sans-etiquette';
|
|
49
|
+
export const REGLE_EQUIPEE = 'equipee-sans-etiquette';
|
|
45
50
|
|
|
46
51
|
// A call that starts the command claude, its arguments to the end of the line.
|
|
47
52
|
const CLAUDE =
|
|
@@ -49,27 +54,39 @@ const CLAUDE =
|
|
|
49
54
|
// The subcommands of claude a shared machine plays: the plugins of the frame and its version.
|
|
50
55
|
const CLAUDE_PARTAGE = new Set(['plugin', '--version']);
|
|
51
56
|
|
|
52
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* The marks of what a shared machine does not have, each `{ nom, classe, voit(code) }`: the class
|
|
59
|
+
* `equipee` is the equipment of a machine (the tag `@equipee`: the envelope, a Temporal server,
|
|
60
|
+
* sccache, the binaries of the module cargo), the class `poste` what only the poste has (the tag
|
|
61
|
+
* `@poste`: the real bd, systemd, the keyring, the session of the user, a session of claude).
|
|
62
|
+
*/
|
|
53
63
|
export const DEPENDANCES = [
|
|
54
64
|
{
|
|
55
65
|
nom: "l'enveloppe bwrap",
|
|
66
|
+
classe: 'equipee',
|
|
56
67
|
voit: c =>
|
|
57
68
|
/\bcanWrap\b|['"`]bwrap['"`]|['"`/]enveloppe\/(?:lancer\.sh|enveloppe\.mjs)['"`]|['"`/]enveloppe(?:\.[\w-]+)?['"`]/.test(
|
|
58
69
|
c
|
|
59
70
|
),
|
|
60
71
|
},
|
|
61
|
-
{ nom: 'le bd réel', voit: c => /\bhasBd\b/.test(c) },
|
|
72
|
+
{ nom: 'le bd réel', classe: 'poste', voit: c => /\bhasBd\b/.test(c) },
|
|
62
73
|
{
|
|
63
74
|
nom: 'un serveur Temporal',
|
|
75
|
+
classe: 'equipee',
|
|
64
76
|
voit: c => /['"`]server['"`]\s*,\s*['"`]start-dev['"`]/.test(c),
|
|
65
77
|
},
|
|
66
|
-
{ nom: 'sccache', voit: c => /['"`]sccache['"`]/.test(c) },
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
{ nom: 'sccache', classe: 'equipee', voit: c => /['"`]sccache['"`]/.test(c) },
|
|
79
|
+
{
|
|
80
|
+
nom: 'les binaires du module cargo',
|
|
81
|
+
classe: 'equipee',
|
|
82
|
+
voit: c => /['"`/]templates\/cargo\b/.test(c),
|
|
83
|
+
},
|
|
84
|
+
{ nom: 'systemd', classe: 'poste', voit: c => /['"`](?:systemctl|systemd-run)['"`]/.test(c) },
|
|
85
|
+
{ nom: 'le trousseau', classe: 'poste', voit: c => /\bkeyrings\b/.test(c) },
|
|
86
|
+
{ nom: 'la session de l’utilisateur', classe: 'poste', voit: c => /\/run\/user\//.test(c) },
|
|
71
87
|
{
|
|
72
88
|
nom: 'une séance de claude',
|
|
89
|
+
classe: 'poste',
|
|
73
90
|
voit: c => [...c.matchAll(CLAUDE)].some(m => !m[1] || !CLAUDE_PARTAGE.has(m[2])),
|
|
74
91
|
},
|
|
75
92
|
];
|
|
@@ -80,6 +97,11 @@ export const DEPENDANCES = [
|
|
|
80
97
|
* the repository at <racine>: the names of DEPENDANCES, each once, in their order.
|
|
81
98
|
*/
|
|
82
99
|
export function dependancesDu(fichier, lire = lireLeDisque, racine = path.parse(fichier).root) {
|
|
100
|
+
return marquesDu(fichier, lire, racine).map(d => d.nom);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// The marks (the entries of DEPENDANCES) the test file <fichier> shows, as `dependancesDu` reads them.
|
|
104
|
+
function marquesDu(fichier, lire, racine) {
|
|
83
105
|
const vus = new Set();
|
|
84
106
|
const codes = [];
|
|
85
107
|
const suivre = f => {
|
|
@@ -103,39 +125,59 @@ export function dependancesDu(fichier, lire = lireLeDisque, racine = path.parse(
|
|
|
103
125
|
};
|
|
104
126
|
suivre(fichier);
|
|
105
127
|
const tout = codes.join('\n');
|
|
106
|
-
return DEPENDANCES.filter(d => d.voit(tout))
|
|
128
|
+
return DEPENDANCES.filter(d => d.voit(tout));
|
|
107
129
|
}
|
|
108
130
|
|
|
109
131
|
/**
|
|
110
|
-
* Each night test of the repository at <racine>: `[{ fichier, etiquete,
|
|
111
|
-
* from its root, `etiquete` whether it bears the tag `@poste`, `
|
|
112
|
-
* it shows.
|
|
132
|
+
* Each night test of the repository at <racine>: `[{ fichier, etiquete, equipee, marques }]`,
|
|
133
|
+
* `fichier` from its root, `etiquete` whether it bears the tag `@poste`, `equipee` whether it bears
|
|
134
|
+
* the tag `@equipee`, `marques` the marks it shows, `{ nom, classe }` each.
|
|
113
135
|
*/
|
|
114
136
|
export function testsDeNuitDuDepot(racine) {
|
|
115
137
|
return testsDuDepot(racine)
|
|
116
138
|
.filter(estUnTestDeNuit)
|
|
117
139
|
.map(fichier => {
|
|
118
140
|
const abs = path.join(racine, fichier);
|
|
141
|
+
const texte = lireLeDisque(abs) ?? '';
|
|
119
142
|
return {
|
|
120
143
|
fichier,
|
|
121
|
-
etiquete: porteLEtiquetteDuPoste(
|
|
122
|
-
|
|
144
|
+
etiquete: porteLEtiquetteDuPoste(texte),
|
|
145
|
+
equipee: porteLEtiquetteEquipee(texte),
|
|
146
|
+
marques: marquesDu(abs, lireLeDisque, racine).map(({ nom, classe }) => ({ nom, classe })),
|
|
123
147
|
};
|
|
124
148
|
});
|
|
125
149
|
}
|
|
126
150
|
|
|
127
151
|
/**
|
|
128
152
|
* The findings of the repository at <racine>, in the debt's form (../../dette.mjs): one
|
|
129
|
-
* `{ fichier, regle, message }` per night test that
|
|
153
|
+
* `{ fichier, regle, message }` per night test that shows a mark of the poste without the tag
|
|
154
|
+
* `@poste` (REGLE), and one per night test that shows a mark of equipment without the tag
|
|
155
|
+
* `@equipee` (REGLE_EQUIPEE).
|
|
130
156
|
*/
|
|
131
157
|
export function verifier(racine, tous = testsDeNuitDuDepot(racine)) {
|
|
132
|
-
|
|
133
|
-
.filter(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
158
|
+
const noms = (marques, classe) =>
|
|
159
|
+
marques.filter(m => m.classe === classe).map(m => m.nom);
|
|
160
|
+
return tous.flatMap(({ fichier, etiquete, equipee, marques }) => {
|
|
161
|
+
/** @type {{ fichier: string, regle: string, message: string }[]} */
|
|
162
|
+
const constats = [];
|
|
163
|
+
const poste = noms(marques, 'poste');
|
|
164
|
+
if (!etiquete && poste.length > 0) {
|
|
165
|
+
constats.push({
|
|
166
|
+
fichier,
|
|
167
|
+
regle: REGLE,
|
|
168
|
+
message: `${fichier} : ce test de nuit dépend du poste (${poste.join(', ')}), qu'aucun exécuteur n'a ; il porte l'étiquette « // @poste: <raison> » dans le commentaire de sa tête, et la nuit de PC3 seule le joue.`,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
const equipement = noms(marques, 'equipee');
|
|
172
|
+
if (!equipee && equipement.length > 0) {
|
|
173
|
+
constats.push({
|
|
174
|
+
fichier,
|
|
175
|
+
regle: REGLE_EQUIPEE,
|
|
176
|
+
message: `${fichier} : ce test de nuit exige l'équipement d'une machine (${equipement.join(', ')}) ; il porte l'étiquette « // @equipee: <raison> » dans le commentaire de sa tête, et un exécuteur sans équipement le laisse.`,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return constats;
|
|
180
|
+
});
|
|
139
181
|
}
|
|
140
182
|
|
|
141
183
|
/**
|
|
@@ -157,7 +199,7 @@ export function rapport(racine, env = process.env) {
|
|
|
157
199
|
lignes: [
|
|
158
200
|
...refus.map(r => `⛔ ${r.message}`),
|
|
159
201
|
...lignes,
|
|
160
|
-
`ℹ️ ${GARDE} : ${tous.length} test(s) de nuit, ${tous.filter(t => t.etiquete).length} laissé(s) au poste (@poste).`,
|
|
202
|
+
`ℹ️ ${GARDE} : ${tous.length} test(s) de nuit, ${tous.filter(t => t.etiquete).length} laissé(s) au poste (@poste), ${tous.filter(t => t.equipee).length} équipé(s) (@equipee).`,
|
|
161
203
|
],
|
|
162
204
|
code: refus.length ? 1 : 0,
|
|
163
205
|
};
|
|
@@ -22,12 +22,14 @@
|
|
|
22
22
|
// above its debt, or absent from the debt with a title counted, is refused by its name; a debt
|
|
23
23
|
// above the real count is refused too, so that the lot lowers it by `npm run
|
|
24
24
|
// grillhouse:dette:elaguer`. A test file moved or renamed by the lot, its content kept (or
|
|
25
|
-
// nearly), takes the debt of its former name (`renommesDuLot`).
|
|
25
|
+
// nearly), takes the debt of its former name (`renommesDuLot`). In the envelope of a plan, a debt
|
|
26
|
+
// above its count is judged in the files of the plan's packages alone (`mesureDuPlan` of
|
|
27
|
+
// ../../dette.mjs); the final pass judges the others.
|
|
26
28
|
import { spawnSync } from 'node:child_process';
|
|
27
29
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
28
30
|
import path from 'node:path';
|
|
29
31
|
import { pathToFileURL } from 'node:url';
|
|
30
|
-
import { FICHIER, lire as lireDette, trancher } from '../../dette.mjs';
|
|
32
|
+
import { FICHIER, lire as lireDette, mesureDuPlan, trancher } from '../../dette.mjs';
|
|
31
33
|
import { A_ELAGUER, ecrireSarif } from '../../resultats.mjs';
|
|
32
34
|
import { prefixe } from '../../services-du-noyau.mjs';
|
|
33
35
|
import { testsDuDepot } from './tailles-des-tests.mjs';
|
|
@@ -206,9 +208,11 @@ export function renommesDuLot(racine) {
|
|
|
206
208
|
* The refusals of the findings <constats> against the <dette> read from the file: one
|
|
207
209
|
* `{ fichier, message }` per file whose count rises above its debt (a file absent from the debt
|
|
208
210
|
* has none) and per file whose debt stays above its count. <renommes> (`{ nouveau: ancien }`)
|
|
209
|
-
* gives a file moved or renamed the debt of its former name.
|
|
211
|
+
* gives a file moved or renamed the debt of its former name. <mesure> says whether the run
|
|
212
|
+
* measures a file for the debt (`mesureDuPlan` of ../../dette.mjs; every file by default): a debt
|
|
213
|
+
* above its count is judged among those files alone.
|
|
210
214
|
*/
|
|
211
|
-
export function jugerLesTitres(dette, constats, renommes = {}) {
|
|
215
|
+
export function jugerLesTitres(dette, constats, renommes = {}, mesure = () => true) {
|
|
212
216
|
const inscrite = dette?.[GARDE] ?? {};
|
|
213
217
|
const permis = f => inscrite[f]?.[REGLE]?.count ?? 0;
|
|
214
218
|
const comptes = new Map();
|
|
@@ -225,7 +229,7 @@ export function jugerLesTitres(dette, constats, renommes = {}) {
|
|
|
225
229
|
regle: REGLE,
|
|
226
230
|
message: `${fichier} : ${trouve} titre(s) nomment un ticket ou un « critère N » pour ${droit} inscrit(s) dans ${FICHIER} : ${MESSAGE_FIN}`,
|
|
227
231
|
});
|
|
228
|
-
} else if (trouve < droit) {
|
|
232
|
+
} else if (trouve < droit && mesure(fichier)) {
|
|
229
233
|
refus.push({
|
|
230
234
|
fichier,
|
|
231
235
|
regle: REGLE,
|
|
@@ -236,7 +240,7 @@ export function jugerLesTitres(dette, constats, renommes = {}) {
|
|
|
236
240
|
}
|
|
237
241
|
}
|
|
238
242
|
for (const fichier of Object.keys(inscrite)) {
|
|
239
|
-
if (comptes.has(fichier) || reprises.has(fichier) || !permis(fichier)) {
|
|
243
|
+
if (comptes.has(fichier) || reprises.has(fichier) || !permis(fichier) || !mesure(fichier)) {
|
|
240
244
|
continue;
|
|
241
245
|
}
|
|
242
246
|
refus.push({
|
|
@@ -282,7 +286,7 @@ function main() {
|
|
|
282
286
|
refus = r.refus;
|
|
283
287
|
lignes = r.lignes;
|
|
284
288
|
} else {
|
|
285
|
-
refus = jugerLesTitres(lireDette(racine), constats, renommes);
|
|
289
|
+
refus = jugerLesTitres(lireDette(racine), constats, renommes, mesureDuPlan(racine));
|
|
286
290
|
// Each refusal is a finding in SARIF; a debt above the count is also a note `a-elaguer`, by
|
|
287
291
|
// which the circuit lowers the debt d'office.
|
|
288
292
|
ecrireSarif({
|
|
@@ -67,6 +67,10 @@
|
|
|
67
67
|
// root's task sets none, since `$TURBO_EXTENDS$` then extends an empty list; then
|
|
68
68
|
// `$TURBO_ROOT$/<dir>/**` each) and waits, beside the root's `dependsOn`, for each trace whose
|
|
69
69
|
// output one of them overlaps (`<producer>#trace:<name>`); the producer declares nothing for it.
|
|
70
|
+
// The patterns its test files declare they read (`// @lit <motif>` at their head,
|
|
71
|
+
// ./vitest-config/lances.mjs) are hashed with them (`$TURBO_ROOT$/<motif>` each, those `lit`
|
|
72
|
+
// already covers left out), a package without `lit` included: one declaration, read by the
|
|
73
|
+
// choice of the tests of a pass and by Turborepo's cache.
|
|
70
74
|
// - `traces`: each trace the package produces, its command the package's script of the same name,
|
|
71
75
|
// `trace:<name>`. Its task waits for `build` and `^build`, and for the traces its `lit` overlaps;
|
|
72
76
|
// it hashes the package's files and its `lit`, its output left out, and Turborepo caches its
|
|
@@ -151,7 +155,8 @@
|
|
|
151
155
|
// (`TMPDIR`), the base of a pass (scripts/mesure/base-de-passe.mjs), where every task writes
|
|
152
156
|
// its temporary files and which goes at the end of the pass; the workers of the tests of a task
|
|
153
157
|
// (`GRILLHOUSE_TRAVAILLEURS`, scripts/places-de-la-machine.mjs), the bound a session or a pass
|
|
154
|
-
// sets, which the tool of each language reads
|
|
158
|
+
// sets, which the tool of each language reads; the Rust toolchain of a runner (`CARGO_HOME`,
|
|
159
|
+
// `RUSTUP_HOME`), which a runner of the repository holds per executor. The generator adds each
|
|
155
160
|
// one the root lacks, the project's entries kept, and the check refuses a
|
|
156
161
|
// root without one.
|
|
157
162
|
//
|
|
@@ -174,10 +179,15 @@ import {
|
|
|
174
179
|
VARIABLE_TRAVAILLEURS as TRAVAILLEURS,
|
|
175
180
|
} from '../../services-du-noyau.mjs';
|
|
176
181
|
import { matieres } from './consommateurs.mjs';
|
|
182
|
+
import { lecturesDeclarees, testsDuPaquet } from './vitest-config/lances.mjs';
|
|
177
183
|
import { parcourir } from './parcours.mjs';
|
|
178
184
|
import { paquets, TYPAGE } from '../../paquets.mjs';
|
|
179
185
|
import { ecrireSarif, RESULTATS } from '../../resultats.mjs';
|
|
180
|
-
import {
|
|
186
|
+
import {
|
|
187
|
+
SCRIPT_DES_TESTS as TESTS,
|
|
188
|
+
SCRIPTS_DE_GARDES,
|
|
189
|
+
TESTS_CIBLES,
|
|
190
|
+
} from '../../services-du-noyau.mjs';
|
|
181
191
|
|
|
182
192
|
export const TURBO = 'turbo.json';
|
|
183
193
|
export const COMMANDE = 'npx grillhouse turbo-des-paquets --ecrire';
|
|
@@ -188,7 +198,7 @@ const TOPOLOGIE = ['dependencies', 'devDependencies', 'optionalDependencies'];
|
|
|
188
198
|
// The root configuration of Turborepo, in the order Turborepo reads it.
|
|
189
199
|
const RACINES = ['turbo.json', 'turbo.jsonc'];
|
|
190
200
|
// The guard tasks of the root: the frame's controls, and the project's own guards.
|
|
191
|
-
export const GARDES =
|
|
201
|
+
export const GARDES = SCRIPTS_DE_GARDES;
|
|
192
202
|
// The controls of the root the CI used to play beside the verification: the format check and the
|
|
193
203
|
// lint (grillhouse-61z). A root plays those its package.json holds a script for, none demanded.
|
|
194
204
|
export const CONTROLES = ['format:check', 'lint'];
|
|
@@ -310,8 +320,20 @@ const attenteDuTypage = racine => (paquets(racine).length ? ['build', '^build']
|
|
|
310
320
|
// The temporary directory of a process, which names the base of its pass.
|
|
311
321
|
const TEMPORAIRE = 'TMPDIR';
|
|
312
322
|
// The variables the root's `globalPassThroughEnv` names, and why, as the check says it.
|
|
313
|
-
const PASSAGES = [
|
|
323
|
+
const PASSAGES = [
|
|
324
|
+
RESULTATS,
|
|
325
|
+
CHANGEMENTS,
|
|
326
|
+
AVANCEMENT,
|
|
327
|
+
TEMPORAIRE,
|
|
328
|
+
TRAVAILLEURS,
|
|
329
|
+
'CARGO_HOME',
|
|
330
|
+
'RUSTUP_HOME',
|
|
331
|
+
];
|
|
314
332
|
const POURQUOI = {
|
|
333
|
+
CARGO_HOME:
|
|
334
|
+
"le CARGO_HOME de l'exécuteur, que cargo lit pour trouver sa chaîne ; sans lui un exécuteur à chaîne propre échoue",
|
|
335
|
+
RUSTUP_HOME:
|
|
336
|
+
"le RUSTUP_HOME de l'exécuteur, que rustup lit pour choisir une version de cargo ; sans lui un exécuteur à chaîne propre échoue",
|
|
315
337
|
[RESULTATS]: "où les gardes, Turborepo et Vitest écrivent les résultats qu'un circuit lit",
|
|
316
338
|
[CHANGEMENTS]:
|
|
317
339
|
'les fichiers changés depuis le dernier vert, auxquels Vitest relie les tests que rejoue un paquet',
|
|
@@ -717,6 +739,17 @@ function declarations(liste) {
|
|
|
717
739
|
});
|
|
718
740
|
}
|
|
719
741
|
|
|
742
|
+
// The patterns the test files of the package at <dossier> (absolute) declare they read (`// @lit`
|
|
743
|
+
// at their head, ./vitest-config/lances.mjs), each a glob from the root, those the paths <lit> of
|
|
744
|
+
// the package already cover left out; sorted.
|
|
745
|
+
function lecturesDesTests(dossier, lit) {
|
|
746
|
+
return [
|
|
747
|
+
...new Set(testsDuPaquet(dossier).flatMap(t => lecturesDeclarees(readFileSync(t, 'utf8')))),
|
|
748
|
+
]
|
|
749
|
+
.filter(m => !lit.some(l => m === l || m.startsWith(`${l}/`)))
|
|
750
|
+
.sort();
|
|
751
|
+
}
|
|
752
|
+
|
|
720
753
|
// The text of a package's turbo.json, whose tasks are <taches>.
|
|
721
754
|
const texte = taches =>
|
|
722
755
|
`// Généré par \`${COMMANDE}\` depuis les package.json, le turbo.json racine et docs/agents/hors-cadre.txt ; ne pas éditer.\n${JSON.stringify(
|
|
@@ -821,12 +854,14 @@ export function attendus(racine) {
|
|
|
821
854
|
}
|
|
822
855
|
}
|
|
823
856
|
const decl = decls.get(dossier);
|
|
824
|
-
|
|
857
|
+
const declares = lecturesDesTests(path.join(racine, dossier), decl.lit);
|
|
858
|
+
if (decl.lit.length || declares.length) {
|
|
825
859
|
taches[TESTS] = {
|
|
826
860
|
dependsOn: [...deplier(deRacine.get(TESTS)?.dependsOn ?? []), ...jointes(decl.lit)],
|
|
827
861
|
inputs: [
|
|
828
862
|
base(TESTS),
|
|
829
863
|
...decl.lit.map(l => `$TURBO_ROOT$/${l}/**`),
|
|
864
|
+
...declares.map(m => `$TURBO_ROOT$/${m}`),
|
|
830
865
|
...gitsExclus(decl.lit, sm),
|
|
831
866
|
],
|
|
832
867
|
};
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
// `turbo run grillhouse:gardes gardes typecheck test:unit --continue=dependencies-successful
|
|
44
44
|
// --concurrency=<n> --summarize`, each argument given after it. A red does not stop the pass:
|
|
45
45
|
// every task whose prerequisites passed plays, and each red is named. <n>, the tasks side by
|
|
46
|
-
// side, is half the cores of the pass's part, one at least (`
|
|
46
|
+
// side, is half the cores of the pass's part, one at least (`tachesCoteACote` of the core): each task of tests is
|
|
47
47
|
// itself parallel (Vitest's workers), as make's `-j` and Bazel's `--local_cpu_resources` bound a
|
|
48
48
|
// build by the machine; a `--concurrency` among the arguments replaces it. The workers of each
|
|
49
49
|
// task of tests are the cores shared between the tasks of tests side by side
|
|
@@ -136,6 +136,8 @@ import {
|
|
|
136
136
|
PASSE_ROUGE,
|
|
137
137
|
retirerALInterruption,
|
|
138
138
|
SCRIPT_DES_TESTS,
|
|
139
|
+
SCRIPTS_DE_GARDES as GARDES,
|
|
140
|
+
tachesCoteACote as concurrence,
|
|
139
141
|
TESTS_CIBLES,
|
|
140
142
|
testsCibles,
|
|
141
143
|
travailleursDeLaSeance,
|
|
@@ -147,7 +149,6 @@ import { fichiersDeLaTranche, RAPPORTS } from './tranches.mjs';
|
|
|
147
149
|
import { garderLesResumes } from './resume-du-lanceur.mjs';
|
|
148
150
|
import { controlesDuDepot, planifier } from './turbo-des-paquets.mjs';
|
|
149
151
|
|
|
150
|
-
const GARDES = ['grillhouse:gardes', 'gardes'];
|
|
151
152
|
const TACHES = [...GARDES, TYPAGE, SCRIPT_DES_TESTS];
|
|
152
153
|
const CONCURRENCE = /^--concurrency(?:=|$)/;
|
|
153
154
|
// The variable that names the file of the red tasks, which the night reads.
|
|
@@ -161,9 +162,6 @@ const rejeu = id => {
|
|
|
161
162
|
|
|
162
163
|
const lister = dossier => (existsSync(dossier) ? readdirSync(dossier) : []);
|
|
163
164
|
|
|
164
|
-
// The tasks a pass plays side by side on a machine of <coeurs> cores: half of them, one at least.
|
|
165
|
-
const concurrence = (coeurs = availableParallelism()) => Math.max(1, Math.floor(coeurs / 2));
|
|
166
|
-
|
|
167
165
|
// The tasks side by side <args> ask for (`--concurrency=<n>`, `--concurrency <n>`), null without
|
|
168
166
|
// a whole number.
|
|
169
167
|
function concurrenceDemandee(args) {
|