Skip to content

Commit

Permalink
Revert "add test for installation"
Browse files Browse the repository at this point in the history
This reverts commit abcec60.
  • Loading branch information
jensfr committed Jan 21, 2021
1 parent 622598c commit 013297a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 43 deletions.
34 changes: 1 addition & 33 deletions controllers/openshift_controller_test.go
Expand Up @@ -52,38 +52,6 @@ var _ = Describe("OpenShift KataConfig Controller", func() {
By("Creating marking the second KataConfig CR correctly")
Expect(kataconfig2.Status.InstallationStatus.Failed.FailedNodesCount).Should(Equal(-1))
})
It("Should return master in combined master/worker cluster", func() {
const (
name = "example-kataconfig"
)

kataconfig := &kataconfigurationv1.KataConfig{
TypeMeta: metav1.TypeMeta{
APIVersion: "kataconfiguration.openshift.io/v1",
Kind: "KataConfig",
},
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
}

key := types.NamespacedName{
Name: "example-kataconfig",
Namespace: "kata-operator-system",
}

const timeout = time.Second * 30
const interval = time.Second * 1

By("Creating the KataConfig CR successfully")
Expect(k8sClient.Create(context.Background(), kataconfig)).Should(Succeed())
time.Sleep(time.Second * 5)

exampleKataconfig := &kataconfigurationv1.KataConfig{}
Eventually(func() bool {
k8sClient.Get(context.Background(), key, exampleKataconfig)
return exampleKataconfig.Status.TotalNodesCount == exampleKataconfig.Status.InstallationStatus.Completed.CompletedNodesCount
}, timeout, interval).Should(BeTrue())
})
})

})
12 changes: 2 additions & 10 deletions controllers/suite_test.go
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package controllers

import (
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -58,15 +57,8 @@ var _ = BeforeSuite(func(done Done) {
logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))

By("bootstrapping test environment")
t := true
if os.Getenv("TEST_USE_EXISTING_CLUSTER") == "true" {
testEnv = &envtest.Environment{
UseExistingCluster: &t,
}
} else {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
}
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
}

var err error
Expand Down

0 comments on commit 013297a

Please sign in to comment.