forked from hashicorp/packer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
command: build should be converted to new API, compiles
- Loading branch information
Showing
13 changed files
with
355 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- var-file doesn't work | ||
- prov/post-processors/hooks don't work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
package command | ||
|
||
import ( | ||
"bytes" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/mitchellh/cli" | ||
"github.com/mitchellh/packer/packer" | ||
) | ||
|
||
const fixturesDir = "./test-fixtures" | ||
|
||
func fatalCommand(t *testing.T, m Meta) { | ||
ui := m.Ui.(*cli.MockUi) | ||
ui := m.Ui.(*packer.BasicUi) | ||
out := ui.Writer.(*bytes.Buffer) | ||
err := ui.ErrorWriter.(*bytes.Buffer) | ||
t.Fatalf( | ||
"Bad exit code.\n\nStdout:\n\n%s\n\nStderr:\n\n%s", | ||
ui.OutputWriter.String(), | ||
ui.ErrorWriter.String()) | ||
out.String(), | ||
err.String()) | ||
} | ||
|
||
func testFixture(n string) string { | ||
return filepath.Join(fixturesDir, n) | ||
} | ||
|
||
func testMeta(t *testing.T) Meta { | ||
var out, err bytes.Buffer | ||
|
||
return Meta{ | ||
Ui: new(cli.MockUi), | ||
Ui: &packer.BasicUi{ | ||
Writer: &out, | ||
ErrorWriter: &err, | ||
}, | ||
} | ||
} |
Oops, something went wrong.