@roomi-fields/grillhouse 0.29.0 → 0.31.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 +769 -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/bin/grillhouse.mjs +79 -18
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +24 -0
- package/dist/temporal/acte.d.ts +24 -0
- package/dist/temporal/acte.js +139 -0
- package/dist/temporal/acte.js.map +1 -0
- package/dist/temporal/attributs.d.ts +6 -0
- package/dist/temporal/attributs.js +15 -0
- package/dist/temporal/attributs.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +13 -0
- package/dist/temporal/circuit/activites.js +33 -0
- package/dist/temporal/circuit/activites.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +72 -0
- package/dist/temporal/circuit/client.js +247 -0
- package/dist/temporal/circuit/client.js.map +1 -0
- package/dist/temporal/circuit/commande.d.ts +2 -0
- package/dist/temporal/circuit/commande.js +238 -0
- package/dist/temporal/circuit/commande.js.map +1 -0
- package/dist/temporal/circuit/contrat.d.ts +305 -0
- package/dist/temporal/circuit/contrat.js +30 -0
- package/dist/temporal/circuit/contrat.js.map +1 -0
- package/dist/temporal/circuit/deroule.d.ts +3 -0
- package/dist/temporal/circuit/deroule.js +540 -0
- package/dist/temporal/circuit/deroule.js.map +1 -0
- package/dist/temporal/client.d.ts +47 -0
- package/dist/temporal/client.js +69 -0
- package/dist/temporal/client.js.map +1 -0
- package/dist/temporal/commande.d.ts +2 -0
- package/dist/temporal/commande.js +94 -0
- package/dist/temporal/commande.js.map +1 -0
- package/dist/temporal/deroules.d.ts +5 -0
- package/dist/temporal/deroules.js +10 -0
- package/dist/temporal/deroules.js.map +1 -0
- package/dist/temporal/etat.d.ts +33 -0
- package/dist/temporal/etat.js +59 -0
- package/dist/temporal/etat.js.map +1 -0
- package/dist/temporal/file/activites.d.ts +10 -0
- package/dist/temporal/file/activites.js +25 -0
- package/dist/temporal/file/activites.js.map +1 -0
- package/dist/temporal/file/client.d.ts +4 -0
- package/dist/temporal/file/client.js +6 -0
- package/dist/temporal/file/client.js.map +1 -0
- package/dist/temporal/file/contrat.d.ts +158 -0
- package/dist/temporal/file/contrat.js +14 -0
- package/dist/temporal/file/contrat.js.map +1 -0
- package/dist/temporal/file/deroule.d.ts +15 -0
- package/dist/temporal/file/deroule.js +235 -0
- package/dist/temporal/file/deroule.js.map +1 -0
- package/dist/temporal/installation.d.ts +120 -0
- package/dist/temporal/installation.js +386 -0
- package/dist/temporal/installation.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +13 -0
- package/dist/temporal/places/activites.js.map +1 -0
- package/dist/temporal/places/client.d.ts +28 -0
- package/dist/temporal/places/client.js +64 -0
- package/dist/temporal/places/client.js.map +1 -0
- package/dist/temporal/places/contrat.d.ts +106 -0
- package/dist/temporal/places/contrat.js +21 -0
- package/dist/temporal/places/contrat.js.map +1 -0
- package/dist/temporal/places/deroule.d.ts +3 -0
- package/dist/temporal/places/deroule.js +198 -0
- package/dist/temporal/places/deroule.js.map +1 -0
- package/dist/temporal/sonde/activites.d.ts +6 -0
- package/dist/temporal/sonde/activites.js +52 -0
- package/dist/temporal/sonde/activites.js.map +1 -0
- package/dist/temporal/sonde/contrat.d.ts +35 -0
- package/dist/temporal/sonde/contrat.js +10 -0
- package/dist/temporal/sonde/contrat.js.map +1 -0
- package/dist/temporal/sonde/deroule.d.ts +3 -0
- package/dist/temporal/sonde/deroule.js +39 -0
- package/dist/temporal/sonde/deroule.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +7 -0
- package/dist/temporal/tickets/activites.js +81 -0
- package/dist/temporal/tickets/activites.js.map +1 -0
- package/dist/temporal/tickets/client.d.ts +10 -0
- package/dist/temporal/tickets/client.js +31 -0
- package/dist/temporal/tickets/client.js.map +1 -0
- package/dist/temporal/tickets/contrat.d.ts +56 -0
- package/dist/temporal/tickets/contrat.js +13 -0
- package/dist/temporal/tickets/contrat.js.map +1 -0
- package/dist/temporal/tickets/deroule.d.ts +3 -0
- package/dist/temporal/tickets/deroule.js +94 -0
- package/dist/temporal/tickets/deroule.js.map +1 -0
- package/dist/temporal/travailleur.d.ts +2 -0
- package/dist/temporal/travailleur.js +69 -0
- package/dist/temporal/travailleur.js.map +1 -0
- package/docs/ARCHITECTURE.md +646 -87
- package/docs/CADRE.md +27 -0
- package/docs/INTERFACE.md +139 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2255 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +40 -14
- package/scripts/avancement.mjs +155 -26
- package/scripts/bilan.mjs +137 -43
- package/scripts/cadre.mjs +16 -4
- package/scripts/circuit.mjs +993 -4075
- package/scripts/circuits-cles.d.mts +4 -0
- package/scripts/circuits-cles.mjs +21 -0
- package/scripts/circuits-du-serveur.mjs +105 -0
- package/scripts/codes-de-sortie.mjs +9 -0
- package/scripts/commandes-composees.mjs +45 -41
- package/scripts/commandes-du-path.d.mts +7 -0
- package/scripts/commandes-du-path.mjs +25 -0
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +18 -12
- package/scripts/conformite.mjs +56 -28
- package/scripts/copies-finies.mjs +52 -47
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +121 -0
- package/scripts/dernier-vert.mjs +61 -34
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +244 -0
- package/scripts/droits.mjs +51 -16
- package/scripts/effets.mjs +352 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +259 -55
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
- package/scripts/etapes.mjs +5 -2
- package/scripts/faits-du-circuit.mjs +493 -0
- package/scripts/file-des-tickets.d.mts +21 -0
- package/scripts/file-des-tickets.mjs +58 -0
- package/scripts/flux-des-paquets.mjs +201 -0
- package/scripts/gardes-du-cadre.mjs +21 -5
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +544 -434
- package/scripts/integration/integrer.mjs +87 -43
- package/scripts/integration/rejeu.mjs +45 -13
- package/scripts/jointure.d.ts +151 -28
- package/scripts/langages/cargo/commandes.mjs +383 -124
- package/scripts/langages/cargo/composants.mjs +154 -42
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +22 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +218 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +28 -8
- package/scripts/langages/python/lot.mjs +1 -36
- 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/construire.mjs +6 -163
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +66 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +50 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
- 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-prefixe-des-tickets.mjs +63 -0
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
- package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
- 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 +93 -20
- package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
- package/scripts/langages/typescript/tests.mjs +40 -15
- package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
- package/scripts/langages/typescript/verdict.mjs +4 -2
- package/scripts/langages/typescript/verifier.mjs +58 -20
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +12 -6
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- 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 +56 -18
- 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 +124 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +25 -3
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +18 -8
- package/scripts/paquet-npm.mjs +157 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +46 -10
- package/scripts/passe-de-la-machine.mjs +71 -0
- package/scripts/places-de-la-machine.mjs +414 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +25 -8
- package/scripts/registre.mjs +9 -4
- package/scripts/regles-des-places.d.mts +36 -0
- package/scripts/regles-des-places.mjs +70 -0
- package/scripts/reponses-du-circuit.d.mts +6 -0
- package/scripts/reponses-du-circuit.mjs +28 -0
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +112 -46
- package/scripts/retirer-les-copies-finies.mjs +25 -0
- package/scripts/sans-reponse.d.mts +4 -0
- package/scripts/sans-reponse.mjs +13 -0
- package/scripts/seances.mjs +936 -0
- package/scripts/services-du-noyau.mjs +27 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +41 -10
- package/scripts/style-a-l-ecriture.mjs +260 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +180 -117
- package/scripts/taches-du-graphe.mjs +348 -0
- package/scripts/ticket-du-circuit.mjs +216 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +1018 -0
- package/scripts/verrou-de-fichier.mjs +8 -4
- package/scripts/verrou-de-machine.mjs +150 -51
- 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/explorateur/SKILL.md +9 -2
- package/skills/grill/SKILL.md +1 -1
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +17 -18
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +5 -3
- package/skills/testwriter/SKILL.md +49 -31
- package/scripts/demon.mjs +0 -251
- package/scripts/integration/file-attente.mjs +0 -61
- package/scripts/langages/cargo/touches.mjs +0 -93
- package/scripts/langages/typescript/script-des-tests.mjs +0 -6
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// `commandes`; run by `grillhouse <commande>` in the root of the workspace, its arguments after.
|
|
5
5
|
//
|
|
6
6
|
// npx grillhouse tests [--force] [<chemin>…] [--<option>…] tester
|
|
7
|
+
// npx grillhouse tests-du-paquet <chemin>… [--<option>…] tests-du-paquet
|
|
7
8
|
// npx grillhouse verifier [--tout | --gardes] verifier
|
|
8
9
|
// node commandes.mjs typer typer
|
|
9
10
|
// npx grillhouse preparer preparer
|
|
@@ -14,47 +15,66 @@
|
|
|
14
15
|
// - Each guard of structure of the module (./tailles-des-tests.mjs, ./clippy.mjs,
|
|
15
16
|
// ./frontieres.mjs, ./index-interfaces.mjs) is a command by its name too, its own script, as the module typescript's: the line of a red
|
|
16
17
|
// guard (`grillhouse <garde>`, scripts/gardes-du-cadre.mjs) names a command that exists.
|
|
17
|
-
// - `tester` plays the tests of
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// (
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
18
|
+
// - `tester` plays the tests of the crates as tasks of Turborepo, the way of the module
|
|
19
|
+
// typescript's (scripts/langages/typescript/tests.mjs): `turbo run test:unit --filter=<crate>…`
|
|
20
|
+
// on the crates of the graph, each one a package with its own `package.json`
|
|
21
|
+
// (scripts/paquet-npm.mjs), the task of a crate whose inputs did not move replayed from
|
|
22
|
+
// Turborepo's cache; the frame selects nothing by the last green. A path, written from the root,
|
|
23
|
+
// chooses the crate that holds it (only its task plays) and reaches the task, made absolute, in
|
|
24
|
+
// the variable `GRILLHOUSE_TESTS` (`TESTS_CIBLES`, scripts/taches-du-graphe.mjs) beside the
|
|
25
|
+
// options, which the `env` of the task names: it enters its hash, so a run by path of a crate
|
|
26
|
+
// unchanged replays from the cache, and another path moves the hash. `--force` carries the moment
|
|
27
|
+
// of the run in the variable instead (`rejouer`), which no cached run holds: the task plays for
|
|
28
|
+
// real (`npm run test:forcer`). A path out of every crate, or in a crate without tests, or in a
|
|
29
|
+
// crate that is no package of the graph, is refused, named, and nothing plays (code 2). The exit
|
|
30
|
+
// code is Turborepo's.
|
|
31
|
+
// - `tests-du-paquet <chemin>…` is the body of that task, which the `test:unit` script of a crate
|
|
32
|
+
// calls (`grillhouse tests-du-paquet <dossier du crate>`, written with the package): it never runs
|
|
33
|
+
// Turborepo, so `tester` and the task do not loop. For a crate that plays tests
|
|
34
|
+
// (./composants.mjs, `joueDesTests`): the build of its test targets, `cargo test --no-run -p
|
|
35
|
+
// <crate>`, a task `build` of its own, as Turborepo's `test` depends on `build` (grillhouse-egm);
|
|
36
|
+
// then `cargo nextest run -p <crate> --no-fail-fast`, which finds them built. Then `cargo test
|
|
37
|
+
// --doc -p <crate>` for a crate whose library has doctests, which nextest does not play. A failed
|
|
38
|
+
// build leaves the crate's other tasks not played (`code` null): a test that does not compile is
|
|
39
|
+
// a red of the build, which the proof of the red reads as one (« construction de <crate> »,
|
|
40
|
+
// scripts/circuit.mjs), and the tests play at the checks. The output of the build goes to its log,
|
|
41
|
+
// `<target>/grillhouse/<crate>-build.log`, the task's `journal` from the root, then to the error
|
|
42
|
+
// stream. The folder of a crate plays it whole; the source of a test target
|
|
43
|
+
// (`<crate>/tests/<nom>.rs`) builds and plays that target alone (`--test <nom>`), without the
|
|
44
|
+
// doctests; the paths of the variable `GRILLHOUSE_TESTS` that lie in the crate replace the folder.
|
|
45
|
+
// A path out of every crate, or in a crate without tests, is refused, named, and nothing plays
|
|
46
|
+
// (code 2). `--force` changes nothing here: cargo keeps no result of a test to replay. Another
|
|
47
|
+
// option goes to nextest.
|
|
33
48
|
// - A test target is named by its file, as `*_nuit_test.py` and `*.budget.test.*` (grillhouse-wbk):
|
|
34
49
|
// `tests/<nom>_nuit.rs` (or `tests/<nom>_nuit/main.rs`, the target `<nom>_nuit`) is a night
|
|
35
50
|
// test, `tests/<nom>_budget.rs` a time budget bench. A crate played whole leaves both out of
|
|
36
51
|
// nextest, in `tester` as in `verifier`, which then plays its library (`--lib`), its binaries
|
|
37
52
|
// (`--bins`) and each other test target (`--test <nom>`); its build still compiles them. The
|
|
38
53
|
// night plays them (`tests-de-nuit`), as the module typescript's `*.budget.test.*`. A path that
|
|
39
|
-
// names the file of
|
|
40
|
-
//
|
|
54
|
+
// names the file of a bench plays it, as Bazel builds a target tagged `manual` when named; a path
|
|
55
|
+
// that names a night test is refused, named, and nothing plays (code 2): the night alone plays
|
|
56
|
+
// it; a folder named leaves them out, as the day does.
|
|
41
57
|
// - A time budget bench plays alone, one test at a time (`--test-threads 1`), in a task `budget` of
|
|
42
58
|
// its own after the other tests: in `tests-de-nuit` and in a path that names it. A red of the
|
|
43
59
|
// task while the CPU pressure of the machine (`lirePression` of ./jointure) is at or above its
|
|
44
60
|
// threshold at its start or at its end is « à repasser », 75, said in one line with the
|
|
45
61
|
// pressure; at rest, a red.
|
|
46
|
-
// - `verifier` plays the tests of the crates
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
// cargo
|
|
62
|
+
// - `verifier` plays the tests of the crates as the tasks of Turborepo (`turbo run test:unit
|
|
63
|
+
// --filter=<crate>…`, each crate a package of the graph, the cache of the tasks selecting those
|
|
64
|
+
// that play again; `--tout` plays them for real, the moment of the pass in the variable
|
|
65
|
+
// `GRILLHOUSE_TESTS`), then `cargo deny check`, the only run of cargo of the pass. It keeps no
|
|
66
|
+
// green: the one pass of the verification keeps it (scripts/dernier-vert.mjs,
|
|
67
|
+
// scripts/langages/typescript/verifier.mjs). Beside the module of package.json, whose pass plays
|
|
68
|
+
// every task of the graph, the composed command sets `GRAPHE_JOUE` and `verifier` plays `cargo
|
|
69
|
+
// deny check` alone (scripts/commandes-composees.mjs). It plays on a place of the machine and under its lock,
|
|
70
|
+
// one heavy measure at a time (`avecLaMachineEtUnePlace` of ./jointure, as the module typescript's verifier): a
|
|
71
|
+
// measure that holds it makes it wait, and the bound of the wait reached, it stops at 75 without
|
|
72
|
+
// running cargo.
|
|
53
73
|
// - `verifier --gardes` plays the guards alone, the same verdict as the module typescript's: the
|
|
54
74
|
// project's root scripts `grillhouse:gardes` (the frame's guards) then `gardes` (its own), each
|
|
55
75
|
// one the package.json holds a task of the root, by npm, without its tests nor cargo deny, and
|
|
56
76
|
// keeps no last green.
|
|
57
|
-
// - `
|
|
77
|
+
// - `tests-du-paquet`, `verifier` and `tests-de-nuit` play under a temporary directory of their pass, the module's guard of
|
|
58
78
|
// the temporary directory, as the CI of osc-bridge (OB-ud1.3): a base (`ouvrirBase` of
|
|
59
79
|
// ./jointure, genre `tests` or `verification`) in the temporary directory of the environment,
|
|
60
80
|
// named in TMPDIR, TMP and TEMP to cargo, which nextest and the doctests inherit; removed at the
|
|
@@ -68,8 +88,8 @@
|
|
|
68
88
|
// - `typer`: `cargo check --all-targets`. `preparer`: `cargo fetch --locked`.
|
|
69
89
|
// - Cargo runs with rustc wrapped by sccache, its cache common to the copies of the machine
|
|
70
90
|
// (./sccache.mjs), in a copy as in an agent's envelope (grillhouse-cyr), its server started
|
|
71
|
-
// under the machine's /tmp before each run of cargo that compiles (grillhouse-qmk).
|
|
72
|
-
// and `typer` refuse, before any run of cargo, a PATH without sccache, in one line that names it
|
|
91
|
+
// under the machine's /tmp before each run of cargo that compiles (grillhouse-qmk).
|
|
92
|
+
// `tests-du-paquet`, `verifier` and `typer` refuse, before any run of cargo, a PATH without sccache, in one line that names it
|
|
73
93
|
// and `npx grillhouse maj`, which installs it (code 2).
|
|
74
94
|
// - Nextest reads the frame's profile `grillhouse` (./nextest.toml, a tool's configuration under
|
|
75
95
|
// the project's own, `--tool-config-file`), whose JUnit report lands in nextest's store, at
|
|
@@ -79,7 +99,7 @@
|
|
|
79
99
|
// there what ./verdict.mjs reads: its tasks, each planned before it plays (`code` null until it
|
|
80
100
|
// ran), and the JUnit report of each run of nextest. A task of the workspace is named after its
|
|
81
101
|
// root, `//`, as Turborepo names the root's tasks.
|
|
82
|
-
// - `
|
|
102
|
+
// - `tests-du-paquet`, `verifier` and `preparer` refuse, before any run of cargo, a workspace whose
|
|
83
103
|
// Cargo.lock git does not track (grillhouse-rph), in one line that names the file and the
|
|
84
104
|
// gesture: `git add Cargo.lock`, or `cargo generate-lockfile` first when it is absent. Cargo
|
|
85
105
|
// recommends committing it for every project, and the verification plays the exact versions of
|
|
@@ -88,6 +108,10 @@
|
|
|
88
108
|
// git, the integration's.
|
|
89
109
|
// - The exit code: 0 when every task is green, 75 when the only reds are « à repasser », 1
|
|
90
110
|
// otherwise; 2 for a path refused, a Cargo.lock not tracked or a command unknown.
|
|
111
|
+
// - `construire --echec <fichier> <plan>` is the launcher's build of the copy (scripts/enveloppe/lancer.sh),
|
|
112
|
+
// the core's one for every language (`construireDepuisLesArguments` of
|
|
113
|
+
// scripts/taches-du-graphe.mjs): the plan and its providers by `turbo run build --filter=<paquet>…`.
|
|
114
|
+
// `construire <chemin>` builds one crate (`cargo build -p`), as the script `build` of its package.
|
|
91
115
|
import { spawnSync } from 'node:child_process';
|
|
92
116
|
import {
|
|
93
117
|
closeSync,
|
|
@@ -95,6 +119,7 @@ import {
|
|
|
95
119
|
existsSync,
|
|
96
120
|
mkdirSync,
|
|
97
121
|
openSync,
|
|
122
|
+
readdirSync,
|
|
98
123
|
readFileSync,
|
|
99
124
|
rmSync,
|
|
100
125
|
writeFileSync,
|
|
@@ -105,36 +130,58 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
105
130
|
import { RESULTATS } from '../../resultats.mjs';
|
|
106
131
|
import {
|
|
107
132
|
AttenteDeLaMachine,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
133
|
+
surUnePlace,
|
|
134
|
+
avecLaMachineEtUnePlace,
|
|
135
|
+
cheminsDeLaTache,
|
|
136
|
+
construireDepuisLesArguments,
|
|
111
137
|
ecrirePression,
|
|
112
|
-
|
|
138
|
+
GRAPHE_JOUE,
|
|
139
|
+
lancerLesTaches,
|
|
113
140
|
ligneDesRestes,
|
|
114
141
|
lirePression,
|
|
115
|
-
|
|
142
|
+
nomDuPaquet,
|
|
116
143
|
ouvrirBase,
|
|
117
144
|
retirerALInterruption,
|
|
145
|
+
SCRIPT_DES_TESTS,
|
|
118
146
|
SEUIL_PRESSION,
|
|
147
|
+
testsCibles,
|
|
148
|
+
travailleursDeLaSeance,
|
|
119
149
|
} from '../../services-du-noyau.mjs';
|
|
120
|
-
import {
|
|
150
|
+
import {
|
|
151
|
+
BANC,
|
|
152
|
+
COPIE_DE_L_ARBRE,
|
|
153
|
+
composantDans,
|
|
154
|
+
crates,
|
|
155
|
+
DE_NUIT,
|
|
156
|
+
joueDesTests,
|
|
157
|
+
metadonnees,
|
|
158
|
+
} from './composants.mjs';
|
|
121
159
|
import { avecSccache, demarrerLeServeur, sccacheAbsent } from './sccache.mjs';
|
|
122
|
-
import { touchesDesFichiers } from './touches.mjs';
|
|
123
160
|
import { JUNIT, TACHES } from './verdict.mjs';
|
|
124
161
|
|
|
125
162
|
const ICI = fileURLToPath(import.meta.url);
|
|
126
163
|
const NEXTEST = path.join(path.dirname(ICI), 'nextest.toml');
|
|
127
164
|
const PROFIL = 'grillhouse';
|
|
128
|
-
export const NOMS = [
|
|
165
|
+
export const NOMS = [
|
|
166
|
+
'tester',
|
|
167
|
+
'tests-du-paquet',
|
|
168
|
+
'verifier',
|
|
169
|
+
'typer',
|
|
170
|
+
'construire',
|
|
171
|
+
'preparer',
|
|
172
|
+
'tests-de-nuit',
|
|
173
|
+
];
|
|
174
|
+
// The task runner of the graph of the packages.
|
|
175
|
+
const OUTIL = 'turbo';
|
|
129
176
|
const A_REPASSER = 75;
|
|
130
177
|
const RACINE = '//';
|
|
131
178
|
// The task of the time budget benches of a crate.
|
|
132
179
|
const BUDGET = 'budget';
|
|
133
180
|
const VERROU = 'Cargo.lock';
|
|
134
181
|
// The commands that play the exact versions of the repository, refused without its Cargo.lock.
|
|
135
|
-
const VERROUILLEES = ['
|
|
182
|
+
const VERROUILLEES = ['tests-du-paquet', 'verifier', 'preparer', 'tests-de-nuit'];
|
|
136
183
|
// The commands that compile, refused without sccache on the PATH (./sccache.mjs).
|
|
137
|
-
const COMPILENT = ['
|
|
184
|
+
const COMPILENT = ['tests-du-paquet', 'verifier', 'typer', 'construire', 'tests-de-nuit'];
|
|
138
185
|
// The kinds of a target that are no library.
|
|
139
186
|
const PAS_UNE_BIBLIOTHEQUE = ['test', 'bin', 'example', 'bench', 'custom-build'];
|
|
140
187
|
|
|
@@ -151,8 +198,21 @@ export function horsDuJour(t) {
|
|
|
151
198
|
}
|
|
152
199
|
return t.name.endsWith(BANC) ? 'banc' : null;
|
|
153
200
|
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Whether the test file <chemin> (from the root <racine>) is a test target out of the day, a night
|
|
204
|
+
* test or a time budget bench (`horsDuJour`); false for any other file, a unit test of `src/`
|
|
205
|
+
* included.
|
|
206
|
+
* @param {string} chemin
|
|
207
|
+
* @param {string} racine
|
|
208
|
+
*/
|
|
209
|
+
export function fichierHorsDuJour(chemin, racine) {
|
|
210
|
+
const abs = path.resolve(racine, chemin);
|
|
211
|
+
const c = crates(racine).find(x => x.cibles.some(t => t.src === abs));
|
|
212
|
+
return Boolean(c?.cibles.some(t => t.src === abs && horsDuJour(t) !== null));
|
|
213
|
+
}
|
|
154
214
|
// The subcommands of cargo that compile, before which the server of sccache starts.
|
|
155
|
-
const COMPILATIONS = ['test', 'nextest', 'check'];
|
|
215
|
+
const COMPILATIONS = ['test', 'nextest', 'check', 'build'];
|
|
156
216
|
|
|
157
217
|
/** The guards of structure of the module, in the order they play: each its name, its script beside
|
|
158
218
|
* this one, and its arguments as a guard. */
|
|
@@ -226,7 +286,10 @@ function passe(racine, env) {
|
|
|
226
286
|
ecrire();
|
|
227
287
|
return { t, args };
|
|
228
288
|
},
|
|
229
|
-
jouer(
|
|
289
|
+
jouer(
|
|
290
|
+
{ t, args },
|
|
291
|
+
{ junit = null, journal = null, programme = 'cargo', temporaire = {} } = {}
|
|
292
|
+
) {
|
|
230
293
|
// A report of an earlier run is no report of this one, which may write none.
|
|
231
294
|
if (junit) {
|
|
232
295
|
rmSync(junit, { force: true });
|
|
@@ -246,7 +309,7 @@ function passe(racine, env) {
|
|
|
246
309
|
try {
|
|
247
310
|
r = spawnSync(programme, args, {
|
|
248
311
|
cwd: racine,
|
|
249
|
-
env: compilation,
|
|
312
|
+
env: { ...compilation, ...temporaire },
|
|
250
313
|
stdio: ['inherit', fd, fd],
|
|
251
314
|
});
|
|
252
315
|
} finally {
|
|
@@ -255,7 +318,11 @@ function passe(racine, env) {
|
|
|
255
318
|
process.stderr.write(readFileSync(journal, 'utf8'));
|
|
256
319
|
t.journal = path.relative(racine, journal);
|
|
257
320
|
} else {
|
|
258
|
-
r = spawnSync(programme, args, {
|
|
321
|
+
r = spawnSync(programme, args, {
|
|
322
|
+
cwd: racine,
|
|
323
|
+
env: { ...compilation, ...temporaire },
|
|
324
|
+
stdio: 'inherit',
|
|
325
|
+
});
|
|
259
326
|
}
|
|
260
327
|
t.code = r.error ? 127 : (r.status ?? 128 + (constants.signals[r.signal] ?? 0));
|
|
261
328
|
if (junit && dossier && existsSync(junit)) {
|
|
@@ -269,6 +336,15 @@ function passe(racine, env) {
|
|
|
269
336
|
ecrire();
|
|
270
337
|
return t.code;
|
|
271
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
|
+
},
|
|
272
348
|
code() {
|
|
273
349
|
const rouges = taches.filter(t => t.code !== 0);
|
|
274
350
|
if (rouges.length === 0) {
|
|
@@ -298,37 +374,34 @@ function sousCharge(t, pressions) {
|
|
|
298
374
|
t.code = A_REPASSER;
|
|
299
375
|
}
|
|
300
376
|
|
|
301
|
-
// The crates the changes since the last green of <racine> touch, and their dependents; every crate
|
|
302
|
-
// with <tout> or without a last green that counts. `{ choix, m }`, `m` the measure.
|
|
303
|
-
function depuisLeVert(racine, tous, tout, env) {
|
|
304
|
-
const m = mesure(racine, { tout, dans: env.TMPDIR });
|
|
305
|
-
process.stderr.write(`${m.ligne}\n`);
|
|
306
|
-
const f = m.env[CHANGEMENTS];
|
|
307
|
-
if (!f) {
|
|
308
|
-
return { choix: tous, m };
|
|
309
|
-
}
|
|
310
|
-
const ch = JSON.parse(readFileSync(f, 'utf8'));
|
|
311
|
-
const t = touchesDesFichiers(racine, [...ch.fichiers, ...ch.supprimes]);
|
|
312
|
-
const nommes = new Set([...t.touches, ...t.dependants].map(c => c.dossier));
|
|
313
|
-
return { choix: tous.filter(c => nommes.has(c.composant.dossier)), m };
|
|
314
|
-
}
|
|
315
|
-
|
|
316
377
|
// Plans and plays the tests of the crates <choix> in the run <p>, each `{ c, cibles }`: `cibles`
|
|
317
378
|
// the test targets named, empty for the whole crate of the day (its night tests and its benches
|
|
318
379
|
// left out). For a crate that plays tests:
|
|
319
380
|
// the build of its test targets first, then nextest, then its doctests; a failed build leaves the
|
|
320
381
|
// crate's other tasks not played. The benches named, each crate's in a task `budget`, are
|
|
321
382
|
// planned with the rest and played by the function this one returns, after the other tests.
|
|
322
|
-
function jouerLesTests(racine, p, choix, options) {
|
|
383
|
+
function jouerLesTests(racine, p, choix, options, temporaire = () => ({})) {
|
|
323
384
|
const m = metadonnees(racine);
|
|
324
385
|
// Nextest's store is `target/nextest` under the workspace's root (its default `store.dir`),
|
|
325
386
|
// whatever the target directory of the compilations (./sccache.mjs).
|
|
326
387
|
const junit = path.join(m.workspace_root, 'target', 'nextest', PROFIL, 'junit.xml');
|
|
327
388
|
const nextest = ['nextest', 'run', '--tool-config-file', `${PROFIL}:${NEXTEST}`];
|
|
328
389
|
nextest.push('--profile', PROFIL, '--no-fail-fast');
|
|
390
|
+
// The workers of a session of an agent (GRILLHOUSE_TRAVAILLEURS): `-j` of cargo and of nextest;
|
|
391
|
+
// a heavy pass, without it, keeps every core.
|
|
392
|
+
const travailleurs = travailleursDeLaSeance(process.env);
|
|
393
|
+
const j = travailleurs === null ? [] : ['-j', String(travailleurs)];
|
|
394
|
+
// A bench plays on one thread (`--test-threads 1`, which `-j` of nextest is the alias of): it
|
|
395
|
+
// takes the arguments without `-j`.
|
|
396
|
+
const nextestDuBanc = [...nextest];
|
|
397
|
+
nextest.push(...j);
|
|
329
398
|
const parCrate = [];
|
|
330
399
|
const bancs = [];
|
|
331
|
-
for (const { c, cibles } of choix) {
|
|
400
|
+
for (const { c, cibles: nommees, jour } of choix) {
|
|
401
|
+
// Targets named beside the day of the crate (`jour`, a unit test of `src/` named): the day
|
|
402
|
+
// builds whole, and plays besides the targets named.
|
|
403
|
+
const cibles = jour && nommees.length === 0 ? [] : nommees;
|
|
404
|
+
const avecLeJour = Boolean(jour) && nommees.length > 0;
|
|
332
405
|
Object.assign(p.cibles, binaires(c));
|
|
333
406
|
const d = c.composant.dossier;
|
|
334
407
|
const nom = c.composant.nom;
|
|
@@ -340,26 +413,54 @@ function jouerLesTests(racine, p, choix, options) {
|
|
|
340
413
|
const desBancs = cibles.filter(deBanc);
|
|
341
414
|
const autres = cibles.filter(n => !deBanc(n));
|
|
342
415
|
const journal = path.join(m.target_directory, 'grillhouse', `${nom}-build.log`);
|
|
343
|
-
const construction = [
|
|
416
|
+
const construction = [
|
|
417
|
+
'test',
|
|
418
|
+
'--no-run',
|
|
419
|
+
...j,
|
|
420
|
+
'-p',
|
|
421
|
+
nom,
|
|
422
|
+
...(avecLeJour ? [] : cibles.flatMap(n => ['--test', n])),
|
|
423
|
+
];
|
|
344
424
|
prevues.push([p.prevoir(nom, d, 'build', false, construction), { journal }]);
|
|
345
|
-
if (cibles.length === 0 || autres.length) {
|
|
346
|
-
const
|
|
425
|
+
if (cibles.length === 0 || autres.length || avecLeJour) {
|
|
426
|
+
const duC = duJour(c);
|
|
427
|
+
const nommes = autres.flatMap(n => ['--test', n]);
|
|
428
|
+
const selection = !cibles.length
|
|
429
|
+
? duC
|
|
430
|
+
: avecLeJour
|
|
431
|
+
? duC.length
|
|
432
|
+
? [...duC, ...nommes]
|
|
433
|
+
: []
|
|
434
|
+
: nommes;
|
|
347
435
|
const args = [...nextest, '-p', nom, ...selection, ...options];
|
|
348
|
-
prevues.push([
|
|
436
|
+
prevues.push([
|
|
437
|
+
p.prevoir(nom, d, 'nextest', true, args),
|
|
438
|
+
{ junit, temporaire: temporaire(nom) },
|
|
439
|
+
]);
|
|
349
440
|
}
|
|
350
441
|
if (desBancs.length) {
|
|
351
|
-
const args = [...
|
|
352
|
-
bancs.push({
|
|
442
|
+
const args = [...nextestDuBanc, '-p', nom, ...desBancs.flatMap(n => ['--test', n])];
|
|
443
|
+
bancs.push({
|
|
444
|
+
nom,
|
|
445
|
+
d,
|
|
446
|
+
temporaire: temporaire(nom),
|
|
447
|
+
args: [...args, '--test-threads', '1', ...options],
|
|
448
|
+
etat,
|
|
449
|
+
});
|
|
353
450
|
}
|
|
354
451
|
}
|
|
355
452
|
const doctests = c.cibles.some(t => t.kind.includes('lib') && t.doctest !== false);
|
|
356
|
-
if (cibles.length === 0 && doctests) {
|
|
357
|
-
const args = ['test', '--doc', '-p', nom];
|
|
358
|
-
prevues.push([p.prevoir(nom, d, 'doctest', true, args), {}]);
|
|
453
|
+
if ((cibles.length === 0 || avecLeJour) && doctests) {
|
|
454
|
+
const args = ['test', '--doc', ...j, '-p', nom];
|
|
455
|
+
prevues.push([p.prevoir(nom, d, 'doctest', true, args), { temporaire: temporaire(nom) }]);
|
|
359
456
|
}
|
|
360
457
|
parCrate.push([prevues, etat]);
|
|
361
458
|
}
|
|
362
|
-
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
|
+
]);
|
|
363
464
|
for (const [prevues, etat] of parCrate) {
|
|
364
465
|
for (const [t, o] of prevues) {
|
|
365
466
|
if (p.jouer(t, o) !== 0 && t.t.script === 'build') {
|
|
@@ -369,9 +470,9 @@ function jouerLesTests(racine, p, choix, options) {
|
|
|
369
470
|
}
|
|
370
471
|
}
|
|
371
472
|
return () => {
|
|
372
|
-
for (const [t, etat] of prevusBancs) {
|
|
473
|
+
for (const [t, etat, temporaire] of prevusBancs) {
|
|
373
474
|
if (etat.construit) {
|
|
374
|
-
p.jouer(t, { junit });
|
|
475
|
+
p.jouer(t, { junit, temporaire });
|
|
375
476
|
}
|
|
376
477
|
}
|
|
377
478
|
};
|
|
@@ -393,6 +494,9 @@ function duJour(c) {
|
|
|
393
494
|
];
|
|
394
495
|
}
|
|
395
496
|
|
|
497
|
+
// The refusal of a night test named in a targeted run: the night alone plays it.
|
|
498
|
+
const REFUS_DE_NUIT = 'un test de nuit se joue la nuit seulement (npx grillhouse nuit le joue)';
|
|
499
|
+
|
|
396
500
|
// The crates the paths <chemins> choose in <racine>: `{ choix }`, or `{ refus }` naming each path
|
|
397
501
|
// refused.
|
|
398
502
|
function choisir(racine, tous, chemins) {
|
|
@@ -410,18 +514,27 @@ function choisir(racine, tous, chemins) {
|
|
|
410
514
|
refus.push(`${chemin} : hors de tout crate`);
|
|
411
515
|
continue;
|
|
412
516
|
}
|
|
413
|
-
|
|
517
|
+
// The folder of a crate without tests plays whole (its doctests, as the task of its package
|
|
518
|
+
// does); any other path in it names a test that does not exist.
|
|
519
|
+
if (!joueDesTests(racine, c) && abs !== c.dossier) {
|
|
414
520
|
refus.push(`${chemin} : ${c.nom} n'a aucun test, ni dossier tests/, ni tests.rs sous src/`);
|
|
415
521
|
continue;
|
|
416
522
|
}
|
|
417
523
|
const cible = crate.cibles.find(t => t.kind.includes('test') && t.src === abs);
|
|
524
|
+
// A night test plays at night alone (`tests-de-nuit`): a targeted run refuses it, named.
|
|
525
|
+
if (cible && horsDuJour(cible) === 'nuit') {
|
|
526
|
+
refus.push(`${chemin} : ${REFUS_DE_NUIT}`);
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
418
529
|
const deja = parDossier.get(c.dossier);
|
|
530
|
+
// A file with no target of its own (a unit test of `src/`) asks for the day of its crate; a
|
|
531
|
+
// target named stays named, whatever the order of the paths.
|
|
532
|
+
const entree = deja ?? { c: crate, cibles: [], jour: false };
|
|
533
|
+
parDossier.set(c.dossier, entree);
|
|
419
534
|
if (!cible) {
|
|
420
|
-
|
|
421
|
-
} else
|
|
422
|
-
|
|
423
|
-
} else if (deja.cibles.length) {
|
|
424
|
-
deja.cibles.push(cible.name);
|
|
535
|
+
entree.jour = true;
|
|
536
|
+
} else {
|
|
537
|
+
entree.cibles.push(cible.name);
|
|
425
538
|
}
|
|
426
539
|
}
|
|
427
540
|
if (refus.length) {
|
|
@@ -434,32 +547,57 @@ function choisir(racine, tous, chemins) {
|
|
|
434
547
|
};
|
|
435
548
|
}
|
|
436
549
|
|
|
550
|
+
// The packages of the graph of the crates <crates>: `{ noms, absents }`, the names of those that are
|
|
551
|
+
// packages of the graph, and the names of the crates that are not.
|
|
552
|
+
function nomsDuGraphe(racine, crates) {
|
|
553
|
+
const noms = new Set();
|
|
554
|
+
const absents = [];
|
|
555
|
+
for (const c of crates) {
|
|
556
|
+
const nom = nomDuPaquet(racine, c.composant.dossier);
|
|
557
|
+
if (nom === null) {
|
|
558
|
+
absents.push(c.composant.nom);
|
|
559
|
+
} else {
|
|
560
|
+
noms.add(nom);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return { noms, absents };
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// Says, on the error stream, each crate of <absents> that is no package of the graph: its tests do
|
|
567
|
+
// not play, as a package without a `package.json` is out of Turborepo's tasks.
|
|
568
|
+
function direLesAbsents(absents) {
|
|
569
|
+
for (const nom of absents) {
|
|
570
|
+
process.stderr.write(
|
|
571
|
+
`⚠️ ${nom} : pas un paquet du graphe (package.json absent) ; ses tests ne se jouent pas : npx grillhouse maj\n`
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
437
576
|
// The pass of `verifier` in <racine>, under the lock of the machine (<env> carries its mark): the
|
|
438
|
-
// tests of the crates
|
|
439
|
-
//
|
|
577
|
+
// tests of the crates as tasks of Turborepo (every one played for real with <args> `--tout`), then
|
|
578
|
+
// cargo deny. It keeps no green.
|
|
440
579
|
function verifier(racine, args, env) {
|
|
441
580
|
const p = passe(racine, env);
|
|
442
581
|
if (args.includes('--gardes')) {
|
|
443
582
|
return gardes(racine, p);
|
|
444
583
|
}
|
|
445
|
-
|
|
446
|
-
const {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
584
|
+
// Beside the module of package.json (composed command), its pass has played the tasks.
|
|
585
|
+
const { noms, absents } = env[GRAPHE_JOUE]
|
|
586
|
+
? { noms: new Set(), absents: [] }
|
|
587
|
+
: nomsDuGraphe(racine, crates(racine));
|
|
588
|
+
direLesAbsents(absents);
|
|
589
|
+
const code = noms.size
|
|
590
|
+
? lancerLesTaches({
|
|
591
|
+
outil: OUTIL,
|
|
592
|
+
racine,
|
|
593
|
+
taches: [SCRIPT_DES_TESTS],
|
|
594
|
+
noms,
|
|
595
|
+
tests: testsCibles({ arguments: [], force: args.includes('--tout') }),
|
|
596
|
+
env,
|
|
597
|
+
})
|
|
598
|
+
: 0;
|
|
599
|
+
p.jouer(p.prevoir(RACINE, racine, 'deny', false, ['deny', 'check']));
|
|
600
|
+
return code === 0 ? p.code() : 1;
|
|
463
601
|
}
|
|
464
602
|
|
|
465
603
|
// The scripts of guards of the project, in the order they play, as the module typescript's
|
|
@@ -489,12 +627,38 @@ const CACHE_DE_NODE = 'node-compile-cache';
|
|
|
489
627
|
// Plays <jouer>(env) under the base of a pass of <genre> in the temporary directory of <env>,
|
|
490
628
|
// named to cargo in TMPDIR, TMP and TEMP: its code, 1 when the tests left something there, named.
|
|
491
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.
|
|
492
635
|
function sousLaBase(genre, env, jouer) {
|
|
493
636
|
const base = ouvrirBase(genre, { dans: env.TMPDIR || tmpdir() });
|
|
494
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
|
+
};
|
|
495
657
|
try {
|
|
496
|
-
const code = jouer({ ...env, ...base.env });
|
|
497
|
-
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
|
+
);
|
|
498
662
|
if (!ligne) {
|
|
499
663
|
return code;
|
|
500
664
|
}
|
|
@@ -508,16 +672,18 @@ function sousLaBase(genre, env, jouer) {
|
|
|
508
672
|
|
|
509
673
|
/**
|
|
510
674
|
* The line that refuses the workspace at <racine> whose Cargo.lock git does not track, the
|
|
511
|
-
* gesture named; null when git tracks it.
|
|
675
|
+
* gesture named; null when git tracks it. <copie> is the root git reads (a tree of HEAD's version
|
|
676
|
+
* has no `.git`: its copy's, where the same file is tracked).
|
|
512
677
|
* @param {string} racine
|
|
678
|
+
* @param {string} [copie]
|
|
513
679
|
* @returns {string | null}
|
|
514
680
|
*/
|
|
515
|
-
export function verrouNonVersionne(racine) {
|
|
681
|
+
export function verrouNonVersionne(racine, copie = racine) {
|
|
516
682
|
if (!existsSync(path.join(racine, VERROU))) {
|
|
517
683
|
return `⛔ ${VERROU} absent : cargo generate-lockfile, puis git add ${VERROU}`;
|
|
518
684
|
}
|
|
519
685
|
const r = spawnSync('git', ['ls-files', '--error-unmatch', '--', VERROU], {
|
|
520
|
-
cwd:
|
|
686
|
+
cwd: copie,
|
|
521
687
|
stdio: 'ignore',
|
|
522
688
|
});
|
|
523
689
|
return r.status === 0 ? null : `⛔ ${VERROU} non versionné : git add ${VERROU}`;
|
|
@@ -530,14 +696,40 @@ export function verrouNonVersionne(racine) {
|
|
|
530
696
|
* @param {{ racine?: string, env?: NodeJS.ProcessEnv }} [o]
|
|
531
697
|
*/
|
|
532
698
|
export function lancer(nom, args, { racine = process.cwd(), env = process.env } = {}) {
|
|
699
|
+
// `construire` and `typer` with a path: the one crate of that folder (`cargo build -p`,
|
|
700
|
+
// `cargo check -p`), as Turborepo's task of one package; `typer` alone checks the workspace.
|
|
701
|
+
let crate = null;
|
|
702
|
+
// The launcher's `construire` (`--echec <fichier> <plan>`, scripts/enveloppe/lancer.sh) builds
|
|
703
|
+
// the copy for a session, the plan and its providers, as every language's.
|
|
704
|
+
if (nom === 'construire' && args.includes('--echec')) {
|
|
705
|
+
return construireDepuisLesArguments(OUTIL, args, racine);
|
|
706
|
+
}
|
|
707
|
+
if (nom === 'construire' || (nom === 'typer' && args.length)) {
|
|
708
|
+
const [chemin, ...autres] = args;
|
|
709
|
+
const abs = chemin === undefined ? null : path.resolve(racine, chemin);
|
|
710
|
+
crate = abs === null ? undefined : crates(racine).find(x => x.composant.dossier === abs);
|
|
711
|
+
if (!crate || autres.length) {
|
|
712
|
+
process.stderr.write(
|
|
713
|
+
`⛔ ${nom} : ${chemin ?? 'aucun chemin'} ne désigne pas un crate (un dossier de crate, une fois).\n`
|
|
714
|
+
);
|
|
715
|
+
return 2;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
533
718
|
const refus =
|
|
534
|
-
(VERROUILLEES.includes(nom)
|
|
535
|
-
|
|
719
|
+
(VERROUILLEES.includes(nom)
|
|
720
|
+
? verrouNonVersionne(racine, env[COPIE_DE_L_ARBRE] || racine)
|
|
721
|
+
: null) ?? (COMPILENT.includes(nom) ? sccacheAbsent(racine, env) : null);
|
|
536
722
|
if (refus) {
|
|
537
723
|
process.stderr.write(`${refus}\n`);
|
|
538
724
|
return 2;
|
|
539
725
|
}
|
|
540
726
|
const p = passe(racine, env);
|
|
727
|
+
if (crate) {
|
|
728
|
+
const sous = nom === 'construire' ? 'build' : 'check';
|
|
729
|
+
const nomDuCrate = crate.composant.nom;
|
|
730
|
+
p.jouer(p.prevoir(nomDuCrate, crate.composant.dossier, sous, false, [sous, '-p', nomDuCrate]));
|
|
731
|
+
return p.code();
|
|
732
|
+
}
|
|
541
733
|
if (nom === 'typer') {
|
|
542
734
|
p.jouer(p.prevoir(RACINE, racine, 'check', false, ['check', '--all-targets']));
|
|
543
735
|
return p.code();
|
|
@@ -550,7 +742,7 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
550
742
|
const dire = l => process.stdout.write(`${l}\n`);
|
|
551
743
|
try {
|
|
552
744
|
return sousLaBase('verification', env, envBase =>
|
|
553
|
-
|
|
745
|
+
avecLaMachineEtUnePlace(envMachine => verifier(racine, args, envMachine), {
|
|
554
746
|
env: envBase,
|
|
555
747
|
racine,
|
|
556
748
|
dire,
|
|
@@ -566,22 +758,27 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
566
758
|
}
|
|
567
759
|
const tous = crates(racine);
|
|
568
760
|
if (nom === 'tester') {
|
|
569
|
-
return
|
|
761
|
+
return surUnePlace(e => tester(racine, tous, args, e), { env });
|
|
762
|
+
}
|
|
763
|
+
if (nom === 'tests-du-paquet') {
|
|
764
|
+
return sousLaBase('tests', env, (envBase, pp) =>
|
|
765
|
+
testsDuPaquet(racine, tous, args, envBase, pp)
|
|
766
|
+
);
|
|
570
767
|
}
|
|
571
768
|
if (nom === 'tests-de-nuit') {
|
|
572
|
-
return sousLaBase('tests', env, envBase => testsDeNuit(racine, tous, envBase));
|
|
769
|
+
return sousLaBase('tests', env, (envBase, pp) => testsDeNuit(racine, tous, envBase, pp));
|
|
573
770
|
}
|
|
574
771
|
process.stderr.write(`⛔ commande inconnue du module cargo : ${nom} (${NOMS.join(', ')})\n`);
|
|
575
772
|
return 2;
|
|
576
773
|
}
|
|
577
774
|
|
|
578
|
-
// The pass of `tester` in <racine>, the crates <tous>, its arguments <args>, under <env
|
|
775
|
+
// The pass of `tester` in <racine>, the crates <tous>, its arguments <args>, under <env>: the tasks
|
|
776
|
+
// `test:unit` of the crates the paths choose (every crate without a path) as Turborepo's, the
|
|
777
|
+
// exit code its.
|
|
579
778
|
function tester(racine, tous, args, env) {
|
|
580
|
-
const p = passe(racine, env);
|
|
581
779
|
const chemins = args.filter(a => !a.startsWith('-'));
|
|
582
780
|
const options = args.filter(a => a.startsWith('-') && a !== '--force');
|
|
583
|
-
let
|
|
584
|
-
let m = null;
|
|
781
|
+
let choisis = tous;
|
|
585
782
|
if (chemins.length) {
|
|
586
783
|
const r = choisir(racine, tous, chemins);
|
|
587
784
|
if (r.refus) {
|
|
@@ -590,31 +787,93 @@ function tester(racine, tous, args, env) {
|
|
|
590
787
|
}
|
|
591
788
|
return 2;
|
|
592
789
|
}
|
|
593
|
-
|
|
594
|
-
} else if (env[DEPUIS_LE_VERT]) {
|
|
595
|
-
({ choix, m } = depuisLeVert(racine, tous, args.includes('--force'), env));
|
|
596
|
-
choix = choix.map(c => ({ c, cibles: [] }));
|
|
597
|
-
} else {
|
|
598
|
-
choix = tous.map(c => ({ c, cibles: [] }));
|
|
790
|
+
choisis = r.choix.map(x => x.c);
|
|
599
791
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
792
|
+
const { noms, absents } = nomsDuGraphe(racine, choisis);
|
|
793
|
+
if (chemins.length && absents.length) {
|
|
794
|
+
process.stderr.write(
|
|
795
|
+
`⛔ ${absents.join(', ')} : pas un paquet du graphe (package.json absent) : npx grillhouse maj\n`
|
|
796
|
+
);
|
|
797
|
+
return 2;
|
|
798
|
+
}
|
|
799
|
+
direLesAbsents(absents);
|
|
800
|
+
if (noms.size === 0) {
|
|
801
|
+
return 0;
|
|
802
|
+
}
|
|
803
|
+
return lancerLesTaches({
|
|
804
|
+
outil: OUTIL,
|
|
805
|
+
racine,
|
|
806
|
+
taches: [SCRIPT_DES_TESTS],
|
|
807
|
+
noms,
|
|
808
|
+
tests: testsCibles({
|
|
809
|
+
arguments: [...chemins.map(c => path.resolve(racine, c)), ...options],
|
|
810
|
+
force: args.includes('--force'),
|
|
811
|
+
}),
|
|
812
|
+
env,
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// The pass of `tests-du-paquet` in <racine>, the crates <tous>, its arguments <args>, under <env>:
|
|
817
|
+
// the body of the task `test:unit` of a crate. The paths its script names, completed by those of
|
|
818
|
+
// the variable of the task that lie in the same crate.
|
|
819
|
+
function testsDuPaquet(racine, tous, args, env, parPaquet) {
|
|
820
|
+
const donnes = args.filter(a => !a.startsWith('-'));
|
|
821
|
+
if (donnes.length === 0) {
|
|
822
|
+
process.stderr.write(
|
|
823
|
+
'⛔ tests-du-paquet : aucun chemin (un dossier de crate, ou un fichier de test).\n'
|
|
824
|
+
);
|
|
825
|
+
return 2;
|
|
604
826
|
}
|
|
827
|
+
const dossierDe = abs =>
|
|
828
|
+
composantDans(
|
|
829
|
+
tous.map(x => x.composant),
|
|
830
|
+
racine,
|
|
831
|
+
abs
|
|
832
|
+
)?.dossier ?? null;
|
|
833
|
+
const { chemins, options } = cheminsDeLaTache({ racine, donnes, env, dossierDe });
|
|
834
|
+
const r = choisir(racine, tous, chemins);
|
|
835
|
+
if (r.refus) {
|
|
836
|
+
for (const l of r.refus) {
|
|
837
|
+
process.stderr.write(`⛔ ${l}\n`);
|
|
838
|
+
}
|
|
839
|
+
return 2;
|
|
840
|
+
}
|
|
841
|
+
const p = passe(racine, env);
|
|
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);
|
|
605
850
|
return p.code();
|
|
606
851
|
}
|
|
607
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
|
+
|
|
608
866
|
// The pass of `tests-de-nuit` in <racine>, the crates <tous>, under <env>: the night tests and the
|
|
609
867
|
// benches of each crate that holds some, each named.
|
|
610
|
-
function testsDeNuit(racine, tous, env) {
|
|
868
|
+
function testsDeNuit(racine, tous, env, parPaquet) {
|
|
611
869
|
const p = passe(racine, env);
|
|
612
870
|
const choix = tous
|
|
613
871
|
.filter(c => joueDesTests(racine, c.composant))
|
|
614
872
|
.map(c => ({ c, cibles: c.cibles.filter(horsDuJour).map(t => t.name) }))
|
|
615
873
|
.filter(x => x.cibles.length);
|
|
616
874
|
if (choix.length) {
|
|
617
|
-
jouerLesTests(racine, p, choix, [])();
|
|
875
|
+
jouerLesTests(racine, p, choix, [], parPaquet.temporaire)();
|
|
876
|
+
restesParPaquet(p, choix, parPaquet);
|
|
618
877
|
}
|
|
619
878
|
return p.code();
|
|
620
879
|
}
|