Skip to content
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
48 changes: 44 additions & 4 deletions openshift-hack/cmd/k8s-tests-ext/k8s-tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package main

import (
"flag"
"fmt"
"os"
"reflect"
"strconv"

et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"

"k8s.io/kubernetes/openshift-hack/e2e/annotate/generated"
"k8s.io/kubernetes/test/e2e/framework"

Expand Down Expand Up @@ -51,22 +53,36 @@ func main() {
extensionRegistry.Register(kubeTestsExtension)

// Carve up the kube tests into our openshift suites...
kubeTestsExtension.AddSuite(e.Suite{
Name: "kubernetes/conformance/parallel/minimal",
Parents: []string{
"openshift/conformance/parallel/minimal",
},
Qualifiers: []string{withExcludedTestsFilter(`!name.contains('[Serial]') && labels.exists(l, l == "Conformance")`)},
})

kubeTestsExtension.AddSuite(e.Suite{
Name: "kubernetes/conformance/serial/minimal",
Parents: []string{
"openshift/conformance/serial/minimal",
},
Qualifiers: []string{withExcludedTestsFilter(`name.contains('[Serial]') && labels.exists(l, l == "Conformance")`)},
})

kubeTestsExtension.AddSuite(e.Suite{
Name: "kubernetes/conformance/parallel",
Parents: []string{
"openshift/conformance/parallel",
"openshift/conformance/parallel/minimal",
},
Qualifiers: []string{`!labels.exists(l, l == "Serial") && labels.exists(l, l == "Conformance")`},
Qualifiers: []string{withExcludedTestsFilter(`!name.contains('[Serial]')`)},
})

kubeTestsExtension.AddSuite(e.Suite{
Name: "kubernetes/conformance/serial",
Parents: []string{
"openshift/conformance/serial",
"openshift/conformance/serial/minimal",
},
Qualifiers: []string{`labels.exists(l, l == "Serial") && labels.exists(l, l == "Conformance")`},
Qualifiers: []string{withExcludedTestsFilter(`name.contains('[Serial]')`)},
})

for k, v := range image.GetOriginalImageConfigs() {
Expand Down Expand Up @@ -160,3 +176,27 @@ func convertToImage(obj interface{}) extension.Image {
}
return image
}

func withExcludedTestsFilter(baseExpr string) string {
excluded := []string{
"[Disabled:",
"[Disruptive]",
"[Skipped]",
"[Slow]",
"[Flaky]",
"[Local]",
}

filter := ""
for i, s := range excluded {
if i > 0 {
filter += " && "
}
filter += fmt.Sprintf("!name.contains('%s')", s)
}

if baseExpr != "" {
return fmt.Sprintf("(%s) && (%s)", baseExpr, filter)
}
return filter
}