@@ -122,25 +122,22 @@ var _ = Describe("NginxGateway", Ordered, Label("functional", "nginxGateway"), f
122
122
return false
123
123
}
124
124
125
- return verifyNginxGatewayStatus (ng , int64 (1 )) ! = nil
125
+ return verifyNginxGatewayStatus (ng , int64 (1 )) = = nil
126
126
}).WithTimeout (timeoutConfig .UpdateTimeout ).
127
127
WithPolling (500 * time .Millisecond ).
128
128
Should (BeTrue ())
129
129
})
130
130
131
131
When ("testing NGF on startup" , func () {
132
132
When ("log level is set to debug" , func () {
133
- It ("outputs debug logs and the status is accepted and true " , func () {
133
+ It ("outputs debug logs and the status is valid " , func () {
134
134
ngfPodName , err := getNGFPodName ()
135
135
Expect (err ).ToNot (HaveOccurred ())
136
136
137
137
ng , err := getNginxGateway (nginxGatewayNsname )
138
138
Expect (err ).ToNot (HaveOccurred ())
139
139
140
- gen , err := getNginxGatewayCurrentObservedGeneration (ng )
141
- Expect (err ).ToNot (HaveOccurred ())
142
-
143
- Expect (verifyNginxGatewayStatus (ng , gen )).To (Succeed ())
140
+ Expect (verifyNginxGatewayStatus (ng , int64 (1 ))).To (Succeed ())
144
141
145
142
Eventually (
146
143
func () bool {
@@ -159,7 +156,7 @@ var _ = Describe("NginxGateway", Ordered, Label("functional", "nginxGateway"), f
159
156
})
160
157
161
158
When ("default log level is used" , func () {
162
- It ("only outputs info logs and the status is accepted and true " , func () {
159
+ It ("only outputs info logs and the status is valid " , func () {
163
160
teardown (releaseName )
164
161
165
162
cfg := getDefaultSetupCfg ()
@@ -169,12 +166,19 @@ var _ = Describe("NginxGateway", Ordered, Label("functional", "nginxGateway"), f
169
166
ngfPodName , err := getNGFPodName ()
170
167
Expect (err ).ToNot (HaveOccurred ())
171
168
172
- ng , err := getNginxGateway (nginxGatewayNsname )
173
- Expect (err ).ToNot (HaveOccurred ())
169
+ Eventually (
170
+ func () bool {
171
+ ng , err := getNginxGateway (nginxGatewayNsname )
172
+ if err != nil {
173
+ return false
174
+ }
174
175
175
- Expect (verifyNginxGatewayStatus (ng , int64 (1 ))).To (Succeed ())
176
+ return verifyNginxGatewayStatus (ng , int64 (1 )) == nil
177
+ }).WithTimeout (timeoutConfig .UpdateTimeout ).
178
+ WithPolling (500 * time .Millisecond ).
179
+ Should (BeTrue ())
176
180
177
- Eventually (
181
+ Consistently (
178
182
func () bool {
179
183
logs , err := resourceManager .GetPodLogs (ngfNamespace , ngfPodName , & core.PodLogOptions {
180
184
Container : "nginx-gateway" ,
@@ -199,8 +203,7 @@ var _ = Describe("NginxGateway", Ordered, Label("functional", "nginxGateway"), f
199
203
})
200
204
201
205
When ("NginxGateway is updated" , func () {
202
- It ("captures the change, the status is accepted and true," +
203
- " and the observed generation is incremented" , func () {
206
+ It ("captures the change, the status is valid, and the observed generation is incremented" , func () {
204
207
// previous test has left the log level at info, this test will change the log level to debug
205
208
ng , err := getNginxGateway (nginxGatewayNsname )
206
209
Expect (err ).ToNot (HaveOccurred ())
@@ -226,7 +229,7 @@ var _ = Describe("NginxGateway", Ordered, Label("functional", "nginxGateway"), f
226
229
return false
227
230
}
228
231
229
- return verifyNginxGatewayStatus (ng , gen + 1 ) ! = nil
232
+ return verifyNginxGatewayStatus (ng , gen + 1 ) = = nil
230
233
}).WithTimeout (timeoutConfig .UpdateTimeout ).
231
234
WithPolling (500 * time .Millisecond ).
232
235
Should (BeTrue ())
@@ -255,11 +258,7 @@ var _ = Describe("NginxGateway", Ordered, Label("functional", "nginxGateway"), f
255
258
Eventually (
256
259
func () error {
257
260
_ , err := getNginxGateway (nginxGatewayNsname )
258
- if err != nil {
259
- return err
260
- }
261
-
262
- return nil
261
+ return err
263
262
}).WithTimeout (timeoutConfig .DeleteTimeout ).
264
263
WithPolling (500 * time .Millisecond ).
265
264
Should (MatchError (ContainSubstring ("failed to get nginxGateway" )))
0 commit comments