Skip to content

Commit

Permalink
Merge pull request #157 from Appliscale/configuration-file-test
Browse files Browse the repository at this point in the history
Configuration file test
  • Loading branch information
maxiwoj authored Sep 17, 2018
2 parents 6be9486 + 862c81a commit 68f0214
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions linter/stylechecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func checkAWSCFSpecificStuff(ctx *context.Context, rawTemplate string, lintConf
}

for resourceName := range goFormationTemplate.Resources {
if lintConf.CheckLogicalName(resourceName) {
ctx.Logger.Warning("Resource '" + resourceName + "' does not meet the given logical Name regex")
if !lintConf.CheckLogicalName(resourceName) {
ctx.Logger.Warning("Resource '" + resourceName + "' does not meet the given logical Name regex: " + lintConf.Global.NamingConventions.LogicalNames)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions progress/parsewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func NewParseWriter() (pw *ParseWriter) {
createCompleteStatus: pw.bgGreen,
updateCompleteStatus: pw.bgGreen,
reviewInProgressStatus: pw.cyan,
add: pw.bgGreen,
remove: pw.bgRed,
modify: pw.fgOrange,
add: pw.bgGreen,
remove: pw.bgRed,
modify: pw.fgOrange,
}
return
}
Expand Down
17 changes: 12 additions & 5 deletions stack/mocks/mock_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mocks
import (
"github.com/Appliscale/perun/cliparser"
"github.com/Appliscale/perun/configuration"
"github.com/Appliscale/perun/configurator"
"github.com/Appliscale/perun/context"
"github.com/Appliscale/perun/logger"
"io/ioutil"
Expand All @@ -19,11 +20,7 @@ func SetupContext(t *testing.T, args []string) *context.Context {
return &context.Context{}
}

config, err := configuration.GetConfiguration(cliArguments, &myLogger)
if err != nil {
t.Error(err.Error())
return &context.Context{}
}
config := createDefaultConfiguration()
iconsistenciesConfig := configuration.ReadInconsistencyConfiguration(&myLogger)

ctx := context.Context{
Expand All @@ -44,3 +41,13 @@ func ReadFile(t *testing.T, filePath string) string {
template := string(rawTemplate)
return template
}

func createDefaultConfiguration() configuration.Configuration {
return configuration.Configuration{
DefaultProfile: "default",
DefaultRegion: "region",
SpecificationURL: configurator.ResourceSpecificationURL,
DefaultDecisionForMFA: false,
DefaultDurationForMFA: 3600,
DefaultVerbosity: "INFO"}
}
4 changes: 2 additions & 2 deletions utilities/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

const Motto = "Swiss army knife for AWS CloudFormation templates"

const ReleaseName = "Nimbostratus"
const VersionNumber = "1.1.0-beta"
const ReleaseName = "Altostratus"
const VersionNumber = "1.3.1"

func VersionStatus() string {
return fmt.Sprintf("perun %s (%s release) - %s", VersionNumber, ReleaseName, Motto)
Expand Down

0 comments on commit 68f0214

Please sign in to comment.