diff --git a/cmd/openshift-tests/e2e.go b/cmd/openshift-tests/e2e.go index 5833a7e646b7..a26613d31401 100644 --- a/cmd/openshift-tests/e2e.go +++ b/cmd/openshift-tests/e2e.go @@ -9,6 +9,11 @@ import ( "github.com/openshift/origin/pkg/test/ginkgo" exutil "github.com/openshift/origin/test/extended/util" "k8s.io/kubectl/pkg/util/templates" + + // these register framework.NewFrameworkExtensions responsible for + // executing post-test actions, here debug and metrics gathering + // see https://github.com/kubernetes/kubernetes/blob/v1.26.0/test/e2e/framework/framework.go#L175-L181 + // for more details _ "k8s.io/kubernetes/test/e2e/framework/debug/init" _ "k8s.io/kubernetes/test/e2e/framework/metrics/init" diff --git a/pkg/test/ginkgo/options_monitor_events.go b/pkg/test/ginkgo/options_monitor_events.go index 278a9d10b380..9e2b43c69ee6 100644 --- a/pkg/test/ginkgo/options_monitor_events.go +++ b/pkg/test/ginkgo/options_monitor_events.go @@ -140,6 +140,15 @@ func (o *MonitorEventsOptions) End(ctx context.Context, restConfig *rest.Config, if d.IsDir() { return nil } + // upstream framework starting in 1.26 fixed how the AfterEach is + // invoked, now it's always invoked and that results in more files + // than we anticipated before, see here: + // https://github.com/kubernetes/kubernetes/blob/v1.26.0/test/e2e/framework/framework.go#L382 + // our files have double underscore whereas upstream has only single + // so for now we'll skip everything else for summaries + // + // TODO: TRT will need to double check this longterm what they want + // to do with these extra files if !strings.HasPrefix(d.Name(), "AdditionalEvents__") { return nil } diff --git a/test/extended/util/client.go b/test/extended/util/client.go index 939e25ebaaf4..def8cd152a18 100644 --- a/test/extended/util/client.go +++ b/test/extended/util/client.go @@ -155,8 +155,13 @@ func NewCLIWithoutNamespace(project string) *CLI { adminConfigPath: KubeConfigPath(), withoutNamespace: true, } - g.AfterEach(cli.TeardownProject) g.BeforeEach(cli.kubeFramework.BeforeEach) + + // we can't use k8s initialization method to inject these into framework.NewFrameworkExtensions + // because we need to have an instance of CLI, so we're rely on the less optimal ginkgo.AfterEach + // in case where this method fails, framework cleans up the entire namespace so we should be + // safe on that front, still. + g.AfterEach(cli.TeardownProject) return cli }