command: fix failing tests
This commit is contained in:
parent
5ef46b797b
commit
91eb3c73fc
|
@ -438,8 +438,10 @@ func TestApply_refresh(t *testing.T) {
|
|||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(backupState, originalState) {
|
||||
t.Fatalf("bad: %#v", backupState)
|
||||
actualStr := strings.TrimSpace(backupState.String())
|
||||
expectedStr := strings.TrimSpace(originalState.String())
|
||||
if actualStr != expectedStr {
|
||||
t.Fatalf("bad:\n\n%s\n\n%s", actualStr, expectedStr)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -627,8 +629,10 @@ func TestApply_state(t *testing.T) {
|
|||
// nil out the ConnInfo since that should not be restored
|
||||
originalState.RootModule().Resources["test_instance.foo"].Primary.Ephemeral.ConnInfo = nil
|
||||
|
||||
if !reflect.DeepEqual(backupState, originalState) {
|
||||
t.Fatalf("bad: %#v", backupState)
|
||||
actualStr := strings.TrimSpace(backupState.String())
|
||||
expectedStr := strings.TrimSpace(originalState.String())
|
||||
if actualStr != expectedStr {
|
||||
t.Fatalf("bad:\n\n%s\n\n%s", actualStr, expectedStr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -98,10 +97,13 @@ func TestPlan_destroy(t *testing.T) {
|
|||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(backupState, originalState) {
|
||||
t.Fatalf("bad: %#v", backupState)
|
||||
actualStr := strings.TrimSpace(backupState.String())
|
||||
expectedStr := strings.TrimSpace(originalState.String())
|
||||
if actualStr != expectedStr {
|
||||
t.Fatalf("bad:\n\n%s\n\n%s", actualStr, expectedStr)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPlan_noState(t *testing.T) {
|
||||
p := testProvider()
|
||||
ui := new(cli.MockUi)
|
||||
|
@ -493,8 +495,10 @@ func TestPlan_backup(t *testing.T) {
|
|||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(backupState, originalState) {
|
||||
t.Fatalf("bad: %#v", backupState)
|
||||
actualStr := strings.TrimSpace(backupState.String())
|
||||
expectedStr := strings.TrimSpace(originalState.String())
|
||||
if actualStr != expectedStr {
|
||||
t.Fatalf("bad:\n\n%s\n\n%s", actualStr, expectedStr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -297,8 +297,10 @@ func TestRefresh_outPath(t *testing.T) {
|
|||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(backupState, state) {
|
||||
t.Fatalf("bad: %#v", backupState)
|
||||
actualStr := strings.TrimSpace(backupState.String())
|
||||
expectedStr := strings.TrimSpace(state.String())
|
||||
if actualStr != expectedStr {
|
||||
t.Fatalf("bad:\n\n%s\n\n%s", actualStr, expectedStr)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -498,8 +500,10 @@ func TestRefresh_backup(t *testing.T) {
|
|||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(backupState, state) {
|
||||
t.Fatalf("bad: %#v", backupState)
|
||||
actualStr := strings.TrimSpace(backupState.String())
|
||||
expectedStr := strings.TrimSpace(state.String())
|
||||
if actualStr != expectedStr {
|
||||
t.Fatalf("bad:\n\n%s\n\n%s", actualStr, expectedStr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue