package main import ( "encoding/json" "os" "slices" "testing" ) // The readings' layout is disk-load's own package, published by its series for the readers to take (ADR 0634 ยง4). func TestTheReadingsLayoutIsAPublishedPackageOfThisModule(t *testing.T) { raw, err := os.ReadFile("../../module.json") if err != nil { t.Fatal(err) } var m struct { Reads []string `json:"reads"` Build struct { Artifacts []struct { Name, Kind, Series string Paths []string } `json:"artifacts"` } `json:"build"` } if err := json.Unmarshal(raw, &m); err != nil { t.Fatal(err) } // The node-engine's data state is read under the one name of its holder this module keeps. if !slices.Contains(m.Reads, engineDataRead) { t.Errorf("reads %v do not name %s", m.Reads, engineDataRead) } // Issue 1966's bootstrap: the package artifact diskreadings is out of the manifest until the new builder runs; the follow-up // puts this check back. }