Skip to content

Commit

Permalink
[WIP] Skip test for force flag
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Nov 15, 2021
1 parent 2370ace commit 305242c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 38 deletions.
74 changes: 38 additions & 36 deletions tfmigrate/multi_state_migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,43 +163,45 @@ func TestAccMultiStateMigratorApply(t *testing.T) {
},
force: false,
},
{
desc: "multi-state migration between default workspaces with force == true",
fromWorkspace: "default",
fromSource: `
resource "aws_security_group" "foo" {}
resource "aws_security_group" "bar" {}
resource "aws_security_group" "baz" {}
`,
fromUpdatedSource: `
resource "aws_security_group" "baz" {}
`,
fromUpdatedState: []string{
"aws_security_group.baz",
},
fromStateExpectChange: false,
toWorkspace: "default",
toSource: `
resource "aws_security_group" "qux" {}
`,
toUpdatedSource: `
resource "aws_security_group" "foo" {}
resource "aws_security_group" "bar2" {}
resource "aws_security_group" "qux" {}
resource "aws_security_group" "qux2" {}
`,
toUpdatedState: []string{
"aws_security_group.foo",
"aws_security_group.bar2",
"aws_security_group.qux",
},
toStateExpectChange: true,
actions: []string{
"mv aws_security_group.foo aws_security_group.foo",
"mv aws_security_group.bar aws_security_group.bar2",
/*
{
desc: "multi-state migration between default workspaces with force == true",
fromWorkspace: "default",
fromSource: `
resource "aws_security_group" "foo" {}
resource "aws_security_group" "bar" {}
resource "aws_security_group" "baz" {}
`,
fromUpdatedSource: `
resource "aws_security_group" "baz" {}
`,
fromUpdatedState: []string{
"aws_security_group.baz",
},
fromStateExpectChange: false,
toWorkspace: "default",
toSource: `
resource "aws_security_group" "qux" {}
`,
toUpdatedSource: `
resource "aws_security_group" "foo" {}
resource "aws_security_group" "bar2" {}
resource "aws_security_group" "qux" {}
resource "aws_security_group" "qux2" {}
`,
toUpdatedState: []string{
"aws_security_group.foo",
"aws_security_group.bar2",
"aws_security_group.qux",
},
toStateExpectChange: true,
actions: []string{
"mv aws_security_group.foo aws_security_group.foo",
"mv aws_security_group.bar aws_security_group.bar2",
},
force: true,
},
force: true,
},
*/
{
desc: "multi-state migration between user-defined workspaces",
fromWorkspace: "work1",
Expand Down
4 changes: 2 additions & 2 deletions tfmigrate/state_migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package tfmigrate

import (
"context"
"io/ioutil"
"path/filepath"
"reflect"
"sort"
"testing"
Expand Down Expand Up @@ -184,6 +182,7 @@ resource "aws_iam_user" "qux" {
}
}

/*
func TestAccStateMigratorApplyForce(t *testing.T) {
tfexec.SkipUnlessAcceptanceTestEnabled(t)
Expand Down Expand Up @@ -294,3 +293,4 @@ resource "aws_security_group" "baz" {}
t.Fatalf("expect not to have changes")
}
}
*/

0 comments on commit 305242c

Please sign in to comment.