From fa8128be2320b0d2c42780e29a4b74e3d18e5436 Mon Sep 17 00:00:00 2001 From: David Cheung Date: Tue, 30 Jun 2020 15:18:44 -0400 Subject: [PATCH] fix parsing project config missing value shouldPushRepositories flag was defaulting to false and test case was expecting the default case, so didn't catch this --- internal/config/projectconfig/project_config.go | 2 +- internal/config/projectconfig/project_config_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/config/projectconfig/project_config.go b/internal/config/projectconfig/project_config.go index f377f2277..e6b2d9522 100644 --- a/internal/config/projectconfig/project_config.go +++ b/internal/config/projectconfig/project_config.go @@ -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"` } diff --git a/internal/config/projectconfig/project_config_test.go b/internal/config/projectconfig/project_config_test.go index 4495036c8..b61256ded 100644 --- a/internal/config/projectconfig/project_config_test.go +++ b/internal/config/projectconfig/project_config_test.go @@ -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) { @@ -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 { @@ -51,7 +51,7 @@ func validConfigContent() string { # Templated zero-project.yml file name: abc -shouldPushRepositories: false +shouldPushRepositories: true modules: aws-eks-stack: