Skip to content

Commit 9f27584

Browse files
hdurand0710mjuraga
authored andcommitted
TEST/MEDIUM: fix issue in gentype that prevented to run the tests for sections with dash
In xxx_data_test.go test strings are present but in xxx_test_go the list of test cases to run was empty.
1 parent 4c21b71 commit 9f27584

File tree

6 files changed

+43
-6
lines changed

6 files changed

+43
-6
lines changed

.aspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ allowed:
7373
- frontend
7474
- frontends
7575
- fullpage
76+
- gentype
7677
- github
7778
- gitlab
7879
- godaddy

config-parser/generate/config-file.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func (c *ConfigFile) StringFiles(baseFolder string) {
287287
}
288288
usedNiceNames[niceName] = struct{}{}
289289
sectionName := " test"
290-
if sectionType == "global" || sectionType == "traces" {
290+
if sectionType == "global" || sectionType == "traces" || sectionType == "dynamic-update" {
291291
sectionName = ""
292292
}
293293
oneTest := "const " + niceName + " = `\n" + sectionType + sectionName + "\n" + " " + line + "\n`" + "\n"
@@ -310,8 +310,9 @@ func (c *ConfigFile) StringFiles(baseFolder string) {
310310
testName := cases.Title(language.Und, cases.NoLower).String(getNiceName(sectionName))
311311
testFile.WriteString(strings.Replace(testHeader, "TestWholeConfigsSections", "TestWholeConfigsSections"+testName, 1))
312312
sortedNames := []string{}
313+
sectionNameWithoutDash := strings.ReplaceAll(sectionName, "-", "")
313314
for name := range usedNiceNames {
314-
if strings.HasPrefix(name, sectionName) {
315+
if strings.HasPrefix(name, sectionNameWithoutDash) {
315316
sortedNames = append(sortedNames, name)
316317
}
317318
}

config-parser/tests/integration/crt-store_test.go

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/tests/integration/fcgi-app_test.go

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/tests/integration/log-forward_test.go

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/tests/integration/log-profile_test.go

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)