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

test: Improve names of upgrade tests #24557

Merged
merged 3 commits into from Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/e2e/upgrade/service/service.go
Expand Up @@ -32,8 +32,10 @@ type UpgradeTest struct {
tcpService *v1.Service
}

// Name returns the tracking name of the test.
func (UpgradeTest) Name() string { return "k8s-service-upgrade" }
func (UpgradeTest) Name() string { return "k8s-service-lb-available" }
func (UpgradeTest) DisplayName() string {
return "Application behind service load balancer with PDB is not disrupted"
}

func shouldTestPDBs() bool { return true }

Expand Down
3 changes: 3 additions & 0 deletions test/extended/operators/cluster.go
Expand Up @@ -81,6 +81,9 @@ var _ = g.Describe("[Feature:Platform] Managed cluster should", func() {
ns := make(map[string]struct{})
for _, pod := range podsWithProblems {
delete(lastPending, fmt.Sprintf("%s/%s", pod.Namespace, pod.Name))
if strings.HasPrefix(pod.Name, "samename-") {
continue
}
if _, ok := ns[pod.Namespace]; !ok {
e2e.DumpAllNamespaceInfo(c, pod.Namespace)
ns[pod.Namespace] = struct{}{}
Expand Down
4 changes: 2 additions & 2 deletions test/extended/util/disruption/controlplane/controlplane.go
Expand Up @@ -17,8 +17,8 @@ import (
type AvailableTest struct {
}

// Name returns the tracking name of the test.
func (AvailableTest) Name() string { return "control-plane-upgrade" }
func (AvailableTest) Name() string { return "control-plane-available" }
func (AvailableTest) DisplayName() string { return "Kubernetes and OpenShift APIs remain available" }

// Setup does nothing
func (t *AvailableTest) Setup(f *framework.Framework) {
Expand Down
14 changes: 11 additions & 3 deletions test/extended/util/disruption/disruption.go
Expand Up @@ -21,6 +21,12 @@ import (
"k8s.io/kubernetes/test/utils/junit"
)

// testWithDisplayName is implemented by tests that want more descriptive test names
// than Name() (which must be namespace safe) allows.
type testWithDisplayName interface {
DisplayName() string
}

// flakeSummary is a test summary type that allows upgrades to report violations
// without failing the upgrade test.
type flakeSummary string
Expand Down Expand Up @@ -65,8 +71,12 @@ func runChaosmonkey(
) {
testFrameworks := createTestFrameworks(tests)
for _, t := range tests {
displayName := t.Name()
if dn, ok := t.(testWithDisplayName); ok {
displayName = dn.DisplayName()
}
testCase := &junit.TestCase{
Name: t.Name(),
Name: displayName,
Classname: "disruption_tests",
}
testSuite.TestCases = append(testSuite.TestCases, testCase)
Expand Down Expand Up @@ -124,9 +134,7 @@ func (cma *chaosMonkeyAdapter) Test(sem *chaosmonkey.Semaphore) {
cma.testReport.Skipped = "skipping test " + cma.test.Name()
return
}
fmt.Printf("DEBUG: starting test\n")
cma.framework.BeforeEach()
fmt.Printf("DEBUG: starting test, setup\n")
cma.test.Setup(cma.framework)
defer cma.test.Teardown(cma.framework)
ready()
Expand Down