Skip to content

Commit

Permalink
RHOAIENG-15772: tests(nbcs): use the direct (uncached) client to driv…
Browse files Browse the repository at this point in the history
…e tests (#461)

This is in accordance with the recommendations in the Kubebuilder Book.
https://book.kubebuilder.io/cronjob-tutorial/writing-tests
  • Loading branch information
jiridanek authored Nov 19, 2024
1 parent 73d8936 commit f2fa34e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion components/notebook-controller/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ var _ = BeforeSuite(func() {
Expect(err).ToNot(HaveOccurred(), "failed to run manager")
}()

k8sClient = k8sManager.GetClient()
Expect(k8sClient).ToNot(BeNil())

}, 60)
Expand Down
5 changes: 2 additions & 3 deletions components/odh-notebook-controller/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var _ = BeforeSuite(func() {
}
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseFlagOptions(&opts)))

// Initiliaze test environment:
// Initialize test environment:
// https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest#Environment.Start
By("Bootstrapping test environment")
envTest = &envtest.Environment{
Expand All @@ -110,7 +110,7 @@ var _ = BeforeSuite(func() {
utilruntime.Must(netv1.AddToScheme(scheme))
// +kubebuilder:scaffold:scheme

// Initiliaze Kubernetes client
// Initialize Kubernetes client
cli, err = client.New(cfg, client.Options{Scheme: scheme})
Expect(err).NotTo(HaveOccurred())
Expect(cli).NotTo(BeNil())
Expand Down Expand Up @@ -172,7 +172,6 @@ var _ = BeforeSuite(func() {
}).Should(Succeed())

// Verify kubernetes client is working
cli = mgr.GetClient()
Expect(cli).ToNot(BeNil())

for _, namespace := range testNamespaces {
Expand Down

0 comments on commit f2fa34e

Please sign in to comment.