Skip to content

Commit ef7a852

Browse files
authored
Clean up NFR test result formatting (#2505)
Problem: Some results files added extra newlines, causing our formatter to fail. Also, error log files were way too large for feasible parsing. Solution: Remove extra newlines, and only include error logs instead of full log files.
1 parent 81d4142 commit ef7a852

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.github/workflows/nfr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
workflow_dispatch:
55
inputs:
66
test_label:
7-
description: NFR test to run. Choose between performance, upgrade, scale, or all
7+
description: NFR test to run. Choose between a specific test or all tests
88
required: true
99
default: all
1010
type: choice
11-
options: [performance, upgrade, scale, all]
11+
options: [performance, upgrade, scale, zero-downtime-scale, reconfiguration, all]
1212
version:
1313
description: Version of NGF under test
1414
required: true

tests/suite/reconfig_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
// Cluster node size must be greater than or equal to 4 for test to perform correctly.
27-
var _ = Describe("Reconfiguration Performance Testing", Ordered, Label("reconfiguration", "nfr"), func() {
27+
var _ = Describe("Reconfiguration Performance Testing", Ordered, Label("nfr", "reconfiguration"), func() {
2828
const (
2929
// used for cleaning up resources
3030
maxResourceCount = 150
@@ -627,7 +627,6 @@ const reconfigResultTemplate = `
627627
{{- range .EventsBuckets }}
628628
- {{ .Le }}ms: {{ .Val }}
629629
{{- end }}
630-
631630
`
632631

633632
func writeReconfigResults(dest io.Writer, results reconfigTestResults) error {

tests/suite/scale_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ The logs are attached only if there are errors.
187187
Expect(err).ToNot(HaveOccurred())
188188

189189
logLines := strings.Split(logs, "\n")
190-
errors := 0
190+
var errors []string
191191

192192
outer:
193193
for _, line := range logLines {
@@ -198,22 +198,24 @@ The logs are attached only if there are errors.
198198
}
199199
for _, substr := range substrings {
200200
if strings.Contains(line, substr) {
201-
errors++
201+
errors = append(errors, line)
202202
continue outer
203203
}
204204
}
205205
}
206206

207-
// attach full logs
208-
if errors > 0 {
207+
// attach error logs
208+
if len(errors) > 0 {
209209
f, err := os.Create(fileName)
210210
Expect(err).ToNot(HaveOccurred())
211211
defer f.Close()
212212

213-
_, err = io.WriteString(f, logs)
214-
Expect(err).ToNot(HaveOccurred())
213+
for _, e := range errors {
214+
_, err = io.WriteString(f, fmt.Sprintf("%s\n", e))
215+
Expect(err).ToNot(HaveOccurred())
216+
}
215217
}
216-
return errors
218+
return len(errors)
217219
}
218220

219221
runTestWithMetricsAndLogs := func(testName, testResultsDir string, test func()) {
@@ -797,7 +799,7 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
797799
})
798800

799801
AfterAll(func() {
800-
_, err := fmt.Fprintln(outFile)
802+
_, err := fmt.Fprint(outFile)
801803
Expect(err).ToNot(HaveOccurred())
802804
Expect(outFile.Close()).To(Succeed())
803805

0 commit comments

Comments
 (0)