Skip to content

Commit ea3ffa0

Browse files
committed
TEST/MINOR: fix usage of testify NoError
the way we were using suite.NoError was not stopping the test in case of error. Fixing this.
1 parent 957d3d3 commit ea3ffa0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+137
-137
lines changed

deploy/tests/e2e/access-control/access_control_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (suite *AccessControlSuite) Test_Whitelist() {
4444
{"allow-list", " 192.168.2.0/24"},
4545
}
4646

47-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
47+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
4848

4949
suite.eventuallyReturns("192.168.2.3", http.StatusOK)
5050
suite.eventuallyReturns("192.168.5.3", http.StatusForbidden)
@@ -57,7 +57,7 @@ func (suite *AccessControlSuite) Test_Whitelist() {
5757
{"whitelist", "192.168.4.0/24"},
5858
}
5959

60-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
60+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
6161

6262
suite.eventuallyReturns("192.168.4.3", http.StatusOK)
6363
suite.eventuallyReturns("192.168.5.3", http.StatusForbidden)
@@ -71,7 +71,7 @@ func (suite *AccessControlSuite) Test_Whitelist() {
7171
{"allow-list", "192.168.5.0/24"},
7272
}
7373

74-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
74+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
7575

7676
suite.eventuallyReturns("192.168.5.3", http.StatusOK)
7777
suite.eventuallyReturns("192.168.4.3", http.StatusForbidden)
@@ -84,8 +84,8 @@ func (suite *AccessControlSuite) Test_Whitelist() {
8484
{"allow-list", " patterns/ips"},
8585
}
8686

87-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
88-
suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
87+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
88+
suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
8989

9090
suite.eventuallyReturns("192.168.0.3", http.StatusOK)
9191
suite.eventuallyReturns("192.168.2.3", http.StatusForbidden)
@@ -98,8 +98,8 @@ func (suite *AccessControlSuite) Test_Whitelist() {
9898
{"whitelist", " patterns/ips2"},
9999
}
100100

101-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
102-
suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
101+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
102+
suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
103103

104104
suite.eventuallyReturns("192.169.0.3", http.StatusOK)
105105
suite.eventuallyReturns("192.168.2.3", http.StatusForbidden)
@@ -113,8 +113,8 @@ func (suite *AccessControlSuite) Test_Whitelist() {
113113
{"allow-list", " patterns/ips"},
114114
}
115115

116-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
117-
suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
116+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
117+
suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
118118

119119
suite.eventuallyReturns("192.168.0.3", http.StatusOK)
120120
suite.eventuallyReturns("192.168.2.3", http.StatusForbidden)
@@ -129,7 +129,7 @@ func (suite *AccessControlSuite) Test_Blacklist() {
129129
{"deny-list", " 192.168.2.0/24"},
130130
}
131131

132-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
132+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
133133

134134
suite.eventuallyReturns("192.168.2.3", http.StatusForbidden)
135135
suite.eventuallyReturns("192.168.5.3", http.StatusOK)
@@ -142,7 +142,7 @@ func (suite *AccessControlSuite) Test_Blacklist() {
142142
{"blacklist", "192.168.4.0/24"},
143143
}
144144

145-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
145+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
146146

147147
suite.eventuallyReturns("192.168.4.3", http.StatusForbidden)
148148
suite.eventuallyReturns("192.168.5.3", http.StatusOK)
@@ -156,7 +156,7 @@ func (suite *AccessControlSuite) Test_Blacklist() {
156156
{"deny-list", "192.168.5.0/24"},
157157
}
158158

159-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
159+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
160160

161161
suite.eventuallyReturns("192.168.5.3", http.StatusForbidden)
162162
suite.eventuallyReturns("192.168.4.3", http.StatusOK)
@@ -169,8 +169,8 @@ func (suite *AccessControlSuite) Test_Blacklist() {
169169
{"deny-list", "patterns/ips"},
170170
}
171171

172-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
173-
suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
172+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
173+
suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
174174

175175
suite.eventuallyReturns("192.168.0.3", http.StatusForbidden)
176176
suite.eventuallyReturns("192.168.2.3", http.StatusOK)
@@ -183,8 +183,8 @@ func (suite *AccessControlSuite) Test_Blacklist() {
183183
{"blacklist", " patterns/ips2"},
184184
}
185185

186-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
187-
suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
186+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
187+
suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
188188

189189
suite.eventuallyReturns("192.169.0.3", http.StatusForbidden)
190190
suite.eventuallyReturns("192.168.2.3", http.StatusOK)
@@ -197,8 +197,8 @@ func (suite *AccessControlSuite) Test_Blacklist() {
197197
{"deny-list", "patterns/ips"},
198198
}
199199

200-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
201-
suite.NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
200+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
201+
suite.Require().NoError(suite.test.Apply("config/patternfile-a.yml", "", nil))
202202

203203
suite.eventuallyReturns("192.168.0.3", http.StatusForbidden)
204204
suite.eventuallyReturns("192.169.2.3", http.StatusOK)

deploy/tests/e2e/access-control/suite_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ type tmplData struct {
3939
func (suite *AccessControlSuite) SetupSuite() {
4040
var err error
4141
suite.test, err = e2e.NewTest()
42-
suite.NoError(err)
42+
suite.Require().NoError(err)
4343
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4444
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
45-
suite.NoError(err)
45+
suite.Require().NoError(err)
4646

47-
suite.NoError(suite.test.Apply("config/patternfile-empty.yml", "", nil))
47+
suite.Require().NoError(suite.test.Apply("config/patternfile-empty.yml", "", nil))
4848
}
4949

5050
func (suite *AccessControlSuite) TearDownSuite() {

deploy/tests/e2e/admin-port/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ type tmplData struct {
3838
func (suite *AdminPortSuite) SetupSuite() {
3939
var err error
4040
suite.test, err = e2e.NewTest()
41-
suite.NoError(err)
41+
suite.Require().NoError(err)
4242
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4343
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
44-
suite.NoError(err)
44+
suite.Require().NoError(err)
4545
}
4646

4747
func (suite *AdminPortSuite) TearDownSuite() {

deploy/tests/e2e/basic-auth/basic_auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
func (suite *HTTPBasicAuthSuite) Test_BasicAuth() {
2626
suite.Run("Denied", func() {
27-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
27+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
2828
suite.Require().Eventually(func() bool {
2929
res, cls, err := suite.client.Do()
3030
if res == nil {

deploy/tests/e2e/basic-auth/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ type tmplData struct {
3838
func (suite *HTTPBasicAuthSuite) SetupSuite() {
3939
var err error
4040
suite.test, err = e2e.NewTest()
41-
suite.NoError(err)
41+
suite.Require().NoError(err)
4242
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4343
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
44-
suite.NoError(err)
44+
suite.Require().NoError(err)
4545
}
4646

4747
func (suite *HTTPBasicAuthSuite) TearDownSuite() {

deploy/tests/e2e/canary-deployment/percentage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (suite *CanaryDeploymentSuite) Test_Response_Percentage() {
2828
for _, percentage := range []int{0, 25, 100} {
2929
suite.Run(fmt.Sprintf("%d", percentage), func() {
3030
suite.tmplData.StagingRouteACL = fmt.Sprintf("rand(100) lt %d", percentage)
31-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
31+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
3232
suite.Eventually(func() bool {
3333
counter := 0
3434
for i := 0; i < 10; i++ {

deploy/tests/e2e/canary-deployment/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ type tmplData struct {
4141
func (suite *CanaryDeploymentSuite) SetupSuite() {
4242
var err error
4343
suite.test, err = e2e.NewTest()
44-
suite.NoError(err)
44+
suite.Require().NoError(err)
4545
suite.tmplData = tmplData{
4646
Host: suite.test.GetNS() + ".test",
4747
StagingRouteACL: "rand(100) lt 0",
4848
}
4949
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
50-
suite.NoError(err)
50+
suite.Require().NoError(err)
5151
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
5252
suite.Require().Eventually(func() bool {
5353
res, cls, err := suite.client.Do()

deploy/tests/e2e/config-snippet/backend_cfg_snippet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func (suite *ConfigSnippetSuite) TestBackendCfgSnippet() {
27-
suite.NoError(suite.test.Apply("config/backend-cfg-snippet.yaml", suite.test.GetNS(), nil))
27+
suite.Require().NoError(suite.test.Apply("config/backend-cfg-snippet.yaml", suite.test.GetNS(), nil))
2828
suite.Eventually(func() bool {
2929
res, cls, err := suite.client.Do()
3030
if err != nil {

deploy/tests/e2e/config-snippet/frontend_cfg_snippet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func (suite *ConfigSnippetSuite) TestFrontendCfgSnippet() {
27-
suite.NoError(suite.test.Apply("config/configmap.yaml", "", nil))
27+
suite.Require().NoError(suite.test.Apply("config/configmap.yaml", "", nil))
2828
suite.Eventually(func() bool {
2929
res, cls, err := suite.client.Do()
3030
if err != nil {

deploy/tests/e2e/config-snippet/suite_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ type tmplData struct {
3838
func (suite *ConfigSnippetSuite) SetupSuite() {
3939
var err error
4040
suite.test, err = e2e.NewTest()
41-
suite.NoError(err)
41+
suite.Require().NoError(err)
4242
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4343
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
44-
suite.NoError(err)
45-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
44+
suite.Require().NoError(err)
45+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
4646
suite.Require().Eventually(func() bool {
4747
res, cls, err := suite.client.Do()
4848
if res == nil {

deploy/tests/e2e/cors/cors_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (suite *CorsSuite) Test_Configmap_Alone() {
4646
suite.Run("CorsMethodsCredentialAlone", suite.CorsMethodsCredentialAlone(false))
4747
suite.Run("CorsDisable", suite.CorsDisable(false))
4848
suite.Run("CorsMethodsCredentialDisable", suite.CorsMethodsCredentialDisable(false))
49-
suite.NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil))
49+
suite.Require().NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil))
5050
}
5151

5252
func (suite *CorsSuite) Test_Ingress_Alone() {
@@ -116,7 +116,7 @@ func (suite *CorsSuite) Default(ingressCors bool) func() {
116116
yamlFile = "config/configmap.yaml.tmpl"
117117
ns = ""
118118
}
119-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
119+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
120120

121121
suite.eventuallyReturns(expectedHeaders, unexpectedHeaders)
122122
}
@@ -148,7 +148,7 @@ func (suite *CorsSuite) CorsOriginAlone(ingressCors bool) func() {
148148
yamlFile = "config/configmap.yaml.tmpl"
149149
ns = ""
150150
}
151-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
151+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
152152

153153
suite.eventuallyReturns(expectedHeaders, unexpectedHeaders)
154154
}
@@ -180,7 +180,7 @@ func (suite *CorsSuite) CorsMethodsAlone(ingressCors bool) func() {
180180
yamlFile = "config/configmap.yaml.tmpl"
181181
ns = ""
182182
}
183-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
183+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
184184

185185
suite.eventuallyReturns(expectedHeaders, unexpectedHeaders)
186186
}
@@ -212,7 +212,7 @@ func (suite *CorsSuite) CorsMethodsHeadersAlone(ingressCors bool) func() {
212212
yamlFile = "config/configmap.yaml.tmpl"
213213
ns = ""
214214
}
215-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
215+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
216216

217217
suite.eventuallyReturns(expectedHeaders, unexpectedHeaders)
218218
}
@@ -244,7 +244,7 @@ func (suite *CorsSuite) CorsMethodsAgeAlone(ingressCors bool) func() {
244244
yamlFile = "config/configmap.yaml.tmpl"
245245
ns = ""
246246
}
247-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
247+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
248248

249249
suite.eventuallyReturns(expectedHeaders, unexpectedHeaders)
250250
}
@@ -276,7 +276,7 @@ func (suite *CorsSuite) CorsMethodsCredentialDisable(ingressCors bool) func() {
276276
yamlFile = "config/configmap.yaml.tmpl"
277277
ns = ""
278278
}
279-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
279+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
280280

281281
suite.eventuallyReturns(expectedHeaders, unexpectedHeaders)
282282
}
@@ -305,7 +305,7 @@ func (suite *CorsSuite) CorsMethodsCredentialAlone(ingressCors bool) func() {
305305
yamlFile = "config/configmap.yaml.tmpl"
306306
ns = ""
307307
}
308-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
308+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
309309

310310
suite.eventuallyReturns(expectedHeaders, http.Header{})
311311
}
@@ -339,7 +339,7 @@ func (suite *CorsSuite) CorsDisable(ingressCors bool) func() {
339339
yamlFile = "config/configmap.yaml.tmpl"
340340
ns = ""
341341
}
342-
suite.NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
342+
suite.Require().NoError(suite.test.Apply(yamlFile, ns, suite.tmplData))
343343
suite.eventuallyReturns(http.Header{}, unexpectedHeaders)
344344
}
345345
}

deploy/tests/e2e/cors/suite_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ type tmplData struct {
4040
func (suite *CorsSuite) SetupSuite() {
4141
var err error
4242
suite.test, err = e2e.NewTest()
43-
suite.NoError(err)
43+
suite.Require().NoError(err)
4444
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
4545
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
46-
suite.NoError(err)
46+
suite.Require().NoError(err)
4747

48-
suite.NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil))
49-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"}))
48+
suite.Require().NoError(suite.test.Apply("../../config/2.configmap.yaml", "", nil))
49+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"}))
5050
}
5151

5252
func (suite *CorsSuite) TearDownSuite() {
5353
// suite.test.Apply("../../config/2.configmap.yaml", "", nil)
54-
suite.NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"}))
54+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml.tmpl", suite.test.GetNS(), tmplData{Host: suite.test.GetNS() + ".test"}))
5555
suite.test.TearDown()
5656
}
5757

deploy/tests/e2e/crd/cr_global_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ func (suite *GlobalSuite) Test_CR_Global() {
5353

5454
// Get updated config and do all neede param checks
5555
cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg")
56-
suite.NoError(err, "Could not get Haproxy config")
56+
suite.Require().NoError(err, "Could not get Haproxy config")
5757
reader := strings.NewReader(cfg)
5858
p, err := parser.New(options.Reader(reader))
59-
suite.NoError(err, "Could not get Haproxy config parser")
59+
suite.Require().NoError(err, "Could not get Haproxy config parser")
6060
suite.checkGlobalParam(p, "default-path", &types.DefaultPath{
6161
Type: "config",
6262
})
@@ -213,12 +213,12 @@ func (suite *GlobalSuite) Test_CR_Global() {
213213

214214
func (suite *GlobalSuite) checkGlobalParam(p parser.Parser, param string, value common.ParserData) {
215215
v, err := p.Get(parser.Global, parser.GlobalSectionName, param)
216-
suite.NoError(err, "Could not get Haproxy config parser Global param %s", param)
216+
suite.Require().NoError(err, "Could not get Haproxy config parser Global param %s", param)
217217
suite.Equal(value, v, fmt.Sprintf("Global param %s should be equal to %v but is %v", param, value, v))
218218
}
219219

220220
func (suite *GlobalSuite) checkLogTargetParam(p parser.Parser, param string, value common.ParserData) {
221221
v, err := p.GetOne(parser.Global, parser.GlobalSectionName, param, 0)
222-
suite.NoError(err, "Could not get Haproxy config parser Global param %s", param)
222+
suite.Require().NoError(err, "Could not get Haproxy config parser Global param %s", param)
223223
suite.Equal(value, v, fmt.Sprintf("Global param %s should be equal to %v but is %v", param, value, v))
224224
}

deploy/tests/e2e/crd/suite_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ type tmplData struct {
5050
func (suite *CRDSuite) SetupSuite() {
5151
var err error
5252
suite.test, err = e2e.NewTest()
53-
suite.NoError(err)
53+
suite.Require().NoError(err)
5454
suite.tmplData = tmplData{Host: suite.test.GetNS() + ".test"}
5555
suite.client, err = e2e.NewHTTPClient(suite.tmplData.Host)
56-
suite.NoError(err)
57-
suite.NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil))
58-
suite.NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
56+
suite.Require().NoError(err)
57+
suite.Require().NoError(suite.test.Apply("config/deploy.yaml", suite.test.GetNS(), nil))
58+
suite.Require().NoError(suite.test.Apply("config/ingress.yaml.tmpl", suite.test.GetNS(), suite.tmplData))
5959
suite.Require().Eventually(func() bool {
6060
r, cls, err := suite.client.Do()
6161
if err != nil {
@@ -72,10 +72,10 @@ func (suite *CRDSuite) TearDownSuite() {
7272

7373
func (suite *CRDSuite) getVersion() int64 {
7474
cfg, err := suite.test.GetIngressControllerFile("/etc/haproxy/haproxy.cfg")
75-
suite.NoError(err, "Could not get Haproxy config")
75+
suite.Require().NoError(err, "Could not get Haproxy config")
7676
reader := strings.NewReader(cfg)
7777
p, err := parser.New(options.Reader(reader))
78-
suite.NoError(err, "Could not get Haproxy config parser")
78+
suite.Require().NoError(err, "Could not get Haproxy config parser")
7979

8080
data, _ := p.Get(parser.Comments, parser.CommentsSectionName, "# _version", false)
8181

0 commit comments

Comments
 (0)