Skip to content

Commit 3581fe4

Browse files
Merge pull request #30340 from smg247/re-remove-annotation-framework
TRT-1854: remove upstream annotation framework
2 parents 83a1f05 + b8d86a7 commit 3581fe4

File tree

4 files changed

+14
-14094
lines changed

4 files changed

+14
-14094
lines changed

pkg/test/extensions/binary.go

Lines changed: 14 additions & 11 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,22 @@ 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))
87-
// Filter out kube tests, vendor filtering isn't working within origin
78+
// Filter out kube tests (while retaining CSI tests), vendor filtering isn't working within origin
79+
csiPrefix := "External Storage"
8880
specs = specs.Select(func(spec *extensiontests.ExtensionTestSpec) bool {
89-
return !strings.Contains(spec.Name, "[Suite:k8s")
81+
// The CSI tests all have the same prefix, and we need to retain them all
82+
if strings.HasPrefix(spec.Name, csiPrefix) {
83+
return true
84+
}
85+
for _, cl := range spec.CodeLocations {
86+
// If there is a CodeLocation for origin, that isn't simply "framework" it is not a vendored test
87+
if strings.Contains(cl, "github.com/openshift/origin/") &&
88+
!strings.Contains(cl, "github.com/openshift/origin/test/extended/util/framework.go") {
89+
return true
90+
}
91+
}
92+
return false
9093
})
9194
klog.Infof("%d test specs remain, after filtering out k8s", len(specs))
9295

0 commit comments

Comments
 (0)