test: integration test patches
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-12-28 16:39:58 +01:00
parent 97959ef5da
commit dc4c6784cb
6 changed files with 19 additions and 72 deletions

View File

@ -64,10 +64,19 @@ var AppNewCommand = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
recipe := internal.ValidateRecipe(args, cmd.Name())
if !internal.Chaos {
if err := recipe.EnsureIsClean(); err != nil {
log.Fatal(err)
}
if len(args) == 2 && internal.Chaos {
log.Fatal("cannot use [version] and --chaos together")
}
var recipeVersion string
if len(args) == 2 {
recipeVersion = args[1]
}
chaosVersion := config.CHAOS_DEFAULT
if internal.Chaos {
recipeVersion = chaosVersion
if !internal.Offline {
if err := recipe.EnsureUpToDate(); err != nil {
log.Fatal(err)
@ -75,9 +84,10 @@ var AppNewCommand = &cobra.Command{
}
}
var recipeVersion string
if len(args) == 2 {
recipeVersion = args[1]
if !internal.Chaos {
if err := recipe.EnsureIsClean(); err != nil {
log.Fatal(err)
}
}
var recipeVersions recipePkg.RecipeVersions
@ -104,21 +114,6 @@ var AppNewCommand = &cobra.Command{
}
}
if !internal.Chaos && recipeVersion != "" {
if _, err := recipe.EnsureVersion(recipeVersion); err != nil {
log.Fatal(err)
}
}
chaosVersion := config.CHAOS_DEFAULT
if internal.Chaos {
var err error
chaosVersion, err = recipe.ChaosVersion()
if err != nil {
log.Fatal(err)
}
}
if err := ensureServerFlag(); err != nil {
log.Fatal(err)
}