Skip to content

Commit

Permalink
Update aws/ecs_cluster_test.go
Browse files Browse the repository at this point in the history
Returning & handling error

Co-authored-by: Yevgeniy Brikman <[email protected]>
  • Loading branch information
ina-stoyanova and brikis98 authored Oct 8, 2020
1 parent 1cb6c7a commit 9ce2617
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions aws/ecs_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ func TestCanNukeAllEcsClustersOlderThan24Hours(t *testing.T) {
var youngClusterTagValue = now.Format(time.RFC3339)
var oldClusterTagValue2 = now.Add(time.Hour * time.Duration(-27)).Format(time.RFC3339)

tagEcsCluster(awsSession, cluster1.ClusterArn, firstSeenTagKey, oldClusterTagValue1)
tagEcsCluster(awsSession, cluster2.ClusterArn, firstSeenTagKey, youngClusterTagValue)
tagEcsCluster(awsSession, cluster3.ClusterArn, firstSeenTagKey, oldClusterTagValue2)
require.NoError(t, err)
err1 := tagEcsCluster(awsSession, cluster1.ClusterArn, firstSeenTagKey, oldClusterTagValue1)
require.NoError(t, err1)
err2 := tagEcsCluster(awsSession, cluster2.ClusterArn, firstSeenTagKey, youngClusterTagValue)
require.NoError(t, err2)
err3 := tagEcsCluster(awsSession, cluster3.ClusterArn, firstSeenTagKey, oldClusterTagValue2)
require.NoError(t, err3)

last24Hours := now.Add(time.Hour * time.Duration(-24))
filteredClusterArns, err := getAllEcsClustersOlderThan(awsSession, region, last24Hours)
Expand Down

0 comments on commit 9ce2617

Please sign in to comment.