Skip to content

Commit 6687a08

Browse files
committed
generator: "make test" passes again
there's a lot of boilerplate that is now expected in sigs.yaml
1 parent e331270 commit 6687a08

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

generator/app_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,22 @@ func TestGroupDirName(t *testing.T) {
155155
func TestCreateGroupReadmes(t *testing.T) {
156156
baseGeneratorDir = "generated"
157157
templateDir = "../../generator"
158+
const groupType = "sig"
158159

159-
groups := []Group{
160-
{Name: "Foo"},
161-
{Name: "Bar"},
160+
groups := []Group{}
161+
for _, n := range []string{"Foo", "Bar"} {
162+
g := Group{Name: n}
163+
g.Dir = g.DirName(groupType)
164+
groups = append(groups, g)
162165
}
163166

164-
err := createGroupReadme(groups, "sig")
167+
err := createGroupReadme(groups, groupType)
165168
if err != nil {
166169
t.Fatal(err)
167170
}
168171

169172
for _, group := range groups {
170-
path := filepath.Join(baseGeneratorDir, group.DirName("sig"), "README.md")
173+
path := filepath.Join(baseGeneratorDir, group.DirName(groupType), "README.md")
171174
if !pathExists(path) {
172175
t.Fatalf("%s should exist", path)
173176
}

generator/testdata/sigs.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
sigs:
2-
- name: Foo
3-
- name: Bar
2+
- dir: sig-foo
3+
name: Foo
4+
label: foo
5+
charter_link: foo-charter
6+
mission_statement: covers foo
7+
subprojects:
8+
- name: sub-foo
9+
- dir: sig-bar
10+
name: Bar
11+
label: bar
12+
charter_link: charter-bar
13+
mission_statement: owns areas related to bar
14+
subprojects:
15+
- name: sub-bar
416
workinggroups:
5-
- name: Baz
17+
- dir: wg-baz
18+
name: Baz
19+
label: baz

0 commit comments

Comments
 (0)