@@ -12,6 +12,7 @@ import (
1212
1313 "github.com/golang/protobuf/proto"
1414 "github.com/stretchr/testify/assert"
15+ "github.com/stretchr/testify/require"
1516
1617 "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils"
1718 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin"
@@ -237,47 +238,47 @@ func TestEnableDisableLaunchPlan(t *testing.T) {
237238 createWorkflowReq := getWorkflowCreateRequest ()
238239
239240 _ , err := client .CreateWorkflow (ctx , & createWorkflowReq )
240- assert . Nil (t , err )
241+ require . NoError (t , err , "create workflow" )
241242
242243 createLaunchPlanReq := getLaunchPlanCreateRequest (createWorkflowReq .Id )
243244 _ , err = client .CreateLaunchPlan (ctx , & createLaunchPlanReq )
244- assert . Nil (t , err )
245+ require . NoError (t , err , "create launch plan" )
245246
246247 // Test that enabling a launch plan succeeds.
247248 _ , err = client .UpdateLaunchPlan (ctx , & admin.LaunchPlanUpdateRequest {
248249 Id : & launchPlanIdentifier ,
249250 State : admin .LaunchPlanState_ACTIVE ,
250251 })
251- assert . Nil (t , err )
252+ require . NoError (t , err , "activate launch plan" )
252253 enabledLaunchPlan , err := client .GetLaunchPlan (ctx , & admin.ObjectGetRequest {
253254 Id : createLaunchPlanReq .Id ,
254255 })
255- assert . Nil (t , err )
256+ require . NoError (t , err , "get active launch plan" )
256257 assert .Equal (t , admin .LaunchPlanState_ACTIVE , enabledLaunchPlan .Closure .State )
257258
258259 // Make sure successive calls to set active are ... successful.
259260 _ , err = client .UpdateLaunchPlan (ctx , & admin.LaunchPlanUpdateRequest {
260261 Id : createLaunchPlanReq .Id ,
261262 State : admin .LaunchPlanState_ACTIVE ,
262263 })
263- assert . Nil (t , err )
264+ require . NoError (t , err , "activate launch plan again" )
264265 enabledLaunchPlan , err = client .GetLaunchPlan (ctx , & admin.ObjectGetRequest {
265266 Id : createLaunchPlanReq .Id ,
266267 })
267- assert . Nil (t , err )
268+ require . NoError (t , err , "get active launch plan again" )
268269 assert .Equal (t , admin .LaunchPlanState_ACTIVE , enabledLaunchPlan .Closure .State )
269270
270271 // Test that disabling a launch plan succeeds.
271272 _ , err = client .UpdateLaunchPlan (ctx , & admin.LaunchPlanUpdateRequest {
272273 Id : & launchPlanIdentifier ,
273274 State : admin .LaunchPlanState_INACTIVE ,
274275 })
275- assert . Nil (t , err )
276+ require . NoError (t , err , "deactivate launch plan" )
276277
277278 disabledLaunchPlan , err := client .GetLaunchPlan (ctx , & admin.ObjectGetRequest {
278279 Id : createLaunchPlanReq .Id ,
279280 })
280- assert . Nil (t , err )
281+ require . NoError (t , err , "get inactive launch plan" )
281282 assert .Equal (t , admin .LaunchPlanState_INACTIVE , disabledLaunchPlan .Closure .State )
282283}
283284
@@ -293,18 +294,18 @@ func TestUpdateActiveLaunchPlanVersion(t *testing.T) {
293294 createWorkflowReq := getWorkflowCreateRequest ()
294295
295296 _ , err := client .CreateWorkflow (ctx , & createWorkflowReq )
296- assert . Nil (t , err )
297+ require . NoError (t , err , "create workflow" )
297298
298299 // Create a test launch plan and set it to active.
299300 createLaunchPlanReq := getLaunchPlanCreateRequest (createWorkflowReq .Id )
300301 _ , err = client .CreateLaunchPlan (ctx , & createLaunchPlanReq )
301- assert . Nil (t , err )
302+ require . NoError (t , err , "create original launch plan" )
302303
303304 _ , err = client .UpdateLaunchPlan (ctx , & admin.LaunchPlanUpdateRequest {
304305 Id : & launchPlanIdentifier ,
305306 State : admin .LaunchPlanState_ACTIVE ,
306307 })
307- assert . Nil (t , err )
308+ require . NoError (t , err , "activate original launch plan" )
308309
309310 // Create a new version of the launch plan and set that to active.
310311 newIdentifier := core.Identifier {
@@ -317,25 +318,25 @@ func TestUpdateActiveLaunchPlanVersion(t *testing.T) {
317318 createNewLaunchPlanReq := getLaunchPlanCreateRequest (createWorkflowReq .Id )
318319 createNewLaunchPlanReq .Id = & newIdentifier
319320 _ , err = client .CreateLaunchPlan (ctx , & createNewLaunchPlanReq )
320- assert . Nil (t , err )
321+ require . NoError (t , err , "create new launch plan version" )
321322
322323 _ , err = client .UpdateLaunchPlan (ctx , & admin.LaunchPlanUpdateRequest {
323324 Id : & newIdentifier ,
324325 State : admin .LaunchPlanState_ACTIVE ,
325326 })
326- assert . Nil (t , err )
327+ require . NoError (t , err , "activate new launch plan version" )
327328
328329 enabledLaunchPlan , err := client .GetLaunchPlan (ctx , & admin.ObjectGetRequest {
329330 Id : & newIdentifier ,
330331 })
331- assert . Nil (t , err )
332+ require . NoError (t , err , "get new launch plan version" )
332333 assert .Equal (t , admin .LaunchPlanState_ACTIVE , enabledLaunchPlan .Closure .State )
333334
334335 // Assert that by enabling a specific launch version admin also disables the previously active version.
335336 disabledLaunchPlan , err := client .GetLaunchPlan (ctx , & admin.ObjectGetRequest {
336337 Id : & launchPlanIdentifier ,
337338 })
338- assert . Nil (t , err )
339+ require . NoError (t , err , "get original launch plan version" )
339340 assert .Equal (t , admin .LaunchPlanState_INACTIVE , disabledLaunchPlan .Closure .State )
340341}
341342
0 commit comments