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
+12 -4
View File
@@ -12,7 +12,7 @@ import (
// R6-A AC3: given two modules declaring one path, when one module's want changes, the shared path is neither removed
// nor taken from the other module (novox/hq ADR 0539 §9).
func TestASharedPathIsNeitherRemovedNorTakenFromTheOtherModule(t *testing.T) {
func testASharedPathIsNeitherRemovedNorTakenFromTheOtherModule(t *testing.T) {
dir := t.TempDir()
shared := filepath.Join(dir, "shared.conf")
own := filepath.Join(dir, "a-own.conf")
@@ -56,7 +56,7 @@ func TestASharedPathIsNeitherRemovedNorTakenFromTheOtherModule(t *testing.T) {
// R6-A AC4: given modules A and B on a node, when A's want is removed, only A's resources are removed and B is
// untouched.
func TestARemovedModuleTakesOnlyItsOwnResources(t *testing.T) {
func testARemovedModuleTakesOnlyItsOwnResources(t *testing.T) {
dir := t.TempDir()
fa, fb := filepath.Join(dir, "a.conf"), filepath.Join(dir, "b.conf")
d := declare(t, `{"id":"a.conf","type":"file","path":"`+fa+`","content":"a\n","module":"a"},
@@ -91,7 +91,7 @@ func TestARemovedModuleTakesOnlyItsOwnResources(t *testing.T) {
}
// A record from before the owner was kept is read by its id, so the first removal after the switch is the module's too.
func TestARecordWithoutAnOwnerBelongsToTheModuleItsIdNames(t *testing.T) {
func testARecordWithoutAnOwnerBelongsToTheModuleItsIdNames(t *testing.T) {
dir := t.TempDir()
fa, fb := filepath.Join(dir, "a.conf"), filepath.Join(dir, "b.conf")
d := declare(t, `{"id":"a.conf","type":"file","path":"`+fa+`","content":"a\n"},
@@ -123,7 +123,7 @@ func TestARecordWithoutAnOwnerBelongsToTheModuleItsIdNames(t *testing.T) {
// says why (issue 774, live on 2026-10-29 at 07:54 UTC on the bus node: the node's own composition, composed without what
// it ran once the kept declaration was read no more, removed the bus server, the proxy and three held modules). Only its
// want's removal lets it go.
func TestAResourceThatMovedToItsModulesCompositionIsLeftByTheNodesOwnApply(t *testing.T) {
func testAResourceThatMovedToItsModulesCompositionIsLeftByTheNodesOwnApply(t *testing.T) {
for _, tc := range []struct {
name string
id string // the resource the node's own composition carried, and no longer does
@@ -222,3 +222,11 @@ func TestAResourceThatMovedToItsModulesCompositionIsLeftByTheNodesOwnApply(t *te
}
func state0() store.State { return store.State{} }
// TestModuleScope runs this file's tests, each a subtest named as its function was (design 47 H2 §819, the test budget).
func TestModuleScope(t *testing.T) {
t.Run("ASharedPathIsNeitherRemovedNorTakenFromTheOtherModule", testASharedPathIsNeitherRemovedNorTakenFromTheOtherModule)
t.Run("ARemovedModuleTakesOnlyItsOwnResources", testARemovedModuleTakesOnlyItsOwnResources)
t.Run("ARecordWithoutAnOwnerBelongsToTheModuleItsIdNames", testARecordWithoutAnOwnerBelongsToTheModuleItsIdNames)
t.Run("AResourceThatMovedToItsModulesCompositionIsLeftByTheNodesOwnApply", testAResourceThatMovedToItsModulesCompositionIsLeftByTheNodesOwnApply)
}