@@ -18,8 +18,10 @@ import (
1818)
1919
2020const (
21- defaultTimeout = 30 * time .Second
22- defaultPoll = 1 * time .Second
21+ defaultTimeout = 30 * time .Second
22+ defaultPoll = 1 * time .Second
23+ testCatalogRef = "localhost/testdata/catalogs/test-catalog:e2e"
24+ testCatalogName = "test-catalog"
2325)
2426
2527var _ = Describe ("Operator Install" , func () {
@@ -33,7 +35,7 @@ var _ = Describe("Operator Install", func() {
3335 When ("An operator is installed from an operator catalog" , func () {
3436 BeforeEach (func () {
3537 ctx = context .Background ()
36- pkgName = "argocd-operator "
38+ pkgName = "prometheus "
3739 operatorName = fmt .Sprintf ("operator-%s" , rand .String (8 ))
3840 operator = & operatorv1alpha1.Operator {
3941 ObjectMeta : metav1.ObjectMeta {
@@ -45,15 +47,13 @@ var _ = Describe("Operator Install", func() {
4547 }
4648 operatorCatalog = & catalogd.Catalog {
4749 ObjectMeta : metav1.ObjectMeta {
48- Name : "test-catalog" ,
50+ Name : testCatalogName ,
4951 },
5052 Spec : catalogd.CatalogSpec {
5153 Source : catalogd.CatalogSource {
5254 Type : catalogd .SourceTypeImage ,
5355 Image : & catalogd.ImageSource {
54- // (TODO): Set up a local image registry, and build and store a test catalog in it
55- // to use in the test suite
56- Ref : "quay.io/olmtest/e2e-index:single-package-fbc" , //generated from: "quay.io/operatorhubio/catalog:latest",
56+ Ref : testCatalogRef ,
5757 },
5858 },
5959 },
@@ -63,15 +63,15 @@ var _ = Describe("Operator Install", func() {
6363 err := c .Create (ctx , operatorCatalog )
6464 Expect (err ).ToNot (HaveOccurred ())
6565 Eventually (func (g Gomega ) {
66- err = c .Get (ctx , types.NamespacedName {Name : "test-catalog" }, operatorCatalog )
66+ err = c .Get (ctx , types.NamespacedName {Name : testCatalogName }, operatorCatalog )
6767 g .Expect (err ).ToNot (HaveOccurred ())
6868 g .Expect (len (operatorCatalog .Status .Conditions )).To (Equal (1 ))
6969 cond := apimeta .FindStatusCondition (operatorCatalog .Status .Conditions , catalogd .TypeUnpacked )
7070 g .Expect (cond ).ToNot (BeNil ())
7171 g .Expect (cond .Status ).To (Equal (metav1 .ConditionTrue ))
7272 g .Expect (cond .Reason ).To (Equal (catalogd .ReasonUnpackSuccessful ))
7373 g .Expect (cond .Message ).To (ContainSubstring ("successfully unpacked the catalog image" ))
74- }).WithTimeout (5 * time . Minute ).WithPolling (defaultPoll ).Should (Succeed ())
74+ }).WithTimeout (defaultTimeout ).WithPolling (defaultPoll ).Should (Succeed ())
7575
7676 By ("creating the Operator resource" )
7777 err = c .Create (ctx , operator )
0 commit comments