Skip to content

Commit 11244cf

Browse files
Merge pull request #30305 from smg247/filter-k8s-cl
TRT-1854: remove upstream annotation framework
2 parents c49344f + 0fe3840 commit 11244cf

File tree

4 files changed

+8
-14093
lines changed

4 files changed

+8
-14093
lines changed

pkg/test/extensions/binary.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ 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-
3230
"github.com/openshift/origin/pkg/clioptions/clusterdiscovery"
3331
"github.com/openshift/origin/pkg/clioptions/imagesetup"
3432
"github.com/openshift/origin/pkg/clioptions/upgradeoptions"
@@ -76,17 +74,17 @@ func InitializeOpenShiftTestsExtensionFramework() (*extension.Registry, *extensi
7674
return nil, nil, fmt.Errorf("failed to build extension test specs: %w", err)
7775
}
7876

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-
8677
klog.Infof("Found %d test specs", len(specs))
8778
// Filter out kube tests, vendor filtering isn't working within origin
8879
specs = specs.Select(func(spec *extensiontests.ExtensionTestSpec) bool {
89-
return !strings.Contains(spec.Name, "[Suite:k8s")
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
9088
})
9189
klog.Infof("%d test specs remain, after filtering out k8s", len(specs))
9290

0 commit comments

Comments
 (0)