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:
@@ -20,7 +20,7 @@ var genesisModules = []string{RegistryModule, BuilderModule, "postgres", BusModu
|
||||
// Every genesis module's bundles are compiled in a toolchain the base step builds, read from the real
|
||||
// catalogue's manifests: a module that gains a language genesis does not build fails here, not at a
|
||||
// genesis.
|
||||
func TestTheBaseStepBuildsEveryToolchainAGenesisModuleIsCompiledIn(t *testing.T) {
|
||||
func testTheBaseStepBuildsEveryToolchainAGenesisModuleIsCompiledIn(t *testing.T) {
|
||||
// ADR 0604 section 7: the catalog is the indexer's seat now, so genesis has no catalogue step and installs or takes no
|
||||
// mesh-catalog module.
|
||||
for _, step := range Steps {
|
||||
@@ -64,7 +64,7 @@ func TestTheBaseStepBuildsEveryToolchainAGenesisModuleIsCompiledIn(t *testing.T)
|
||||
}
|
||||
|
||||
// And the base step asks for each toolchain's build: the base, then the Go toolchain beside it.
|
||||
func TestTheBaseStepBuildsTheGoToolchainBesideTheBase(t *testing.T) {
|
||||
func testTheBaseStepBuildsTheGoToolchainBesideTheBase(t *testing.T) {
|
||||
runtime := &asked{answer: aMeshThatAgrees(nil)}
|
||||
control := controlPlane{container: "mesh-controller", run: runtime.run, timeout: time.Second}
|
||||
o := Options{ToolsSource: Source{Repository: "git://192.0.2.30/mesh-tools.git"}}
|
||||
@@ -86,7 +86,7 @@ func TestTheBaseStepBuildsTheGoToolchainBesideTheBase(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTheGoToolchainIsAsGivenOrBesideTheBase(t *testing.T) {
|
||||
func testTheGoToolchainIsAsGivenOrBesideTheBase(t *testing.T) {
|
||||
for _, c := range []struct{ tools, given, want string }{
|
||||
{"http://forge/novox/mesh-tools.git", "", "http://forge/novox/mesh-tools-go.git"},
|
||||
{"http://forge/novox/mesh-tools", "", "http://forge/novox/mesh-tools-go"},
|
||||
@@ -102,3 +102,10 @@ func TestTheGoToolchainIsAsGivenOrBesideTheBase(t *testing.T) {
|
||||
t.Errorf("a base not named mesh-tools, and no Go toolchain given, was not refused naming the flag: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// TestGenesisToolchains runs this file's tests, each a subtest named as its function was (design 47 H2 §819, the test budget).
|
||||
func TestGenesisToolchains(t *testing.T) {
|
||||
t.Run("TheBaseStepBuildsEveryToolchainAGenesisModuleIsCompiledIn", testTheBaseStepBuildsEveryToolchainAGenesisModuleIsCompiledIn)
|
||||
t.Run("TheBaseStepBuildsTheGoToolchainBesideTheBase", testTheBaseStepBuildsTheGoToolchainBesideTheBase)
|
||||
t.Run("TheGoToolchainIsAsGivenOrBesideTheBase", testTheGoToolchainIsAsGivenOrBesideTheBase)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user