Skip to content

Commit

Permalink
Change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kasia-kujawa committed Nov 4, 2024
1 parent 0f6f5b0 commit fc87f50
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions castai/resource_rebalancing_job_eks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,25 +103,9 @@ func TestAccResourceRebalancingJobWithDataSource_eks(t *testing.T) {
PreConfig: func() { waitForRebalancingSchedule(t, rName) },
Config: makeInitialRebalancingJobWithDataSourceConfig(rName, clusterName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("castai_rebalancing_job.test-with-data-source", "enabled", "true"),
resource.TestCheckResourceAttr("data.castai_rebalancing_schedule.data-source-for-rebalancing-schedule", "name", rName),
),
},
{
ResourceName: "castai_rebalancing_job.test-with-data-source",
ImportStateIdFunc: func(s *terraform.State) (string, error) {
clusterID := s.RootModule().Resources["castai_eks_cluster.test"].Primary.ID
return fmt.Sprintf("%v/%v", clusterID, rName), nil
},
ImportState: true,
ImportStateVerify: true,
},
{
Config: makeUpdatedRebalancingJobConfig(rName, clusterName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("castai_rebalancing_job.test-with-data-source", "enabled", "false"),
),
},
},
ExternalProviders: map[string]resource.ExternalProvider{
"aws": {
Expand All @@ -141,8 +125,8 @@ func waitForRebalancingSchedule(t *testing.T, rebalancingScheduleName string) {

for {
if time.Since(startTime) > timeout {
fmt.Println("Rebalancing schedule found, name: ", rebalancingScheduleName)
t.Log("Rebalancing schedule was not found, name: ", rebalancingScheduleName)
fmt.Println("Rebalancing schedule was not found, name: ", rebalancingScheduleName)
t.Error("Rebalancing schedule was not found, name: ", rebalancingScheduleName)
return
}

Expand Down

0 comments on commit fc87f50

Please sign in to comment.