Skip to content
Merged
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
17 changes: 17 additions & 0 deletions functests/cincinnati_creation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/tls"
"fmt"
"net/http"
"os"
"testing"

routev1 "github.com/openshift/api/route/v1"
Expand All @@ -13,9 +14,25 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog"
client "sigs.k8s.io/controller-runtime/pkg/client"
)

// TestMain will perform test setup, exec each test, and perform test tear down.
func TestMain(m *testing.M) {
setUp()
retCode := m.Run()
os.Exit(retCode)
}

// setUp performs test setup.
func setUp() {
if err := routev1.AddToScheme(scheme.Scheme); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you dropped this?

if err := apis.AddToScheme(scheme.Scheme); err != nil {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we don't import that yet. We can add it with the commit that adds the import

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you're just adding back stuff that shouldn't have been removed to begin with. I should have caught it and commented in in the Remove Ginkgp commit so not understanding why this commit doen't just add it all back in.

Copy link
Member Author

@wking wking Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to add the route scheme (twice?). And out local APIs, which you link. I dunno why we don't actually need the local-API schemes injected, but tests are green, so we must not need them.

klog.Fatalf("Failed adding route to scheme, %v", err)
}
}

func TestCustomResource(t *testing.T) {
k8sClient, err := getK8sClient()
if err != nil {
Expand Down