@@ -1068,8 +1068,11 @@ Summary Report for compliance: my-custom-spec
10681068 MisconfOptions : flag.MisconfOptions {IncludeNonFailures : true },
10691069 },
10701070 cacheContent : "testdata/s3andcloudtrailcache.json" ,
1071- allServices : []string {"s3" , "cloudtrail" },
1072- want : expectedS3AndCloudTrailResult ,
1071+ allServices : []string {
1072+ "s3" ,
1073+ "cloudtrail" ,
1074+ },
1075+ want : expectedS3AndCloudTrailResult ,
10731076 },
10741077 {
10751078 name : "skip certain services and include specific services" ,
@@ -1087,7 +1090,10 @@ Summary Report for compliance: my-custom-spec
10871090 MisconfOptions : flag.MisconfOptions {IncludeNonFailures : true },
10881091 },
10891092 cacheContent : "testdata/s3andcloudtrailcache.json" ,
1090- allServices : []string {"s3" , "cloudtrail" },
1093+ allServices : []string {
1094+ "s3" ,
1095+ "cloudtrail" ,
1096+ },
10911097 // we skip cloudtrail but still expect results from it as it is cached
10921098 want : expectedS3AndCloudTrailResult ,
10931099 },
@@ -1096,16 +1102,23 @@ Summary Report for compliance: my-custom-spec
10961102 options : flag.Options {
10971103 RegoOptions : flag.RegoOptions {SkipPolicyUpdate : true },
10981104 AWSOptions : flag.AWSOptions {
1099- Region : "us-east-1" ,
1100- SkipServices : []string {"cloudtrail" , "iam" },
1101- Account : "12345678" ,
1105+ Region : "us-east-1" ,
1106+ SkipServices : []string {
1107+ "cloudtrail" ,
1108+ "iam" ,
1109+ },
1110+ Account : "12345678" ,
11021111 },
11031112 CloudOptions : flag.CloudOptions {
11041113 MaxCacheAge : time .Hour * 24 * 365 * 100 ,
11051114 },
11061115 MisconfOptions : flag.MisconfOptions {IncludeNonFailures : true },
11071116 },
1108- allServices : []string {"s3" , "cloudtrail" , "iam" },
1117+ allServices : []string {
1118+ "s3" ,
1119+ "cloudtrail" ,
1120+ "iam" ,
1121+ },
11091122 cacheContent : "testdata/s3onlycache.json" ,
11101123 want : expectedS3ScanResult ,
11111124 },
@@ -1129,7 +1142,7 @@ Summary Report for compliance: my-custom-spec
11291142 },
11301143 }
11311144
1132- clock .SetFakeTime ( t , time .Date (2021 , 8 , 25 , 12 , 20 , 30 , 5 , time .UTC ))
1145+ ctx := clock .With ( context . Background () , time .Date (2021 , 8 , 25 , 12 , 20 , 30 , 5 , time .UTC ))
11331146 for _ , test := range tests {
11341147 t .Run (test .name , func (t * testing.T ) {
11351148 if test .allServices != nil {
@@ -1179,7 +1192,7 @@ Summary Report for compliance: my-custom-spec
11791192 require .NoError (t , os .WriteFile (cacheFile , cacheData , 0600 ))
11801193 }
11811194
1182- err := Run (context . Background () , test .options )
1195+ err := Run (ctx , test .options )
11831196 if test .expectErr {
11841197 assert .Error (t , err )
11851198 return
0 commit comments