Skip to content

Commit

Permalink
fix test name
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicsim1 committed Oct 31, 2024
1 parent d8e9bc6 commit 4895c8c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions octopusdeploy_framework/resource_machine_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ func TestAccMachineProxyBasic(t *testing.T) {
ProtoV6ProviderFactories: ProtoV6ProviderFactories(),
Steps: []resource.TestStep{
{
Config: testMachineProxyBasic(data),
Config: testMachineProxyBasic(data, localName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(prefix, "name", data.Name),
),
},
{
Config: testMachineProxyUpdate(data),
Config: testMachineProxyUpdate(data, localName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(prefix, "name", data.Name+"-updated"),
),
Expand All @@ -44,16 +44,17 @@ func TestAccMachineProxyBasic(t *testing.T) {
})
}

func testMachineProxyBasic(data *proxies.Proxy) string {
func testMachineProxyBasic(data *proxies.Proxy, localName string) string {
return fmt.Sprintf(`
resource "octopusdeploy_machine_proxy" "test_proxy" {
resource "octopusdeploy_machine_proxy" "%s" {
name = "%s"
host = "%s"
username = "%s"
password = "%s"
port = %d
}
`,
localName,
data.Name,
data.Host,
data.Username,
Expand All @@ -62,10 +63,10 @@ func testMachineProxyBasic(data *proxies.Proxy) string {
)
}

func testMachineProxyUpdate(data *proxies.Proxy) string {
func testMachineProxyUpdate(data *proxies.Proxy, localName string) string {
data.Name = data.Name + "-updated"

return testMachineProxyBasic(data)
return testMachineProxyBasic(data, localName)
}

func testMachineProxyDestroy(s *terraform.State) error {
Expand Down

0 comments on commit 4895c8c

Please sign in to comment.