Skip to content

Commit

Permalink
Removed additional instances of bu2, business_unit_2 in test and scri…
Browse files Browse the repository at this point in the history
…pt files
  • Loading branch information
eeaton committed May 17, 2024
1 parent e7061be commit 8891c11
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 60 deletions.
2 changes: 1 addition & 1 deletion helpers/foundation-deployer/stages/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func DeployProjectsStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outpu
Repo: ProjectsRepo,
GitConf: conf,
HasManualStep: true,
GroupingUnits: []string{"business_unit_1", "business_unit_2"},
GroupingUnits: []string{"business_unit_1"},
Envs: []string{"production", "nonproduction", "development"},
}

Expand Down
8 changes: 4 additions & 4 deletions helpers/foundation-deployer/stages/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func DestroyProjectsStage(t testing.TB, s steps.Steps, outputs BootstrapOutputs,
Step: ProjectsStep,
Repo: ProjectsRepo,
HasManualStep: true,
GroupingUnits: []string{"business_unit_1", "business_unit_2"},
GroupingUnits: []string{"business_unit_1"},
Envs: []string{"development", "nonproduction", "production"},
}
return destroyStage(t, stageConf, s, c)
Expand Down Expand Up @@ -194,9 +194,9 @@ func destroyStage(t testing.TB, sc StageConf, s steps.Steps, c CommonConf) error
for _, g := range groupingUnits {
err := s.RunDestroyStep(fmt.Sprintf("%s.%s.apply-shared", sc.Repo, g), func() error {
options := &terraform.Options{
TerraformDir: filepath.Join(gcpPath, g, "shared"),
Logger: c.Logger,
NoColor: true,
TerraformDir: filepath.Join(gcpPath, g, "shared"),
Logger: c.Logger,
NoColor: true,
RetryableTerraformErrors: testutils.RetryableTransientErrors,
MaxRetries: 2,
TimeBetweenRetries: 2 * time.Minute,
Expand Down
8 changes: 0 additions & 8 deletions test/disable_tf_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,21 @@ function shared(){
function projectsshared(){
# disable shared.auto.tfvars
mv 4-projects/business_unit_1/shared/shared.auto.tfvars 4-projects/business_unit_1/shared/shared.auto.tfvars.disabled
mv 4-projects/business_unit_2/shared/shared.auto.tfvars 4-projects/business_unit_2/shared/shared.auto.tfvars.disabled

# disable common.auto.tfvars
mv 4-projects/business_unit_1/shared/common.auto.tfvars 4-projects/business_unit_1/shared/common.auto.tfvars.disabled
mv 4-projects/business_unit_2/shared/common.auto.tfvars 4-projects/business_unit_2/shared/common.auto.tfvars.disabled
}

function projects(){
# disable ENVS.auto.tfvars in main module
mv 4-projects/business_unit_1/development/development.auto.tfvars 4-projects/business_unit_1/development/development.auto.tfvars.disabled
mv 4-projects/business_unit_2/development/development.auto.tfvars 4-projects/business_unit_2/development/development.auto.tfvars.disabled
mv 4-projects/business_unit_1/nonproduction/nonproduction.auto.tfvars 4-projects/business_unit_1/nonproduction/nonproduction.auto.tfvars.disabled
mv 4-projects/business_unit_2/nonproduction/nonproduction.auto.tfvars 4-projects/business_unit_2/nonproduction/nonproduction.auto.tfvars.disabled
mv 4-projects/business_unit_1/production/production.auto.tfvars 4-projects/business_unit_1/production/production.auto.tfvars.disabled
mv 4-projects/business_unit_2/production/production.auto.tfvars 4-projects/business_unit_2/production/production.auto.tfvars.disabled

# disable common.auto.tfvars in main module
mv 4-projects/business_unit_1/development/common.auto.tfvars 4-projects/business_unit_1/development/common.auto.tfvars.disabled
mv 4-projects/business_unit_1/nonproduction/common.auto.tfvars 4-projects/business_unit_1/nonproduction/common.auto.tfvars.disabled
mv 4-projects/business_unit_1/production/common.auto.tfvars 4-projects/business_unit_1/production/common.auto.tfvars.disabled
mv 4-projects/business_unit_2/development/common.auto.tfvars 4-projects/business_unit_2/development/common.auto.tfvars.disabled
mv 4-projects/business_unit_2/nonproduction/common.auto.tfvars 4-projects/business_unit_2/nonproduction/common.auto.tfvars.disabled
mv 4-projects/business_unit_2/production/common.auto.tfvars 4-projects/business_unit_2/production/common.auto.tfvars.disabled
}

function appinfra(){
Expand Down
5 changes: 0 additions & 5 deletions test/integration/projects-shared/projects_shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ func TestProjectsShared(t *testing.T) {
repo: "bu1-example-app",
tfDir: "../../../4-projects/business_unit_1/shared",
},
{
name: "bu2",
repo: "bu2-example-app",
tfDir: "../../../4-projects/business_unit_2/shared",
},
} {
tts := tts
t.Run(tts.name, func(t *testing.T) {
Expand Down
23 changes: 1 addition & 22 deletions test/integration/projects/projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,28 +97,7 @@ func TestProjects(t *testing.T) {
baseDir: "../../../4-projects/business_unit_1/%s",
baseNetwork: fmt.Sprintf("vpc-p-shared-base%s", networkMode),
restrictedNetwork: fmt.Sprintf("vpc-p-shared-restricted%s", networkMode),
},
{
name: "bu2_development",
repo: "bu2-example-app",
baseDir: "../../../4-projects/business_unit_2/%s",
baseNetwork: fmt.Sprintf("vpc-d-shared-base%s", networkMode),
restrictedNetwork: fmt.Sprintf("vpc-d-shared-restricted%s", networkMode),
},
{
name: "bu2_nonproduction",
repo: "bu2-example-app",
baseDir: "../../../4-projects/business_unit_2/%s",
baseNetwork: fmt.Sprintf("vpc-n-shared-base%s", networkMode),
restrictedNetwork: fmt.Sprintf("vpc-n-shared-restricted%s", networkMode),
},
{
name: "bu2_production",
repo: "bu2-example-app",
baseDir: "../../../4-projects/business_unit_2/%s",
baseNetwork: fmt.Sprintf("vpc-p-shared-base%s", networkMode),
restrictedNetwork: fmt.Sprintf("vpc-p-shared-restricted%s", networkMode),
},
}
} {
tt := tt
t.Run(tt.name, func(t *testing.T) {
Expand Down
20 changes: 0 additions & 20 deletions test/restore_tf_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,48 +80,28 @@ function projects(){
mv 4-projects/business_unit_1/nonproduction/backend.tf.disabled 4-projects/business_unit_1/nonproduction/backend.tf
mv 4-projects/business_unit_1/production/backend.tf.disabled 4-projects/business_unit_1/production/backend.tf
mv 4-projects/business_unit_1/shared/backend.tf.disabled 4-projects/business_unit_1/shared/backend.tf
mv 4-projects/business_unit_2/development/backend.tf.disabled 4-projects/business_unit_2/development/backend.tf
mv 4-projects/business_unit_2/nonproduction/backend.tf.disabled 4-projects/business_unit_2/nonproduction/backend.tf
mv 4-projects/business_unit_2/production/backend.tf.disabled 4-projects/business_unit_2/production/backend.tf
mv 4-projects/business_unit_2/shared/backend.tf.disabled 4-projects/business_unit_2/shared/backend.tf

# restore access_context.auto.tfvars in main module
mv 4-projects/business_unit_1/development/access_context.auto.tfvars.disabled 4-projects/business_unit_1/development/access_context.auto.tfvars
mv 4-projects/business_unit_1/nonproduction/access_context.auto.tfvars.disabled 4-projects/business_unit_1/nonproduction/access_context.auto.tfvars
mv 4-projects/business_unit_1/production/access_context.auto.tfvars.disabled 4-projects/business_unit_1/production/access_context.auto.tfvars
mv 4-projects/business_unit_2/development/access_context.auto.tfvars.disabled 4-projects/business_unit_2/development/access_context.auto.tfvars
mv 4-projects/business_unit_2/nonproduction/access_context.auto.tfvars.disabled 4-projects/business_unit_2/nonproduction/access_context.auto.tfvars
mv 4-projects/business_unit_2/production/access_context.auto.tfvars.disabled 4-projects/business_unit_2/production/access_context.auto.tfvars

# restore business_unit_1.auto.tfvars in main module
mv 4-projects/business_unit_1/development/business_unit_1.auto.tfvars.disabled 4-projects/business_unit_1/development/business_unit_1.auto.tfvars
mv 4-projects/business_unit_1/nonproduction/business_unit_1.auto.tfvars.disabled 4-projects/business_unit_1/nonproduction/business_unit_1.auto.tfvars
mv 4-projects/business_unit_1/production/business_unit_1.auto.tfvars.disabled 4-projects/business_unit_1/production/business_unit_1.auto.tfvars

# restore business_unit_2.auto.tfvars in main module
mv 4-projects/business_unit_2/development/business_unit_2.auto.tfvars.disabled 4-projects/business_unit_2/development/business_unit_2.auto.tfvars
mv 4-projects/business_unit_2/nonproduction/business_unit_2.auto.tfvars.disabled 4-projects/business_unit_2/nonproduction/business_unit_2.auto.tfvars
mv 4-projects/business_unit_2/production/business_unit_2.auto.tfvars.disabled 4-projects/business_unit_2/production/business_unit_2.auto.tfvars

# restore ENVS.auto.tfvars in main module
mv 4-projects/business_unit_1/development/development.auto.tfvars.disabled 4-projects/business_unit_1/development/development.auto.tfvars
mv 4-projects/business_unit_2/development/development.auto.tfvars.disabled 4-projects/business_unit_2/development/development.auto.tfvars
mv 4-projects/business_unit_1/nonproduction/nonproduction.auto.tfvars.disabled 4-projects/business_unit_1/nonproduction/nonproduction.auto.tfvars
mv 4-projects/business_unit_2/nonproduction/nonproduction.auto.tfvars.disabled 4-projects/business_unit_2/nonproduction/nonproduction.auto.tfvars
mv 4-projects/business_unit_1/production/production.auto.tfvars.disabled 4-projects/business_unit_1/production/production.auto.tfvars
mv 4-projects/business_unit_2/production/production.auto.tfvars.disabled 4-projects/business_unit_2/production/production.auto.tfvars
mv 4-projects/business_unit_1/shared/shared.auto.tfvars.disabled 4-projects/business_unit_1/shared/shared.auto.tfvars
mv 4-projects/business_unit_2/shared/shared.auto.tfvars.disabled 4-projects/business_unit_2/shared/shared.auto.tfvars

# restore common.auto.tfvars in main module
mv 4-projects/business_unit_1/development/common.auto.tfvars.disabled 4-projects/business_unit_1/development/common.auto.tfvars
mv 4-projects/business_unit_1/nonproduction/common.auto.tfvars.disabled 4-projects/business_unit_1/nonproduction/common.auto.tfvars
mv 4-projects/business_unit_1/production/common.auto.tfvars.disabled 4-projects/business_unit_1/production/common.auto.tfvars
mv 4-projects/business_unit_1/shared/common.auto.tfvars.disabled 4-projects/business_unit_1/shared/common.auto.tfvars
mv 4-projects/business_unit_2/development/common.auto.tfvars.disabled 4-projects/business_unit_2/development/common.auto.tfvars
mv 4-projects/business_unit_2/nonproduction/common.auto.tfvars.disabled 4-projects/business_unit_2/nonproduction/common.auto.tfvars
mv 4-projects/business_unit_2/production/common.auto.tfvars.disabled 4-projects/business_unit_2/production/common.auto.tfvars
mv 4-projects/business_unit_2/shared/common.auto.tfvars.disabled 4-projects/business_unit_2/shared/common.auto.tfvars

}

Expand Down

0 comments on commit 8891c11

Please sign in to comment.