generator: "make test" passes again

there's a lot of boilerplate that is now expected in sigs.yaml
This commit is contained in:
Aaron Crickenberger 2021-03-07 23:48:24 -05:00 committed by Aaron Crickenberger
parent e331270db5
commit 6687a0892a
2 changed files with 25 additions and 8 deletions

View File

@ -155,19 +155,22 @@ func TestGroupDirName(t *testing.T) {
func TestCreateGroupReadmes(t *testing.T) {
baseGeneratorDir = "generated"
templateDir = "../../generator"
const groupType = "sig"
groups := []Group{
{Name: "Foo"},
{Name: "Bar"},
groups := []Group{}
for _, n := range []string{"Foo", "Bar"} {
g := Group{Name: n}
g.Dir = g.DirName(groupType)
groups = append(groups, g)
}
err := createGroupReadme(groups, "sig")
err := createGroupReadme(groups, groupType)
if err != nil {
t.Fatal(err)
}
for _, group := range groups {
path := filepath.Join(baseGeneratorDir, group.DirName("sig"), "README.md")
path := filepath.Join(baseGeneratorDir, group.DirName(groupType), "README.md")
if !pathExists(path) {
t.Fatalf("%s should exist", path)
}

View File

@ -1,5 +1,19 @@
sigs:
- name: Foo
- name: Bar
- dir: sig-foo
name: Foo
label: foo
charter_link: foo-charter
mission_statement: covers foo
subprojects:
- name: sub-foo
- dir: sig-bar
name: Bar
label: bar
charter_link: charter-bar
mission_statement: owns areas related to bar
subprojects:
- name: sub-bar
workinggroups:
- name: Baz
- dir: wg-baz
name: Baz
label: baz