Skip to content

Commit

Permalink
Merge pull request #576 from zmackie/feature/experimental
Browse files Browse the repository at this point in the history
Adds experimental flagging
  • Loading branch information
jromero authored Apr 21, 2020
2 parents 18def19 + 63a42c1 commit aca6493
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion cmd/pack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func main() {
logger.Error(err.Error())
os.Exit(1)
}

rootCmd := &cobra.Command{
Use: "pack",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
Expand Down
6 changes: 5 additions & 1 deletion internal/commands/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func testReportCommand(t *testing.T, when spec.G, it spec.S) {
packHome, err = ioutil.TempDir("", "")
h.AssertNil(t, err)
packConfigPath = filepath.Join(packHome, "config.toml")
h.AssertNil(t, ioutil.WriteFile(packConfigPath, []byte(`default-builder-image = "some/image"`), 0666))
h.AssertNil(t, ioutil.WriteFile(packConfigPath, []byte(`
default-builder-image = "some/image"
experimental = true
`), 0666))
packMissingHome, err = ioutil.TempDir("", "")
h.AssertNil(t, err)
})
Expand All @@ -63,6 +66,7 @@ func testReportCommand(t *testing.T, when spec.G, it spec.S) {
it("presents output", func() {
h.AssertNil(t, command.Execute())
h.AssertContains(t, outBuf.String(), `default-builder-image = "some/image"`)
h.AssertContains(t, outBuf.String(), `experimental = true`)
})
})
when("config.toml is not present", func() {
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
type Config struct {
RunImages []RunImage `toml:"run-images"`
DefaultBuilder string `toml:"default-builder-image,omitempty"`
Experimental bool `toml:"experimental,omitempty"`
}

type RunImage struct {
Expand Down
1 change: 1 addition & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func testConfig(t *testing.T, when spec.G, it spec.S) {
h.AssertNil(t, err)
h.AssertEq(t, subject.DefaultBuilder, "")
h.AssertEq(t, len(subject.RunImages), 0)
h.AssertEq(t, subject.Experimental, false)
})
})
})
Expand Down

0 comments on commit aca6493

Please sign in to comment.