@roomi-fields/grillhouse 0.29.0 → 0.30.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 +739 -0
- 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 +24 -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 +95 -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 +124 -0
- package/dist/temporal/installation.js +408 -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 +609 -80
- package/docs/CADRE.md +17 -0
- package/docs/INTERFACE.md +134 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2182 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +7 -3
- package/scripts/avancement.mjs +128 -16
- package/scripts/bilan.mjs +37 -19
- package/scripts/cadre.mjs +11 -2
- package/scripts/circuit.mjs +881 -4059
- 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/composition-des-langages.mjs +16 -12
- package/scripts/conformite.mjs +6 -13
- 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 +115 -0
- package/scripts/dernier-vert.mjs +7 -15
- package/scripts/donnees-cles.mjs +228 -0
- package/scripts/droits.mjs +11 -1
- package/scripts/effets.mjs +352 -0
- package/scripts/enveloppe/enveloppe.mjs +119 -8
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +5 -1
- 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 +187 -0
- package/scripts/gardes-du-cadre.mjs +12 -2
- package/scripts/integration/file.mjs +475 -420
- package/scripts/integration/integrer.mjs +17 -19
- package/scripts/integration/rejeu.mjs +19 -4
- package/scripts/jointure.d.ts +145 -27
- package/scripts/langages/cargo/commandes.mjs +289 -109
- package/scripts/langages/cargo/composants.mjs +130 -34
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +18 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/python/commandes.mjs +216 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +24 -8
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +1 -1
- package/scripts/langages/typescript/index.mjs +43 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
- 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 +31 -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/tailles-des-tests.mjs +40 -9
- package/scripts/langages/typescript/tests-de-nuit.mjs +12 -9
- package/scripts/langages/typescript/tests.mjs +17 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
- package/scripts/langages/typescript/verdict.mjs +1 -1
- package/scripts/langages/typescript/verifier.mjs +31 -11
- package/scripts/langages/typescript/vitest-config/base.mjs +22 -1
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +49 -63
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +3 -0
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/mesure/pression.mjs +3 -3
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +10 -3
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +0 -1
- package/scripts/paquet-npm.mjs +147 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +34 -6
- package/scripts/passe-de-la-machine.mjs +66 -0
- package/scripts/places-de-la-machine.mjs +360 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +10 -3
- package/scripts/registre.mjs +3 -2
- 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/resultats.mjs +7 -9
- 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 +918 -0
- package/scripts/services-du-noyau.mjs +26 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +38 -9
- package/scripts/style-a-l-ecriture.mjs +229 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +148 -110
- package/scripts/taches-du-graphe.mjs +328 -0
- package/scripts/ticket-du-circuit.mjs +206 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +901 -0
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrou-de-machine.mjs +28 -13
- package/skills/explorateur/SKILL.md +2 -1
- 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 +4 -2
- package/skills/testwriter/SKILL.md +36 -24
- 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,
|
|
@@ -105,36 +129,58 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
105
129
|
import { RESULTATS } from '../../resultats.mjs';
|
|
106
130
|
import {
|
|
107
131
|
AttenteDeLaMachine,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
132
|
+
surUnePlace,
|
|
133
|
+
avecLaMachineEtUnePlace,
|
|
134
|
+
cheminsDeLaTache,
|
|
135
|
+
construireDepuisLesArguments,
|
|
111
136
|
ecrirePression,
|
|
112
|
-
|
|
137
|
+
GRAPHE_JOUE,
|
|
138
|
+
lancerLesTaches,
|
|
113
139
|
ligneDesRestes,
|
|
114
140
|
lirePression,
|
|
115
|
-
|
|
141
|
+
nomDuPaquet,
|
|
116
142
|
ouvrirBase,
|
|
117
143
|
retirerALInterruption,
|
|
144
|
+
SCRIPT_DES_TESTS,
|
|
118
145
|
SEUIL_PRESSION,
|
|
146
|
+
testsCibles,
|
|
147
|
+
travailleursDeLaSeance,
|
|
119
148
|
} from '../../services-du-noyau.mjs';
|
|
120
|
-
import {
|
|
149
|
+
import {
|
|
150
|
+
BANC,
|
|
151
|
+
COPIE_DE_L_ARBRE,
|
|
152
|
+
composantDans,
|
|
153
|
+
crates,
|
|
154
|
+
DE_NUIT,
|
|
155
|
+
joueDesTests,
|
|
156
|
+
metadonnees,
|
|
157
|
+
} from './composants.mjs';
|
|
121
158
|
import { avecSccache, demarrerLeServeur, sccacheAbsent } from './sccache.mjs';
|
|
122
|
-
import { touchesDesFichiers } from './touches.mjs';
|
|
123
159
|
import { JUNIT, TACHES } from './verdict.mjs';
|
|
124
160
|
|
|
125
161
|
const ICI = fileURLToPath(import.meta.url);
|
|
126
162
|
const NEXTEST = path.join(path.dirname(ICI), 'nextest.toml');
|
|
127
163
|
const PROFIL = 'grillhouse';
|
|
128
|
-
export const NOMS = [
|
|
164
|
+
export const NOMS = [
|
|
165
|
+
'tester',
|
|
166
|
+
'tests-du-paquet',
|
|
167
|
+
'verifier',
|
|
168
|
+
'typer',
|
|
169
|
+
'construire',
|
|
170
|
+
'preparer',
|
|
171
|
+
'tests-de-nuit',
|
|
172
|
+
];
|
|
173
|
+
// The task runner of the graph of the packages.
|
|
174
|
+
const OUTIL = 'turbo';
|
|
129
175
|
const A_REPASSER = 75;
|
|
130
176
|
const RACINE = '//';
|
|
131
177
|
// The task of the time budget benches of a crate.
|
|
132
178
|
const BUDGET = 'budget';
|
|
133
179
|
const VERROU = 'Cargo.lock';
|
|
134
180
|
// The commands that play the exact versions of the repository, refused without its Cargo.lock.
|
|
135
|
-
const VERROUILLEES = ['
|
|
181
|
+
const VERROUILLEES = ['tests-du-paquet', 'verifier', 'preparer', 'tests-de-nuit'];
|
|
136
182
|
// The commands that compile, refused without sccache on the PATH (./sccache.mjs).
|
|
137
|
-
const COMPILENT = ['
|
|
183
|
+
const COMPILENT = ['tests-du-paquet', 'verifier', 'typer', 'construire', 'tests-de-nuit'];
|
|
138
184
|
// The kinds of a target that are no library.
|
|
139
185
|
const PAS_UNE_BIBLIOTHEQUE = ['test', 'bin', 'example', 'bench', 'custom-build'];
|
|
140
186
|
|
|
@@ -151,8 +197,21 @@ export function horsDuJour(t) {
|
|
|
151
197
|
}
|
|
152
198
|
return t.name.endsWith(BANC) ? 'banc' : null;
|
|
153
199
|
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Whether the test file <chemin> (from the root <racine>) is a test target out of the day, a night
|
|
203
|
+
* test or a time budget bench (`horsDuJour`); false for any other file, a unit test of `src/`
|
|
204
|
+
* included.
|
|
205
|
+
* @param {string} chemin
|
|
206
|
+
* @param {string} racine
|
|
207
|
+
*/
|
|
208
|
+
export function fichierHorsDuJour(chemin, racine) {
|
|
209
|
+
const abs = path.resolve(racine, chemin);
|
|
210
|
+
const c = crates(racine).find(x => x.cibles.some(t => t.src === abs));
|
|
211
|
+
return Boolean(c?.cibles.some(t => t.src === abs && horsDuJour(t) !== null));
|
|
212
|
+
}
|
|
154
213
|
// The subcommands of cargo that compile, before which the server of sccache starts.
|
|
155
|
-
const COMPILATIONS = ['test', 'nextest', 'check'];
|
|
214
|
+
const COMPILATIONS = ['test', 'nextest', 'check', 'build'];
|
|
156
215
|
|
|
157
216
|
/** The guards of structure of the module, in the order they play: each its name, its script beside
|
|
158
217
|
* this one, and its arguments as a guard. */
|
|
@@ -298,21 +357,6 @@ function sousCharge(t, pressions) {
|
|
|
298
357
|
t.code = A_REPASSER;
|
|
299
358
|
}
|
|
300
359
|
|
|
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
360
|
// Plans and plays the tests of the crates <choix> in the run <p>, each `{ c, cibles }`: `cibles`
|
|
317
361
|
// the test targets named, empty for the whole crate of the day (its night tests and its benches
|
|
318
362
|
// left out). For a crate that plays tests:
|
|
@@ -326,9 +370,21 @@ function jouerLesTests(racine, p, choix, options) {
|
|
|
326
370
|
const junit = path.join(m.workspace_root, 'target', 'nextest', PROFIL, 'junit.xml');
|
|
327
371
|
const nextest = ['nextest', 'run', '--tool-config-file', `${PROFIL}:${NEXTEST}`];
|
|
328
372
|
nextest.push('--profile', PROFIL, '--no-fail-fast');
|
|
373
|
+
// The workers of a session of an agent (GRILLHOUSE_TRAVAILLEURS): `-j` of cargo and of nextest;
|
|
374
|
+
// a heavy pass, without it, keeps every core.
|
|
375
|
+
const travailleurs = travailleursDeLaSeance(process.env);
|
|
376
|
+
const j = travailleurs === null ? [] : ['-j', String(travailleurs)];
|
|
377
|
+
// A bench plays on one thread (`--test-threads 1`, which `-j` of nextest is the alias of): it
|
|
378
|
+
// takes the arguments without `-j`.
|
|
379
|
+
const nextestDuBanc = [...nextest];
|
|
380
|
+
nextest.push(...j);
|
|
329
381
|
const parCrate = [];
|
|
330
382
|
const bancs = [];
|
|
331
|
-
for (const { c, cibles } of choix) {
|
|
383
|
+
for (const { c, cibles: nommees, jour } of choix) {
|
|
384
|
+
// Targets named beside the day of the crate (`jour`, a unit test of `src/` named): the day
|
|
385
|
+
// builds whole, and plays besides the targets named.
|
|
386
|
+
const cibles = jour && nommees.length === 0 ? [] : nommees;
|
|
387
|
+
const avecLeJour = Boolean(jour) && nommees.length > 0;
|
|
332
388
|
Object.assign(p.cibles, binaires(c));
|
|
333
389
|
const d = c.composant.dossier;
|
|
334
390
|
const nom = c.composant.nom;
|
|
@@ -340,21 +396,36 @@ function jouerLesTests(racine, p, choix, options) {
|
|
|
340
396
|
const desBancs = cibles.filter(deBanc);
|
|
341
397
|
const autres = cibles.filter(n => !deBanc(n));
|
|
342
398
|
const journal = path.join(m.target_directory, 'grillhouse', `${nom}-build.log`);
|
|
343
|
-
const construction = [
|
|
399
|
+
const construction = [
|
|
400
|
+
'test',
|
|
401
|
+
'--no-run',
|
|
402
|
+
...j,
|
|
403
|
+
'-p',
|
|
404
|
+
nom,
|
|
405
|
+
...(avecLeJour ? [] : cibles.flatMap(n => ['--test', n])),
|
|
406
|
+
];
|
|
344
407
|
prevues.push([p.prevoir(nom, d, 'build', false, construction), { journal }]);
|
|
345
|
-
if (cibles.length === 0 || autres.length) {
|
|
346
|
-
const
|
|
408
|
+
if (cibles.length === 0 || autres.length || avecLeJour) {
|
|
409
|
+
const duC = duJour(c);
|
|
410
|
+
const nommes = autres.flatMap(n => ['--test', n]);
|
|
411
|
+
const selection = !cibles.length
|
|
412
|
+
? duC
|
|
413
|
+
: avecLeJour
|
|
414
|
+
? duC.length
|
|
415
|
+
? [...duC, ...nommes]
|
|
416
|
+
: []
|
|
417
|
+
: nommes;
|
|
347
418
|
const args = [...nextest, '-p', nom, ...selection, ...options];
|
|
348
419
|
prevues.push([p.prevoir(nom, d, 'nextest', true, args), { junit }]);
|
|
349
420
|
}
|
|
350
421
|
if (desBancs.length) {
|
|
351
|
-
const args = [...
|
|
422
|
+
const args = [...nextestDuBanc, '-p', nom, ...desBancs.flatMap(n => ['--test', n])];
|
|
352
423
|
bancs.push({ nom, d, args: [...args, '--test-threads', '1', ...options], etat });
|
|
353
424
|
}
|
|
354
425
|
}
|
|
355
426
|
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];
|
|
427
|
+
if ((cibles.length === 0 || avecLeJour) && doctests) {
|
|
428
|
+
const args = ['test', '--doc', ...j, '-p', nom];
|
|
358
429
|
prevues.push([p.prevoir(nom, d, 'doctest', true, args), {}]);
|
|
359
430
|
}
|
|
360
431
|
parCrate.push([prevues, etat]);
|
|
@@ -393,6 +464,9 @@ function duJour(c) {
|
|
|
393
464
|
];
|
|
394
465
|
}
|
|
395
466
|
|
|
467
|
+
// The refusal of a night test named in a targeted run: the night alone plays it.
|
|
468
|
+
const REFUS_DE_NUIT = 'un test de nuit se joue la nuit seulement (npx grillhouse nuit le joue)';
|
|
469
|
+
|
|
396
470
|
// The crates the paths <chemins> choose in <racine>: `{ choix }`, or `{ refus }` naming each path
|
|
397
471
|
// refused.
|
|
398
472
|
function choisir(racine, tous, chemins) {
|
|
@@ -410,18 +484,27 @@ function choisir(racine, tous, chemins) {
|
|
|
410
484
|
refus.push(`${chemin} : hors de tout crate`);
|
|
411
485
|
continue;
|
|
412
486
|
}
|
|
413
|
-
|
|
487
|
+
// The folder of a crate without tests plays whole (its doctests, as the task of its package
|
|
488
|
+
// does); any other path in it names a test that does not exist.
|
|
489
|
+
if (!joueDesTests(racine, c) && abs !== c.dossier) {
|
|
414
490
|
refus.push(`${chemin} : ${c.nom} n'a aucun test, ni dossier tests/, ni tests.rs sous src/`);
|
|
415
491
|
continue;
|
|
416
492
|
}
|
|
417
493
|
const cible = crate.cibles.find(t => t.kind.includes('test') && t.src === abs);
|
|
494
|
+
// A night test plays at night alone (`tests-de-nuit`): a targeted run refuses it, named.
|
|
495
|
+
if (cible && horsDuJour(cible) === 'nuit') {
|
|
496
|
+
refus.push(`${chemin} : ${REFUS_DE_NUIT}`);
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
418
499
|
const deja = parDossier.get(c.dossier);
|
|
500
|
+
// A file with no target of its own (a unit test of `src/`) asks for the day of its crate; a
|
|
501
|
+
// target named stays named, whatever the order of the paths.
|
|
502
|
+
const entree = deja ?? { c: crate, cibles: [], jour: false };
|
|
503
|
+
parDossier.set(c.dossier, entree);
|
|
419
504
|
if (!cible) {
|
|
420
|
-
|
|
421
|
-
} else
|
|
422
|
-
|
|
423
|
-
} else if (deja.cibles.length) {
|
|
424
|
-
deja.cibles.push(cible.name);
|
|
505
|
+
entree.jour = true;
|
|
506
|
+
} else {
|
|
507
|
+
entree.cibles.push(cible.name);
|
|
425
508
|
}
|
|
426
509
|
}
|
|
427
510
|
if (refus.length) {
|
|
@@ -434,32 +517,57 @@ function choisir(racine, tous, chemins) {
|
|
|
434
517
|
};
|
|
435
518
|
}
|
|
436
519
|
|
|
520
|
+
// The packages of the graph of the crates <crates>: `{ noms, absents }`, the names of those that are
|
|
521
|
+
// packages of the graph, and the names of the crates that are not.
|
|
522
|
+
function nomsDuGraphe(racine, crates) {
|
|
523
|
+
const noms = new Set();
|
|
524
|
+
const absents = [];
|
|
525
|
+
for (const c of crates) {
|
|
526
|
+
const nom = nomDuPaquet(racine, c.composant.dossier);
|
|
527
|
+
if (nom === null) {
|
|
528
|
+
absents.push(c.composant.nom);
|
|
529
|
+
} else {
|
|
530
|
+
noms.add(nom);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return { noms, absents };
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Says, on the error stream, each crate of <absents> that is no package of the graph: its tests do
|
|
537
|
+
// not play, as a package without a `package.json` is out of Turborepo's tasks.
|
|
538
|
+
function direLesAbsents(absents) {
|
|
539
|
+
for (const nom of absents) {
|
|
540
|
+
process.stderr.write(
|
|
541
|
+
`⚠️ ${nom} : pas un paquet du graphe (package.json absent) ; ses tests ne se jouent pas : npx grillhouse maj\n`
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
437
546
|
// The pass of `verifier` in <racine>, under the lock of the machine (<env> carries its mark): the
|
|
438
|
-
// tests of the crates
|
|
439
|
-
//
|
|
547
|
+
// tests of the crates as tasks of Turborepo (every one played for real with <args> `--tout`), then
|
|
548
|
+
// cargo deny. It keeps no green.
|
|
440
549
|
function verifier(racine, args, env) {
|
|
441
550
|
const p = passe(racine, env);
|
|
442
551
|
if (args.includes('--gardes')) {
|
|
443
552
|
return gardes(racine, p);
|
|
444
553
|
}
|
|
445
|
-
|
|
446
|
-
const {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
554
|
+
// Beside the module of package.json (composed command), its pass has played the tasks.
|
|
555
|
+
const { noms, absents } = env[GRAPHE_JOUE]
|
|
556
|
+
? { noms: new Set(), absents: [] }
|
|
557
|
+
: nomsDuGraphe(racine, crates(racine));
|
|
558
|
+
direLesAbsents(absents);
|
|
559
|
+
const code = noms.size
|
|
560
|
+
? lancerLesTaches({
|
|
561
|
+
outil: OUTIL,
|
|
562
|
+
racine,
|
|
563
|
+
taches: [SCRIPT_DES_TESTS],
|
|
564
|
+
noms,
|
|
565
|
+
tests: testsCibles({ arguments: [], force: args.includes('--tout') }),
|
|
566
|
+
env,
|
|
567
|
+
})
|
|
568
|
+
: 0;
|
|
569
|
+
p.jouer(p.prevoir(RACINE, racine, 'deny', false, ['deny', 'check']));
|
|
570
|
+
return code === 0 ? p.code() : 1;
|
|
463
571
|
}
|
|
464
572
|
|
|
465
573
|
// The scripts of guards of the project, in the order they play, as the module typescript's
|
|
@@ -508,16 +616,18 @@ function sousLaBase(genre, env, jouer) {
|
|
|
508
616
|
|
|
509
617
|
/**
|
|
510
618
|
* The line that refuses the workspace at <racine> whose Cargo.lock git does not track, the
|
|
511
|
-
* gesture named; null when git tracks it.
|
|
619
|
+
* gesture named; null when git tracks it. <copie> is the root git reads (a tree of HEAD's version
|
|
620
|
+
* has no `.git`: its copy's, where the same file is tracked).
|
|
512
621
|
* @param {string} racine
|
|
622
|
+
* @param {string} [copie]
|
|
513
623
|
* @returns {string | null}
|
|
514
624
|
*/
|
|
515
|
-
export function verrouNonVersionne(racine) {
|
|
625
|
+
export function verrouNonVersionne(racine, copie = racine) {
|
|
516
626
|
if (!existsSync(path.join(racine, VERROU))) {
|
|
517
627
|
return `⛔ ${VERROU} absent : cargo generate-lockfile, puis git add ${VERROU}`;
|
|
518
628
|
}
|
|
519
629
|
const r = spawnSync('git', ['ls-files', '--error-unmatch', '--', VERROU], {
|
|
520
|
-
cwd:
|
|
630
|
+
cwd: copie,
|
|
521
631
|
stdio: 'ignore',
|
|
522
632
|
});
|
|
523
633
|
return r.status === 0 ? null : `⛔ ${VERROU} non versionné : git add ${VERROU}`;
|
|
@@ -530,14 +640,40 @@ export function verrouNonVersionne(racine) {
|
|
|
530
640
|
* @param {{ racine?: string, env?: NodeJS.ProcessEnv }} [o]
|
|
531
641
|
*/
|
|
532
642
|
export function lancer(nom, args, { racine = process.cwd(), env = process.env } = {}) {
|
|
643
|
+
// `construire` and `typer` with a path: the one crate of that folder (`cargo build -p`,
|
|
644
|
+
// `cargo check -p`), as Turborepo's task of one package; `typer` alone checks the workspace.
|
|
645
|
+
let crate = null;
|
|
646
|
+
// The launcher's `construire` (`--echec <fichier> <plan>`, scripts/enveloppe/lancer.sh) builds
|
|
647
|
+
// the copy for a session, the plan and its providers, as every language's.
|
|
648
|
+
if (nom === 'construire' && args.includes('--echec')) {
|
|
649
|
+
return construireDepuisLesArguments(OUTIL, args, racine);
|
|
650
|
+
}
|
|
651
|
+
if (nom === 'construire' || (nom === 'typer' && args.length)) {
|
|
652
|
+
const [chemin, ...autres] = args;
|
|
653
|
+
const abs = chemin === undefined ? null : path.resolve(racine, chemin);
|
|
654
|
+
crate = abs === null ? undefined : crates(racine).find(x => x.composant.dossier === abs);
|
|
655
|
+
if (!crate || autres.length) {
|
|
656
|
+
process.stderr.write(
|
|
657
|
+
`⛔ ${nom} : ${chemin ?? 'aucun chemin'} ne désigne pas un crate (un dossier de crate, une fois).\n`
|
|
658
|
+
);
|
|
659
|
+
return 2;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
533
662
|
const refus =
|
|
534
|
-
(VERROUILLEES.includes(nom)
|
|
535
|
-
|
|
663
|
+
(VERROUILLEES.includes(nom)
|
|
664
|
+
? verrouNonVersionne(racine, env[COPIE_DE_L_ARBRE] || racine)
|
|
665
|
+
: null) ?? (COMPILENT.includes(nom) ? sccacheAbsent(racine, env) : null);
|
|
536
666
|
if (refus) {
|
|
537
667
|
process.stderr.write(`${refus}\n`);
|
|
538
668
|
return 2;
|
|
539
669
|
}
|
|
540
670
|
const p = passe(racine, env);
|
|
671
|
+
if (crate) {
|
|
672
|
+
const sous = nom === 'construire' ? 'build' : 'check';
|
|
673
|
+
const nomDuCrate = crate.composant.nom;
|
|
674
|
+
p.jouer(p.prevoir(nomDuCrate, crate.composant.dossier, sous, false, [sous, '-p', nomDuCrate]));
|
|
675
|
+
return p.code();
|
|
676
|
+
}
|
|
541
677
|
if (nom === 'typer') {
|
|
542
678
|
p.jouer(p.prevoir(RACINE, racine, 'check', false, ['check', '--all-targets']));
|
|
543
679
|
return p.code();
|
|
@@ -550,7 +686,7 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
550
686
|
const dire = l => process.stdout.write(`${l}\n`);
|
|
551
687
|
try {
|
|
552
688
|
return sousLaBase('verification', env, envBase =>
|
|
553
|
-
|
|
689
|
+
avecLaMachineEtUnePlace(envMachine => verifier(racine, args, envMachine), {
|
|
554
690
|
env: envBase,
|
|
555
691
|
racine,
|
|
556
692
|
dire,
|
|
@@ -566,7 +702,10 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
566
702
|
}
|
|
567
703
|
const tous = crates(racine);
|
|
568
704
|
if (nom === 'tester') {
|
|
569
|
-
return
|
|
705
|
+
return surUnePlace(e => tester(racine, tous, args, e), { env });
|
|
706
|
+
}
|
|
707
|
+
if (nom === 'tests-du-paquet') {
|
|
708
|
+
return sousLaBase('tests', env, envBase => testsDuPaquet(racine, tous, args, envBase));
|
|
570
709
|
}
|
|
571
710
|
if (nom === 'tests-de-nuit') {
|
|
572
711
|
return sousLaBase('tests', env, envBase => testsDeNuit(racine, tous, envBase));
|
|
@@ -575,13 +714,13 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
575
714
|
return 2;
|
|
576
715
|
}
|
|
577
716
|
|
|
578
|
-
// The pass of `tester` in <racine>, the crates <tous>, its arguments <args>, under <env
|
|
717
|
+
// The pass of `tester` in <racine>, the crates <tous>, its arguments <args>, under <env>: the tasks
|
|
718
|
+
// `test:unit` of the crates the paths choose (every crate without a path) as Turborepo's, the
|
|
719
|
+
// exit code its.
|
|
579
720
|
function tester(racine, tous, args, env) {
|
|
580
|
-
const p = passe(racine, env);
|
|
581
721
|
const chemins = args.filter(a => !a.startsWith('-'));
|
|
582
722
|
const options = args.filter(a => a.startsWith('-') && a !== '--force');
|
|
583
|
-
let
|
|
584
|
-
let m = null;
|
|
723
|
+
let choisis = tous;
|
|
585
724
|
if (chemins.length) {
|
|
586
725
|
const r = choisir(racine, tous, chemins);
|
|
587
726
|
if (r.refus) {
|
|
@@ -590,18 +729,59 @@ function tester(racine, tous, args, env) {
|
|
|
590
729
|
}
|
|
591
730
|
return 2;
|
|
592
731
|
}
|
|
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: [] }));
|
|
732
|
+
choisis = r.choix.map(x => x.c);
|
|
599
733
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
734
|
+
const { noms, absents } = nomsDuGraphe(racine, choisis);
|
|
735
|
+
if (chemins.length && absents.length) {
|
|
736
|
+
process.stderr.write(
|
|
737
|
+
`⛔ ${absents.join(', ')} : pas un paquet du graphe (package.json absent) : npx grillhouse maj\n`
|
|
738
|
+
);
|
|
739
|
+
return 2;
|
|
740
|
+
}
|
|
741
|
+
direLesAbsents(absents);
|
|
742
|
+
if (noms.size === 0) {
|
|
743
|
+
return 0;
|
|
604
744
|
}
|
|
745
|
+
return lancerLesTaches({
|
|
746
|
+
outil: OUTIL,
|
|
747
|
+
racine,
|
|
748
|
+
taches: [SCRIPT_DES_TESTS],
|
|
749
|
+
noms,
|
|
750
|
+
tests: testsCibles({
|
|
751
|
+
arguments: [...chemins.map(c => path.resolve(racine, c)), ...options],
|
|
752
|
+
force: args.includes('--force'),
|
|
753
|
+
}),
|
|
754
|
+
env,
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
// The pass of `tests-du-paquet` in <racine>, the crates <tous>, its arguments <args>, under <env>:
|
|
759
|
+
// the body of the task `test:unit` of a crate. The paths its script names, completed by those of
|
|
760
|
+
// the variable of the task that lie in the same crate.
|
|
761
|
+
function testsDuPaquet(racine, tous, args, env) {
|
|
762
|
+
const donnes = args.filter(a => !a.startsWith('-'));
|
|
763
|
+
if (donnes.length === 0) {
|
|
764
|
+
process.stderr.write(
|
|
765
|
+
'⛔ tests-du-paquet : aucun chemin (un dossier de crate, ou un fichier de test).\n'
|
|
766
|
+
);
|
|
767
|
+
return 2;
|
|
768
|
+
}
|
|
769
|
+
const dossierDe = abs =>
|
|
770
|
+
composantDans(
|
|
771
|
+
tous.map(x => x.composant),
|
|
772
|
+
racine,
|
|
773
|
+
abs
|
|
774
|
+
)?.dossier ?? null;
|
|
775
|
+
const { chemins, options } = cheminsDeLaTache({ racine, donnes, env, dossierDe });
|
|
776
|
+
const r = choisir(racine, tous, chemins);
|
|
777
|
+
if (r.refus) {
|
|
778
|
+
for (const l of r.refus) {
|
|
779
|
+
process.stderr.write(`⛔ ${l}\n`);
|
|
780
|
+
}
|
|
781
|
+
return 2;
|
|
782
|
+
}
|
|
783
|
+
const p = passe(racine, env);
|
|
784
|
+
jouerLesTests(racine, p, r.choix, [...args.filter(a => a.startsWith('-')), ...options])();
|
|
605
785
|
return p.code();
|
|
606
786
|
}
|
|
607
787
|
|