@@ -5,17 +5,17 @@ import (
5
5
"net/http"
6
6
"net/http/httptest"
7
7
8
- . "github.com/onsi/ginkgo/v2"
9
- . "github.com/onsi/gomega"
8
+ "github.com/onsi/ginkgo/v2"
9
+ "github.com/onsi/gomega"
10
10
"github.com/rancher/system-upgrade-controller/e2e/framework"
11
11
upgradeapiv1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1"
12
12
upgradeplan "github.com/rancher/system-upgrade-controller/pkg/upgrade/plan"
13
13
)
14
14
15
- var _ = Describe ("Resolve channel" , func () {
15
+ var _ = ginkgo . Describe ("Resolve channel" , func () {
16
16
e2e := framework .New ("channel" )
17
17
18
- When ("passed url fails to resolve" , func () {
18
+ ginkgo . When ("passed url fails to resolve" , func () {
19
19
var (
20
20
err error
21
21
plan * upgradeapiv1.Plan
@@ -25,45 +25,45 @@ var _ = Describe("Resolve channel", func() {
25
25
clusterID string
26
26
latest string
27
27
)
28
- BeforeEach (func () {
28
+ ginkgo . BeforeEach (func () {
29
29
ctx , cancel = context .WithCancel (context .Background ())
30
30
plan = e2e .NewPlan ("channel-" , "" , nil )
31
31
})
32
- AfterEach (func () {
32
+ ginkgo . AfterEach (func () {
33
33
if channelSrv != nil {
34
34
channelSrv .Close ()
35
35
}
36
36
cancel ()
37
37
})
38
- It ("channel server is up with correct address" , func () {
38
+ ginkgo . It ("channel server is up with correct address" , func () {
39
39
channelSrv = framework .ChannelServer ("/local" , http .StatusFound )
40
40
plan .Spec .Channel = channelSrv .URL
41
- Expect (plan .Spec .Channel ).ToNot (BeEmpty ())
41
+ gomega . Expect (plan .Spec .Channel ).ToNot (gomega . BeEmpty ())
42
42
plan , err = e2e .CreatePlan (plan )
43
- Expect (err ).ToNot (HaveOccurred ())
43
+ gomega . Expect (err ).ToNot (gomega . HaveOccurred ())
44
44
latest , err = upgradeplan .ResolveChannel (ctx , plan .Spec .Channel , plan .Status .LatestVersion , clusterID )
45
- Expect (err ).ToNot (HaveOccurred ())
46
- Expect (latest ).NotTo (BeEmpty ())
45
+ gomega . Expect (err ).ToNot (gomega . HaveOccurred ())
46
+ gomega . Expect (latest ).NotTo (gomega . BeEmpty ())
47
47
})
48
- It ("channel server is up but url not found" , func () {
48
+ ginkgo . It ("channel server is up but url not found" , func () {
49
49
channelSrv = framework .ChannelServer ("/local" , http .StatusNotFound )
50
50
plan .Spec .Channel = channelSrv .URL
51
- Expect (plan .Spec .Channel ).ToNot (BeEmpty ())
51
+ gomega . Expect (plan .Spec .Channel ).ToNot (gomega . BeEmpty ())
52
52
plan , err = e2e .CreatePlan (plan )
53
- Expect (err ).ToNot (HaveOccurred ())
53
+ gomega . Expect (err ).ToNot (gomega . HaveOccurred ())
54
54
latest , err = upgradeplan .ResolveChannel (ctx , plan .Spec .Channel , plan .Status .LatestVersion , clusterID )
55
- Expect (err ).To (HaveOccurred ())
56
- Expect (latest ).To (BeEmpty ())
55
+ gomega . Expect (err ).To (gomega . HaveOccurred ())
56
+ gomega . Expect (latest ).To (gomega . BeEmpty ())
57
57
})
58
- It ("Service Unavailable" , func () {
58
+ ginkgo . It ("Service Unavailable" , func () {
59
59
channelSrv = framework .ChannelServer ("/local" , http .StatusServiceUnavailable )
60
60
plan .Spec .Channel = channelSrv .URL
61
- Expect (plan .Spec .Channel ).ToNot (BeEmpty ())
61
+ gomega . Expect (plan .Spec .Channel ).ToNot (gomega . BeEmpty ())
62
62
plan , err = e2e .CreatePlan (plan )
63
- Expect (err ).ToNot (HaveOccurred ())
63
+ gomega . Expect (err ).ToNot (gomega . HaveOccurred ())
64
64
latest , err = upgradeplan .ResolveChannel (ctx , plan .Spec .Channel , plan .Status .LatestVersion , clusterID )
65
- Expect (err ).To (HaveOccurred ())
66
- Expect (latest ).To (BeEmpty ())
65
+ gomega . Expect (err ).To (gomega . HaveOccurred ())
66
+ gomega . Expect (latest ).To (gomega . BeEmpty ())
67
67
})
68
68
})
69
69
})
0 commit comments