Skip to content

Commit

Permalink
Add resources in a step before step with assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
denys-octopus committed Nov 19, 2024
1 parent 3eaa30b commit 8602ef4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions octopusdeploy_framework/datasource_workers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
},
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 8602ef4

Please sign in to comment.