Skip to content

Commit

Permalink
fix parsing project config missing value
Browse files Browse the repository at this point in the history
shouldPushRepositories flag was defaulting to false
and test case was expecting the default case, so didn't catch this
  • Loading branch information
davidcheung committed Jun 30, 2020
1 parent 0fedb31 commit fa8128b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/config/projectconfig/project_config.go
Expand Up @@ -14,7 +14,7 @@ const GraphRootName = "graphRoot"

type ZeroProjectConfig struct {
Name string `yaml:"name"`
ShouldPushRepositories bool
ShouldPushRepositories bool `yaml:"shouldPushRepositories"`
Parameters map[string]string
Modules Modules `yaml:"modules"`
}
Expand Down
8 changes: 4 additions & 4 deletions internal/config/projectconfig/project_config_test.go
Expand Up @@ -24,8 +24,9 @@ func TestLoadConfig(t *testing.T) {
filePath := file.Name()

want := &projectconfig.ZeroProjectConfig{
Name: "abc",
Modules: eksGoReactSampleModules(),
Name: "abc",
ShouldPushRepositories: true,
Modules: eksGoReactSampleModules(),
}

t.Run("Should load and unmarshal config correctly", func(t *testing.T) {
Expand All @@ -34,7 +35,6 @@ func TestLoadConfig(t *testing.T) {
t.Errorf("projectconfig.ZeroProjectConfig.Unmarshal mismatch (-want +got):\n%s", cmp.Diff(want, got))
}
})

}

func eksGoReactSampleModules() projectconfig.Modules {
Expand All @@ -51,7 +51,7 @@ func validConfigContent() string {
# Templated zero-project.yml file
name: abc
shouldPushRepositories: false
shouldPushRepositories: true
modules:
aws-eks-stack:
Expand Down

0 comments on commit fa8128b

Please sign in to comment.