Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions cmd/openshift-tests/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
9 changes: 9 additions & 0 deletions pkg/test/ginkgo/options_monitor_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 6 additions & 1 deletion test/extended/util/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down