Skip to content

Commit

Permalink
Try again to pass the test
Browse files Browse the repository at this point in the history
  • Loading branch information
HuyPhanNguyen committed Dec 6, 2024
1 parent cdb5bf7 commit 5d9029f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion octopusdeploy_framework/resource_deployment_freeze_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
func TestNewDeploymentFreezeResource(t *testing.T) {
if os.Getenv("TF_LOG") == "" {
os.Setenv("TF_LOG", "INFO")
os.Setenv("OCTOPUS__FeatureToggles__DeploymentFreezeByTenantFeatureToggle", "true")
}

localName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha)
Expand Down
12 changes: 8 additions & 4 deletions octopusdeploy_framework/testing_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,26 @@ var octoClient *client.Client
var network testcontainers.Network
var sqlServerContainer *test.MysqlContainer
var err error
var customTestEnvironment = map[string]string{}

func TestMain(m *testing.M) {
flag.Parse() // Parse the flags
os.Setenv("TF_ACC", "1")
os.Setenv("OCTOPUS__FeatureToggles__DeploymentFreezeByTenantFeatureToggle", "true")
if *createSharedContainer {

testFramework := test.OctopusContainerTest{}
octoContainer, _, sqlServerContainer, network, err = testFramework.ArrangeContainer()
testFramework := test.OctopusContainerTest{
CustomEnvironment: map[string]string{
"OCTOPUS__FeatureToggles__DeploymentFreezeByTenantFeatureToggle": "true",
},
}

octoContainer, octoClient, sqlServerContainer, network, err = testFramework.ArrangeContainer()
if err != nil {
log.Printf("Failed to arrange containers: (%s)", err.Error())
}

os.Setenv("OCTOPUS_URL", octoContainer.URI)
os.Setenv("OCTOPUS_APIKEY", test.ApiKey)
octoClient, err = octoclient.CreateClient(octoContainer.URI, "", test.ApiKey)
code := m.Run()
ctx := context.Background()

Expand Down

0 comments on commit 5d9029f

Please sign in to comment.