Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up NFR test result formatting #2505

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/nfr.yml
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@ on:
workflow_dispatch:
inputs:
test_label:
description: NFR test to run. Choose between performance, upgrade, scale, or all
description: NFR test to run. Choose between a specific test or all tests
required: true
default: all
type: choice
options: [performance, upgrade, scale, all]
options: [performance, upgrade, scale, zero-downtime-scale, reconfiguration, all]
version:
description: Version of NGF under test
required: true
3 changes: 1 addition & 2 deletions tests/suite/reconfig_test.go
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ import (
)

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

`

func writeReconfigResults(dest io.Writer, results reconfigTestResults) error {
18 changes: 10 additions & 8 deletions tests/suite/scale_test.go
Original file line number Diff line number Diff line change
@@ -187,7 +187,7 @@ The logs are attached only if there are errors.
Expect(err).ToNot(HaveOccurred())

logLines := strings.Split(logs, "\n")
errors := 0
var errors []string

outer:
for _, line := range logLines {
@@ -198,22 +198,24 @@ The logs are attached only if there are errors.
}
for _, substr := range substrings {
if strings.Contains(line, substr) {
errors++
errors = append(errors, line)
continue outer
}
}
}

// attach full logs
if errors > 0 {
// attach error logs
if len(errors) > 0 {
f, err := os.Create(fileName)
Expect(err).ToNot(HaveOccurred())
defer f.Close()

_, err = io.WriteString(f, logs)
Expect(err).ToNot(HaveOccurred())
for _, e := range errors {
_, err = io.WriteString(f, fmt.Sprintf("%s\n", e))
Expect(err).ToNot(HaveOccurred())
}
}
return errors
return len(errors)
}

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

AfterAll(func() {
_, err := fmt.Fprintln(outFile)
sjberman marked this conversation as resolved.
Show resolved Hide resolved
_, err := fmt.Fprint(outFile)
Expect(err).ToNot(HaveOccurred())
Expect(outFile.Close()).To(Succeed())

Loading