Skip to content

Commit a21249f

Browse files
Merge pull request #30337 from jsafrane/revert-annotations
OCPBUGS-62701: Revert TRT-1854: remove upstream annotation framework
2 parents 3ded19e + 4d0cee2 commit a21249f

File tree

4 files changed

+14093
-8
lines changed

4 files changed

+14093
-8
lines changed

pkg/test/extensions/binary.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
"k8s.io/klog/v2"
2828
k8simage "k8s.io/kubernetes/test/utils/image"
2929

30+
k8sgenerated "k8s.io/kubernetes/openshift-hack/e2e/annotate/generated"
31+
3032
"github.com/openshift/origin/pkg/clioptions/clusterdiscovery"
3133
"github.com/openshift/origin/pkg/clioptions/imagesetup"
3234
"github.com/openshift/origin/pkg/clioptions/upgradeoptions"
@@ -74,17 +76,17 @@ func InitializeOpenShiftTestsExtensionFramework() (*extension.Registry, *extensi
7476
return nil, nil, fmt.Errorf("failed to build extension test specs: %w", err)
7577
}
7678

79+
// Apply annotations to test names only for upstream tests
80+
specs.Walk(func(spec *extensiontests.ExtensionTestSpec) {
81+
if append, ok := k8sgenerated.Annotations[spec.Name]; ok {
82+
spec.Name += append
83+
}
84+
})
85+
7786
klog.Infof("Found %d test specs", len(specs))
7887
// Filter out kube tests, vendor filtering isn't working within origin
7988
specs = specs.Select(func(spec *extensiontests.ExtensionTestSpec) bool {
80-
for _, cl := range spec.CodeLocations {
81-
// If there is a CodeLocation for origin, that isn't simply "framework" it is not a vendored test
82-
if strings.Contains(cl, "github.com/openshift/origin/") &&
83-
!strings.Contains(cl, "github.com/openshift/origin/test/extended/util/framework.go") {
84-
return true
85-
}
86-
}
87-
return false
89+
return !strings.Contains(spec.Name, "[Suite:k8s")
8890
})
8991
klog.Infof("%d test specs remain, after filtering out k8s", len(specs))
9092

0 commit comments

Comments
 (0)