Skip to content

Commit

Permalink
Fix acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uchida committed Jul 2, 2022
1 parent 7b8e717 commit d789a4d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tfmigrate/multi_state_migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ func TestAccMultiStateMigratorApply(t *testing.T) {
ctx := context.Background()

//setup the initial files and states
fromBackend := tfexec.GetTestAccBackendS3Config(t.Name() + "/fromDir")
fromTf := tfexec.SetupTestAccWithApply(t, tc.fromWorkspace, fromBackend+tc.fromSource)
toBackend := tfexec.GetTestAccBackendS3Config(t.Name() + "/toDir")
toTf := tfexec.SetupTestAccWithApply(t, tc.toWorkspace, toBackend+tc.toSource)
fromBackend := tfexec.GetTestAccBackendS3Config(t.Name()+"/fromDir", false)
fromTf := tfexec.SetupTestAccWithApply(t, tc.fromWorkspace, fromBackend+tc.fromSource, nil)
toBackend := tfexec.GetTestAccBackendS3Config(t.Name()+"/toDir", false)
toTf := tfexec.SetupTestAccWithApply(t, tc.toWorkspace, toBackend+tc.toSource, nil)

//update terraform resource files for migration
tfexec.UpdateTestAccSource(t, fromTf, fromBackend+tc.fromUpdatedSource)
Expand Down
4 changes: 2 additions & 2 deletions tfmigrate/state_import_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func TestAccStateImportAction(t *testing.T) {
tfexec.SkipUnlessAcceptanceTestEnabled(t)

backend := tfexec.GetTestAccBackendS3Config(t.Name())
backend := tfexec.GetTestAccBackendS3Config(t.Name(), false)

source := `
resource "aws_iam_user" "foo" {
Expand All @@ -23,7 +23,7 @@ resource "aws_iam_user" "baz" {
name = "baz"
}
`
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source)
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source, nil)
ctx := context.Background()

_, err := tf.StateRm(ctx, nil, []string{"aws_iam_user.foo", "aws_iam_user.baz"})
Expand Down
8 changes: 4 additions & 4 deletions tfmigrate/state_migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestAccStateMigratorApply(t *testing.T) {

for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {
backend := tfexec.GetTestAccBackendS3Config(t.Name())
backend := tfexec.GetTestAccBackendS3Config(t.Name(), false)

source := `
resource "aws_security_group" "foo" {}
Expand All @@ -149,7 +149,7 @@ resource "aws_iam_user" "qux" {
name = "qux"
}
`
tf := tfexec.SetupTestAccWithApply(t, tc.workspace, backend+source)
tf := tfexec.SetupTestAccWithApply(t, tc.workspace, backend+source, nil)
ctx := context.Background()

updatedSource := `
Expand Down Expand Up @@ -222,13 +222,13 @@ resource "aws_iam_user" "qux" {
func TestAccStateMigratorApplyForce(t *testing.T) {
tfexec.SkipUnlessAcceptanceTestEnabled(t)

backend := tfexec.GetTestAccBackendS3Config(t.Name())
backend := tfexec.GetTestAccBackendS3Config(t.Name(), false)

source := `
resource "aws_security_group" "foo" {}
resource "aws_security_group" "bar" {}
`
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source)
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source, nil)
ctx := context.Background()

updatedSource := `
Expand Down
4 changes: 2 additions & 2 deletions tfmigrate/state_mv_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
func TestAccStateMvAction(t *testing.T) {
tfexec.SkipUnlessAcceptanceTestEnabled(t)

backend := tfexec.GetTestAccBackendS3Config(t.Name())
backend := tfexec.GetTestAccBackendS3Config(t.Name(), false)

source := `
resource "aws_security_group" "foo" {}
resource "aws_security_group" "bar" {}
resource "aws_security_group" "baz" {}
`
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source)
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source, nil)
ctx := context.Background()

updatedSource := `
Expand Down
4 changes: 2 additions & 2 deletions tfmigrate/state_rm_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
func TestAccStateRmAction(t *testing.T) {
tfexec.SkipUnlessAcceptanceTestEnabled(t)

backend := tfexec.GetTestAccBackendS3Config(t.Name())
backend := tfexec.GetTestAccBackendS3Config(t.Name(), false)

source := `
resource "aws_security_group" "foo" {}
resource "aws_security_group" "bar" {}
resource "aws_security_group" "baz" {}
resource "aws_security_group" "qux" {}
`
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source)
tf := tfexec.SetupTestAccWithApply(t, "default", backend+source, nil)
ctx := context.Background()

updatedSource := `
Expand Down

0 comments on commit d789a4d

Please sign in to comment.