Skip to content

Commit 0bb8c72

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 4051c95 commit 0bb8c72

File tree

6 files changed

+35
-2
lines changed

6 files changed

+35
-2
lines changed

.aspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ allowed:
7171
- frontend
7272
- frontends
7373
- fullpage
74+
- gentype
7475
- github
7576
- gitlab
7677
- godaddy

config-parser/generate/config-file.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (c *ConfigFile) StringFiles(baseFolder string) {
285285
}
286286
usedNiceNames[niceName] = struct{}{}
287287
sectionName := " test"
288-
if sectionType == "global" || sectionType == "traces" {
288+
if sectionType == "global" || sectionType == "traces" || sectionType == "dynamic-update" {
289289
sectionName = ""
290290
}
291291
oneTest := "const " + niceName + " = `\n" + sectionType + sectionName + "\n" + " " + line + "\n`" + "\n"
@@ -308,8 +308,9 @@ func (c *ConfigFile) StringFiles(baseFolder string) {
308308
testName := cases.Title(language.Und, cases.NoLower).String(getNiceName(sectionName))
309309
testFile.WriteString(strings.Replace(testHeader, "TestWholeConfigsSections", "TestWholeConfigsSections"+testName, 1))
310310
sortedNames := []string{}
311+
sectionNameWithoutDash := strings.ReplaceAll(sectionName, "-", "")
311312
for name := range usedNiceNames {
312-
if strings.HasPrefix(name, sectionName) {
313+
if strings.HasPrefix(name, sectionNameWithoutDash) {
313314
sortedNames = append(sortedNames, name)
314315
}
315316
}

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

Lines changed: 9 additions & 0 deletions
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: 11 additions & 0 deletions
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: 7 additions & 0 deletions
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: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)