github.com/metaprov/modela-operator@v0.0.0-20240118193048-f378be8b74d2/controllers/components/online_store_test.go (about)

     1  package components
     2  
     3  import (
     4  	"context"
     5  	"github.com/metaprov/modela-operator/api/v1alpha1"
     6  	. "github.com/onsi/ginkgo"
     7  	. "github.com/onsi/gomega"
     8  	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     9  )
    10  
    11  var _ = Describe("Online store installer", func() {
    12  	onlineStore := NewOnlineStore()
    13  
    14  	It("Should install redis", func() {
    15  		if installed, err := onlineStore.Installed(context.Background()); err == v1alpha1.ComponentNotInstalledByModelaError || installed {
    16  			Skip("Test should be run on an empty cluster")
    17  			return
    18  		}
    19  
    20  		Expect(onlineStore.Install(context.Background(), &v1alpha1.Modela{
    21  			ObjectMeta: v1.ObjectMeta{Name: "modela-test"},
    22  		})).To(BeNil())
    23  
    24  		By("Checking if it was installed")
    25  		installed, err := onlineStore.Installed(context.Background())
    26  		Expect(err).NotTo(HaveOccurred())
    27  		Expect(installed).To(BeTrue())
    28  	})
    29  })