command/push: make test more resilient
This commit is contained in:
parent
2eeaac03c5
commit
475d8750bb
|
@ -6,6 +6,7 @@ import (
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -91,11 +92,26 @@ func TestPush_noUploadModules(t *testing.T) {
|
||||||
// Path of the test. We have to do some renaming to avoid our own
|
// Path of the test. We have to do some renaming to avoid our own
|
||||||
// VCS getting in the way.
|
// VCS getting in the way.
|
||||||
path := testFixturePath("push-no-upload")
|
path := testFixturePath("push-no-upload")
|
||||||
defer testRename(t, path, "DOTterraform", ".terraform")()
|
defer os.RemoveAll(filepath.Join(path, ".terraform"))
|
||||||
|
|
||||||
// Move into that directory
|
// Move into that directory
|
||||||
defer testChdir(t, path)()
|
defer testChdir(t, path)()
|
||||||
|
|
||||||
|
// Do a "terraform get"
|
||||||
|
{
|
||||||
|
ui := new(cli.MockUi)
|
||||||
|
c := &GetCommand{
|
||||||
|
Meta: Meta{
|
||||||
|
ContextOpts: testCtxConfig(testProvider()),
|
||||||
|
Ui: ui,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if code := c.Run([]string{}); code != 0 {
|
||||||
|
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create remote state file, this should be pulled
|
// Create remote state file, this should be pulled
|
||||||
conf, srv := testRemoteState(t, testState(), 200)
|
conf, srv := testRemoteState(t, testState(), 200)
|
||||||
defer srv.Close()
|
defer srv.Close()
|
||||||
|
|
Loading…
Reference in New Issue