test: int suite fixes

This commit is contained in:
2024-07-17 13:22:14 +02:00
parent e5a6dea10c
commit 8b8e158664
20 changed files with 115 additions and 79 deletions

View File

@ -64,7 +64,7 @@ EXAMPLE:
app.Recipe.Version = specificVersion
}
if specificVersion == "" && app.Recipe.Version != "" {
if specificVersion == "" && app.Recipe.Version != "" && !internal.Chaos {
log.Debugf("retrieved %s as version from env file", app.Recipe.Version)
specificVersion = app.Recipe.Version
}

View File

@ -160,6 +160,7 @@ var appSecretInsertCommand = cli.Command{
internal.PassFlag,
internal.FileFlag,
internal.TrimFlag,
internal.ChaosFlag,
},
Before: internal.SubCommandBefore,
ArgsUsage: "<domain> <secret-name> <version> <data>",

View File

@ -61,7 +61,6 @@ var recipeVersionCommand = cli.Command{
log.Fatalf("%s has no published versions?", recipe.Name)
}
var allRows [][]string
for i := len(recipeMeta.Versions) - 1; i >= 0; i-- {
table, err := formatter.CreateTable()
if err != nil {
@ -71,6 +70,7 @@ var recipeVersionCommand = cli.Command{
table.Headers("SERVICE", "NAME", "TAG")
for version, meta := range recipeMeta.Versions[i] {
var allRows [][]string
var rows [][]string
for service, serviceMeta := range meta {
@ -86,6 +86,18 @@ var recipeVersionCommand = cli.Command{
fmt.Println(table)
log.Infof("VERSION: %s", version)
fmt.Println()
continue
}
if internal.MachineReadable {
sort.Slice(allRows, sortServiceByName(allRows))
headers := []string{"VERSION", "SERVICE", "NAME", "TAG"}
out, err := formatter.ToJSON(headers, allRows)
if err != nil {
log.Fatal("unable to render to JSON: %s", err)
}
fmt.Println(out)
continue
}
}
}
@ -96,17 +108,6 @@ var recipeVersionCommand = cli.Command{
}
}
if internal.MachineReadable {
sort.Slice(allRows, sortServiceByName(allRows))
headers := []string{"VERSION", "SERVICE", "NAME", "TAG"}
out, err := formatter.ToJSON(headers, allRows)
if err != nil {
log.Fatal("unable to render to JSON: %s", err)
}
fmt.Println(out)
return nil
}
return nil
},
}