@@ -54,22 +54,17 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
5454 clusterName := fmt .Sprintf ("%s-cluster" , projectName )
5555 ctx := context .Background ()
5656
57- BeforeEach (func () {
57+ BeforeEach (func (ctx SpecContext ) {
5858 By ("Setting up cloud environment" , func () {
5959 checkUpAWSEnvironment ()
6060
61- aws , err := cloud .NewAWSAction (GinkgoT ())
61+ aws , err := cloud .NewAWSAction (ctx , GinkgoT ())
6262 Expect (err ).ToNot (HaveOccurred ())
6363 awsHelper = aws
6464 })
6565
6666 By ("Setting up test environment" , func () {
67- testData = model .DataProvider (
68- "atlas-gov" ,
69- model .NewEmptyAtlasKeyType ().CreateAsGlobalLevelKey (),
70- 30005 ,
71- []func (* model.TestDataProvider ){},
72- )
67+ testData = model .DataProvider (ctx , "atlas-gov" , model .NewEmptyAtlasKeyType ().CreateAsGlobalLevelKey (), 30005 , []func (* model.TestDataProvider ){})
7368
7469 actions .CreateNamespaceAndSecrets (testData )
7570 })
@@ -96,7 +91,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
9691 })
9792 })
9893
99- It ("Manage all supported Atlas for Government features" , Label ("focus-atlas-gov-supported" ), func () {
94+ It ("Manage all supported Atlas for Government features" , Label ("focus-atlas-gov-supported" ), func (ctx SpecContext ) {
10095 By ("Preparing API Key for integrations" , func () {
10196 secret := & corev1.Secret {
10297 ObjectMeta : metav1.ObjectMeta {
@@ -239,7 +234,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
239234 })
240235
241236 By ("Configuring Cloud Provider Access" , func () {
242- assumedRoleArn , err := cloudaccess .CreateAWSIAMRole (projectName )
237+ assumedRoleArn , err := cloudaccess .CreateAWSIAMRole (ctx , projectName )
243238 Expect (err ).ToNot (HaveOccurred ())
244239
245240 Expect (testData .K8SClient .Get (ctx , client .ObjectKeyFromObject (testData .Project ), testData .Project )).To (Succeed ())
@@ -258,11 +253,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
258253 }).WithTimeout (time .Minute * 5 ).WithPolling (time .Second * 20 ).Should (Succeed ())
259254
260255 Expect (
261- cloudaccess .AddAtlasStatementToAWSIAMRole (
262- testData .Project .Status .CloudProviderIntegrations [0 ].AtlasAWSAccountArn ,
263- testData .Project .Status .CloudProviderIntegrations [0 ].AtlasAssumedRoleExternalID ,
264- projectName ,
265- ),
256+ cloudaccess .AddAtlasStatementToAWSIAMRole (ctx , testData .Project .Status .CloudProviderIntegrations [0 ].AtlasAWSAccountArn , testData .Project .Status .CloudProviderIntegrations [0 ].AtlasAssumedRoleExternalID , projectName ),
266257 ).To (Succeed ())
267258
268259 Eventually (func (g Gomega ) {
@@ -272,10 +263,10 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
272263 })
273264
274265 By ("Configuring Networking Peering" , func () {
275- awsAccountID , err := awsHelper .GetAccountID ()
266+ awsAccountID , err := awsHelper .GetAccountID (ctx )
276267 Expect (err ).ToNot (HaveOccurred ())
277268
278- AwsVpcID , err := awsHelper .InitNetwork (projectName , "10.0.0.0/24" , "us-west-1" , map [string ]string {"subnet-1" : "10.0.0.0/24" }, false )
269+ AwsVpcID , err := awsHelper .InitNetwork (ctx , projectName , "10.0.0.0/24" , "us-west-1" , map [string ]string {"subnet-1" : "10.0.0.0/24" }, false )
279270 Expect (err ).ToNot (HaveOccurred ())
280271
281272 Expect (testData .K8SClient .Get (ctx , client .ObjectKeyFromObject (testData .Project ), testData .Project )).To (Succeed ())
@@ -297,7 +288,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
297288 g .Expect (testData .Project .Status .NetworkPeers [0 ].StatusName ).Should (Equal ("PENDING_ACCEPTANCE" ))
298289 }).WithTimeout (time .Minute * 15 ).WithPolling (time .Second * 20 ).Should (Succeed ())
299290
300- Expect (awsHelper .AcceptVpcPeeringConnection (testData .Project .Status .NetworkPeers [0 ].ConnectionID , "us-west-1" )).To (Succeed ())
291+ Expect (awsHelper .AcceptVpcPeeringConnection (ctx , testData .Project .Status .NetworkPeers [0 ].ConnectionID , "us-west-1" )).To (Succeed ())
301292
302293 Eventually (func (g Gomega ) {
303294 g .Expect (testData .K8SClient .Get (ctx , client .ObjectKeyFromObject (testData .Project ), testData .Project )).To (Succeed ())
@@ -311,7 +302,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
311302 awsRoleARN := testData .Project .Status .CloudProviderIntegrations [0 ].IamAssumedRoleArn
312303 atlasRoleID := testData .Project .Status .CloudProviderIntegrations [0 ].RoleID
313304
314- customerMasterKeyID , err := awsHelper .CreateKMS (fmt .Sprintf ("%s-kms" , projectName ), "us-west-1" , atlasAccountARN , awsRoleARN )
305+ customerMasterKeyID , err := awsHelper .CreateKMS (ctx , fmt .Sprintf ("%s-kms" , projectName ), "us-west-1" , atlasAccountARN , awsRoleARN )
315306 Expect (err ).ToNot (HaveOccurred ())
316307
317308 secret := & corev1.Secret {
@@ -376,6 +367,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
376367 }).WithTimeout (time .Minute * 15 ).WithPolling (time .Second * 20 ).Should (Succeed ())
377368
378369 peID , err := awsHelper .CreatePrivateEndpoint (
370+ ctx ,
379371 testData .Project .Status .PrivateEndpoints [0 ].ServiceName ,
380372 fmt .Sprintf ("pe-%s-gov" , testData .Project .Status .PrivateEndpoints [0 ].ID ),
381373 "us-west-1" ,
0 commit comments