From 8602ef47684d07baab1b90426e2fd6457d24fd6a Mon Sep 17 00:00:00 2001 From: "denys.kostynchuk" Date: Tue, 19 Nov 2024 13:34:47 +1300 Subject: [PATCH] Add resources in a step before step with assertion --- octopusdeploy_framework/datasource_workers_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/octopusdeploy_framework/datasource_workers_test.go b/octopusdeploy_framework/datasource_workers_test.go index 07c7fcb6..120b10ea 100644 --- a/octopusdeploy_framework/datasource_workers_test.go +++ b/octopusdeploy_framework/datasource_workers_test.go @@ -21,15 +21,18 @@ func TestAccDataSourceWorkers(t *testing.T) { PreCheck: func() { TestAccPreCheck(t) }, Steps: []resource.TestStep{ { - Config: createTestAccDataSourceWorkerResources(localName, ""), + Config: configTestAccDataSourceWorkerResources(localName, ""), + }, + { + Config: configTestAccDataSourceWorkerResources(localName, ""), Check: testAssertDataSourceWorkersEmpty(prefix), }, { - Config: createTestAccDataSourceWorkerResources(localName, sshFilter), + Config: configTestAccDataSourceWorkerResources(localName, sshFilter), Check: testAssertDataSourceSSHWorkers(prefix), }, { - Config: createTestAccDataSourceWorkerResources(localName, listeningFilter), + Config: configTestAccDataSourceWorkerResources(localName, listeningFilter), Check: testAssertDataSourceListeningWorkers(prefix), }, }, @@ -80,7 +83,7 @@ func testAssertWorkersDataSourceID(prefix string) resource.TestCheckFunc { } } -func createTestAccDataSourceWorkerResources(localName string, dataSourceFilter string) string { +func configTestAccDataSourceWorkerResources(localName string, dataSourceFilter string) string { return fmt.Sprintf(` resource "octopusdeploy_machine_policy" "policy_1" { name = "Machine Policy One"