Skip to content

Commit

Permalink
fix *skip_plan acceptance tests
Browse files Browse the repository at this point in the history
This seeks to correct the assertions made in acceptance tests that
verify `from_skip_plan` and `to_skip_plan` behavior.
  • Loading branch information
mdb committed Aug 6, 2023
1 parent 8163471 commit 42303f9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tfmigrate/multi_state_migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ resource "null_resource" "qux" {}
if err != nil {
t.Fatalf("failed to run PlanHasChange in fromDir: %s", err)
}
if fromChanged {
t.Error("expect not to have changes in fromDir")
if !fromChanged {
t.Error("expect to have changes in fromDir")
}

toChanged, err = toTf.PlanHasChange(ctx, nil)
Expand Down Expand Up @@ -429,8 +429,8 @@ resource "null_resource" "baz" {}
if err != nil {
t.Fatalf("failed to run PlanHasChange in toDir: %s", err)
}
if !toChanged {
t.Fatalf("expect to have changes in toDir")
if toChanged {
t.Fatalf("expect not to have changes in toDir")
}

// perform state migration
Expand Down Expand Up @@ -492,8 +492,8 @@ resource "null_resource" "baz" {}
if err != nil {
t.Fatalf("failed to run PlanHasChange in toDir: %s", err)
}
if toChanged {
t.Error("expect not to have changes in toDir")
if !toChanged {
t.Error("expect to have changes in toDir")
}
}

Expand Down Expand Up @@ -531,16 +531,16 @@ resource "null_resource" "qux" {}
if err != nil {
t.Fatalf("failed to run PlanHasChange in fromDir: %s", err)
}
if !fromChanged {
t.Fatalf("expect to have changes in fromDir")
if fromChanged {
t.Fatalf("expect not to have changes in fromDir")
}

toChanged, err := toTf.PlanHasChange(ctx, nil)
if err != nil {
t.Fatalf("failed to run PlanHasChange in toDir: %s", err)
}
if !toChanged {
t.Fatalf("expect to have changes in toDir")
if toChanged {
t.Fatalf("expect not to have changes in toDir")
}

// perform state migration
Expand Down Expand Up @@ -594,16 +594,16 @@ resource "null_resource" "qux" {}
if err != nil {
t.Fatalf("failed to run PlanHasChange in fromDir: %s", err)
}
if fromChanged {
t.Error("expect not to have changes in fromDir")
if !fromChanged {
t.Error("expect to have changes in fromDir")
}

toChanged, err = toTf.PlanHasChange(ctx, nil)
if err != nil {
t.Fatalf("failed to run PlanHasChange in toDir: %s", err)
}
if toChanged {
t.Error("expect not to have changes in toDir")
if !toChanged {
t.Error("expect to have changes in toDir")
}
}

Expand Down

0 comments on commit 42303f9

Please sign in to comment.