@@ -353,6 +353,24 @@ func TestRunsCreate(t *testing.T) {
353
353
}
354
354
}
355
355
})
356
+
357
+ t .Run ("with policy paths" , func (t * testing.T ) {
358
+ skipUnlessBeta (t )
359
+
360
+ opts := RunCreateOptions {
361
+ Message : String ("creating with policy paths" ),
362
+ Workspace : wTest ,
363
+ PolicyPaths : []string {"./path/to/dir1" , "./path/to/dir2" },
364
+ }
365
+
366
+ r , err := client .Runs .Create (ctx , opts )
367
+ require .NoError (t , err )
368
+ require .NotEmpty (t , r .PolicyPaths )
369
+
370
+ assert .Len (t , r .PolicyPaths , 2 )
371
+ assert .Contains (t , r .PolicyPaths , "./path/to/dir1" )
372
+ assert .Contains (t , r .PolicyPaths , "./path/to/dir2" )
373
+ })
356
374
}
357
375
358
376
func TestRunsRead_CostEstimate (t * testing.T ) {
@@ -403,6 +421,31 @@ func TestRunsReadWithOptions(t *testing.T) {
403
421
})
404
422
}
405
423
424
+ func TestRunsReadWithPolicyPaths (t * testing.T ) {
425
+ skipUnlessBeta (t )
426
+
427
+ client := testClient (t )
428
+ ctx := context .Background ()
429
+
430
+ wTest , wTestCleanup := createWorkspace (t , client , nil )
431
+ t .Cleanup (wTestCleanup )
432
+
433
+ _ , cvCleanup := createUploadedConfigurationVersion (t , client , wTest )
434
+ t .Cleanup (cvCleanup )
435
+
436
+ r , err := client .Runs .Create (ctx , RunCreateOptions {
437
+ Workspace : wTest ,
438
+ PolicyPaths : []string {"./foo" },
439
+ })
440
+ require .NoError (t , err )
441
+
442
+ r , err = client .Runs .Read (ctx , r .ID )
443
+ require .NoError (t , err )
444
+
445
+ require .NotEmpty (t , r .PolicyPaths )
446
+ assert .Contains (t , r .PolicyPaths , "./foo" )
447
+ }
448
+
406
449
func TestRunsApply (t * testing.T ) {
407
450
client := testClient (t )
408
451
ctx := context .Background ()
0 commit comments