E8: run each file's unit tests as subtests of one test

The node-engine held 1,707 top-level unit tests against the budget of 500
a module. Each unit test file with two or more tests now runs them as
subtests of one test named for the file, each named as its function was,
in the same order: every check is kept, and the check counts 383. Files
with a TestMain, a re-run of a test by its name, or the integration tag
are left. Four files of this branch's earlier commits are formatted.

Builds: design 47 H2 §819; H-A-349 DQ-14
This commit is contained in:
2026-11-22 00:30:05 +01:00
parent a882051de6
commit 0c01c81c3f
257 changed files with 4189 additions and 1589 deletions
+14 -5
View File
@@ -8,7 +8,7 @@ import (
"git.novox.be/novox/mesh-sdk/go/declaration"
)
func TestADefaultBuildCarriesNothingAndSaysSo(t *testing.T) {
func testADefaultBuildCarriesNothingAndSaysSo(t *testing.T) {
// The important one. A host built without a bundle that applied nothing and reported
// success would look exactly like a host that raised a first node — and the difference
// would surface as a mesh that never came up, with nothing to point at.
@@ -24,7 +24,7 @@ func TestADefaultBuildCarriesNothingAndSaysSo(t *testing.T) {
}
}
func TestABundleWithContentIsParsedByTheSameParserTheLinkWillUse(t *testing.T) {
func testABundleWithContentIsParsedByTheSameParserTheLinkWillUse(t *testing.T) {
// A bundle that reaches a machine and is then refused by the host carrying it would be a
// build-time mistake found at the worst possible moment.
//
@@ -41,7 +41,7 @@ func TestABundleWithContentIsParsedByTheSameParserTheLinkWillUse(t *testing.T) {
}
}
func TestWhatValidatesIsWhatIsApplied(t *testing.T) {
func testWhatValidatesIsWhatIsApplied(t *testing.T) {
// Found on a real machine. `mesh-host bundle` validated the carried bundle through Load,
// which strips comments; `reconcile` handed the RAW bytes to the parser, which does not.
// So the command whose whole job is to check the bundle said yes, and the command that
@@ -56,7 +56,7 @@ func TestWhatValidatesIsWhatIsApplied(t *testing.T) {
}
}
func TestEverySystemHasABundleAndAndroidsRefuses(t *testing.T) {
func testEverySystemHasABundleAndAndroidsRefuses(t *testing.T) {
// The bundle's contents are per system even though its mechanism is not (novox/hq ADR
// 0060), so a host must find one built for it — and a host built for a system with no
// bundle at all must say that rather than behave like an empty one.
@@ -75,7 +75,7 @@ func TestEverySystemHasABundleAndAndroidsRefuses(t *testing.T) {
}
}
func TestAndroidsBundleSaysWhyThereIsNone(t *testing.T) {
func testAndroidsBundleSaysWhyThereIsNone(t *testing.T) {
// Not a placeholder waiting to be filled in. An android host implements neither `package`
// nor `container` nor `service`, so every step of the bootstrap is a shape it does not
// have — a partial host can JOIN a mesh and cannot BE the first node.
@@ -86,3 +86,12 @@ func TestAndroidsBundleSaysWhyThereIsNone(t *testing.T) {
}
}
}
// TestBundle runs this file's tests, each a subtest named as its function was (design 47 H2 §819, the test budget).
func TestBundle(t *testing.T) {
t.Run("ADefaultBuildCarriesNothingAndSaysSo", testADefaultBuildCarriesNothingAndSaysSo)
t.Run("ABundleWithContentIsParsedByTheSameParserTheLinkWillUse", testABundleWithContentIsParsedByTheSameParserTheLinkWillUse)
t.Run("WhatValidatesIsWhatIsApplied", testWhatValidatesIsWhatIsApplied)
t.Run("EverySystemHasABundleAndAndroidsRefuses", testEverySystemHasABundleAndAndroidsRefuses)
t.Run("AndroidsBundleSaysWhyThereIsNone", testAndroidsBundleSaysWhyThereIsNone)
}