Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
zentron committed Apr 24, 2024
1 parent 00ec24c commit 6988f9c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
12 changes: 9 additions & 3 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ package main

import (
"fmt"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/deployments"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/triggers"
"os"
"path/filepath"
"sort"
"strings"
"testing"

"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/deployments"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/triggers"

stdslices "slices"

"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/accounts"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/certificates"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/channels"
Expand All @@ -65,7 +68,6 @@ import (
"github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework/octoclient"
"github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework/test"
"k8s.io/utils/strings/slices"
stdslices "slices"
)

// TestSpaceResource verifies that a space can be reimported with the correct settings
Expand Down Expand Up @@ -422,6 +424,10 @@ func TestSshAccountResource(t *testing.T) {
t.Fatal("The account must be have no tenant tags")
}

if len(resource.EnvironmentIDs) != 0 {
t.Fatal("The account must have environments")
}

return nil
})
}
Expand Down
6 changes: 6 additions & 0 deletions terraform/7-sshaccount/environments.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "octopusdeploy_environment" "development_environment" {
allow_dynamic_infrastructure = true
description = "A test environment"
name = "Development"
use_guided_failure = false
}
2 changes: 1 addition & 1 deletion terraform/7-sshaccount/ssh_account.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "octopusdeploy_ssh_key_account" "account_ssh" {
description = "A test account"
name = "SSH"
environments = null
environments = [octopusdeploy_environment.development_environment.id]
tenant_tags = []
tenants = null
tenanted_deployment_participation = "Untenanted"
Expand Down

0 comments on commit 6988f9c

Please sign in to comment.