partially fix tests/integration/app_cmd.bats
This commit is contained in:
parent
428426b6b7
commit
ac39d6ab97
|
@ -58,7 +58,7 @@ test_cmd_export"
|
||||||
assert_success
|
assert_success
|
||||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||||
|
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'baz'
|
assert_output --partial 'baz'
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ test_cmd_export"
|
||||||
assert_success
|
assert_success
|
||||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||||
|
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial 'locally unstaged changes'
|
assert_output --partial 'locally unstaged changes'
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ test_cmd_export"
|
||||||
assert_success
|
assert_success
|
||||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
|
||||||
|
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --chaos
|
run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'baz'
|
assert_output --partial 'baz'
|
||||||
|
|
||||||
|
@ -96,14 +96,14 @@ test_cmd_export"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||||
assert_output --partial 'behind 3'
|
assert_output --partial "Your branch is behind 'origin/main' by 3 commits"
|
||||||
|
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'baz'
|
assert_output --partial 'baz'
|
||||||
|
|
||||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||||
refute_output --partial 'behind 3'
|
assert_output --partial "Your branch is up to date with 'origin/main'"
|
||||||
|
|
||||||
_reset_recipe "$TEST_RECIPE"
|
_reset_recipe "$TEST_RECIPE"
|
||||||
}
|
}
|
||||||
|
@ -113,14 +113,14 @@ test_cmd_export"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||||
assert_output --partial 'behind 3'
|
assert_output --partial "Your branch is behind 'origin/main' by 3 commits"
|
||||||
|
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --offline
|
run $ABRA app cmd --local --offline "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'baz'
|
assert_output --partial 'baz'
|
||||||
|
|
||||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||||
assert_output --partial 'behind 3'
|
assert_output --partial "Your branch is behind 'origin/main' by 3 commits"
|
||||||
|
|
||||||
_reset_recipe "$TEST_RECIPE"
|
_reset_recipe "$TEST_RECIPE"
|
||||||
}
|
}
|
||||||
|
@ -132,13 +132,13 @@ test_cmd_export"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "error if missing arguments when passing --local" {
|
@test "error if missing arguments when passing --local" {
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" --local
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN"
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial 'missing arguments'
|
assert_output --partial 'missing arguments'
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "cannot use --local and --user at same time" {
|
@test "cannot use --local and --user at same time" {
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --user root
|
run $ABRA app cmd --local --user root "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial 'cannot use --local & --user together'
|
assert_output --partial 'cannot use --local & --user together'
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ test_cmd_export"
|
||||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh"
|
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --chaos
|
run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh does not exist"
|
assert_output --partial "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh does not exist"
|
||||||
|
|
||||||
|
@ -155,25 +155,25 @@ test_cmd_export"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "error if missing command" {
|
@test "error if missing command" {
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" doesnt_exist --local
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN" doesnt_exist
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial "doesn't have a doesnt_exist function"
|
assert_output --partial "doesn't have a doesnt_exist function"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "run --local command" {
|
@test "run --local command" {
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'baz'
|
assert_output --partial 'baz'
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "run command with single arg" {
|
@test "run command with single arg" {
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd_arg --local -- bing
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_arg -- bing
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'bing'
|
assert_output --partial 'bing'
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "run command with several args" {
|
@test "run command with several args" {
|
||||||
run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd_args --local -- bong bang
|
run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_args -- bong bang
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'bong bang'
|
assert_output --partial 'bong bang'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue