Add some tests...

Not very efficient to make this after development, but at least I can
ensure that some basic stuffs are checked.
This commit is contained in:
2022-02-20 15:23:55 +01:00
parent e2f9ab97b9
commit 14587e032b
5 changed files with 283 additions and 15 deletions

View File

@@ -21,6 +21,13 @@ func Generate(p *compose.Parser, katernayVersion, appName, appVersion, composeFi
helm.Appname = appName
helm.Version = katernayVersion
templatesDir := filepath.Join(dirName, "templates")
// try to create the directory
err := os.MkdirAll(templatesDir, 0755)
if err != nil {
panic(err)
}
files := make(map[string]chan interface{})
// list avoided services
@@ -123,7 +130,7 @@ func Generate(p *compose.Parser, katernayVersion, appName, appVersion, composeFi
fp.WriteString(`# Create on ` + time.Now().Format(time.RFC3339) + "\n")
fp.WriteString(`# Katenary command line: ` + strings.Join(os.Args, " ") + "\n")
enc = yaml.NewEncoder(fp)
enc.SetIndent(2)
enc.SetIndent(writers.IndentSize)
enc.Encode(map[string]interface{}{
"apiVersion": "v2",
"name": appName,