@@ -18,8 +18,10 @@ import (
18
18
)
19
19
20
20
const (
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"
23
25
)
24
26
25
27
var _ = Describe ("Operator Install" , func () {
@@ -33,7 +35,7 @@ var _ = Describe("Operator Install", func() {
33
35
When ("An operator is installed from an operator catalog" , func () {
34
36
BeforeEach (func () {
35
37
ctx = context .Background ()
36
- pkgName = "argocd-operator "
38
+ pkgName = "prometheus "
37
39
operatorName = fmt .Sprintf ("operator-%s" , rand .String (8 ))
38
40
operator = & operatorv1alpha1.Operator {
39
41
ObjectMeta : metav1.ObjectMeta {
@@ -45,15 +47,13 @@ var _ = Describe("Operator Install", func() {
45
47
}
46
48
operatorCatalog = & catalogd.Catalog {
47
49
ObjectMeta : metav1.ObjectMeta {
48
- Name : "test-catalog" ,
50
+ Name : testCatalogName ,
49
51
},
50
52
Spec : catalogd.CatalogSpec {
51
53
Source : catalogd.CatalogSource {
52
54
Type : catalogd .SourceTypeImage ,
53
55
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 ,
57
57
},
58
58
},
59
59
},
@@ -63,15 +63,15 @@ var _ = Describe("Operator Install", func() {
63
63
err := c .Create (ctx , operatorCatalog )
64
64
Expect (err ).ToNot (HaveOccurred ())
65
65
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 )
67
67
g .Expect (err ).ToNot (HaveOccurred ())
68
68
g .Expect (len (operatorCatalog .Status .Conditions )).To (Equal (1 ))
69
69
cond := apimeta .FindStatusCondition (operatorCatalog .Status .Conditions , catalogd .TypeUnpacked )
70
70
g .Expect (cond ).ToNot (BeNil ())
71
71
g .Expect (cond .Status ).To (Equal (metav1 .ConditionTrue ))
72
72
g .Expect (cond .Reason ).To (Equal (catalogd .ReasonUnpackSuccessful ))
73
73
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 ())
75
75
76
76
By ("creating the Operator resource" )
77
77
err = c .Create (ctx , operator )
0 commit comments