@@ -63,11 +63,8 @@ func TestOperatorSpecs(t *testing.T) {
63
63
d := od
64
64
t .Run (d .comment , func (t * testing.T ) {
65
65
t .Parallel ()
66
- t .Logf ("Running %s" , d .comment )
67
- cl , err := newClient ()
68
- require .NoError (t , err )
69
- require .NotNil (t , cl )
70
- err = cl .Create (ctx , d .spec )
66
+ cl := newClient (t )
67
+ err := cl .Create (ctx , d .spec )
71
68
require .Error (t , err )
72
69
require .ErrorContains (t , err , d .errMsg )
73
70
})
@@ -104,10 +101,8 @@ func TestOperatorInvalidSemver(t *testing.T) {
104
101
d := sm
105
102
t .Run (d , func (t * testing.T ) {
106
103
t .Parallel ()
107
- cl , err := newClient ()
108
- require .NoError (t , err )
109
- require .NotNil (t , cl )
110
- err = cl .Create (ctx , operator (operatorsv1alpha1.OperatorSpec {
104
+ cl := newClient (t )
105
+ err := cl .Create (ctx , operator (operatorsv1alpha1.OperatorSpec {
111
106
PackageName : "package" ,
112
107
Version : d ,
113
108
}))
@@ -161,14 +156,12 @@ func TestOperatorValidSemver(t *testing.T) {
161
156
d := smx
162
157
t .Run (d , func (t * testing.T ) {
163
158
t .Parallel ()
159
+ cl := newClient (t )
164
160
op := operator (operatorsv1alpha1.OperatorSpec {
165
161
PackageName : "package" ,
166
162
Version : d ,
167
163
})
168
- cl , err := newClient ()
169
- require .NoError (t , err )
170
- require .NotNil (t , cl )
171
- err = cl .Create (ctx , op )
164
+ err := cl .Create (ctx , op )
172
165
require .NoErrorf (t , err , "unexpected error for semver range %q: %w" , d , err )
173
166
})
174
167
}
@@ -193,10 +186,8 @@ func TestOperatorInvalidChannel(t *testing.T) {
193
186
d := ch
194
187
t .Run (d , func (t * testing.T ) {
195
188
t .Parallel ()
196
- cl , err := newClient ()
197
- require .NoError (t , err )
198
- require .NotNil (t , cl )
199
- err = cl .Create (ctx , operator (operatorsv1alpha1.OperatorSpec {
189
+ cl := newClient (t )
190
+ err := cl .Create (ctx , operator (operatorsv1alpha1.OperatorSpec {
200
191
PackageName : "package" ,
201
192
Channel : d ,
202
193
}))
@@ -220,14 +211,12 @@ func TestOperatorValidChannel(t *testing.T) {
220
211
d := ch
221
212
t .Run (d , func (t * testing.T ) {
222
213
t .Parallel ()
214
+ cl := newClient (t )
223
215
op := operator (operatorsv1alpha1.OperatorSpec {
224
216
PackageName : "package" ,
225
217
Channel : d ,
226
218
})
227
- cl , err := newClient ()
228
- require .NoError (t , err )
229
- require .NotNil (t , cl )
230
- err = cl .Create (ctx , op )
219
+ err := cl .Create (ctx , op )
231
220
require .NoErrorf (t , err , "unexpected error creating valid channel %q: %w" , d , err )
232
221
})
233
222
}
0 commit comments