forked from toolshed/abra
test: tag/git helpers & refactor [ci skip]
This commit is contained in:
@ -86,12 +86,7 @@ teardown(){
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --no-converge-checks
|
||||
assert_success
|
||||
|
||||
# NOTE(d1): nuke it to ensure clean git state
|
||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
_fetch_recipe "$TEST_RECIPE"
|
||||
|
||||
_reset_recipe "$TEST_RECIPE"
|
||||
_undeploy_app
|
||||
}
|
||||
|
||||
@ -112,30 +107,14 @@ teardown(){
|
||||
assert_output --partial 'behind 3'
|
||||
|
||||
_undeploy_app
|
||||
|
||||
# NOTE(d1): nuke it to ensure clean git state
|
||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
_fetch_recipe "$TEST_RECIPE"
|
||||
_reset_recipe "$TEST_RECIPE"
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "deploy latest commit if no published versions and no --chaos" {
|
||||
latestCommit="$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-parse --short HEAD)"
|
||||
|
||||
run bash -c 'git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | wc -l'
|
||||
assert_success
|
||||
refute_output '0'
|
||||
|
||||
run bash -c 'git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | \
|
||||
xargs -I{} git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -d {}'
|
||||
assert_success
|
||||
assert_output --partial 'Deleted tag'
|
||||
|
||||
run bash -c 'git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | wc -l'
|
||||
assert_success
|
||||
assert_output '0'
|
||||
_remove_tags
|
||||
|
||||
# NOTE(d1): need to pass --offline to stop tags being pulled again
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" \
|
||||
@ -146,13 +125,7 @@ teardown(){
|
||||
refute_output --partial 'chaos'
|
||||
|
||||
_undeploy_app
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" fetch --all
|
||||
assert_success
|
||||
|
||||
run bash -c 'git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | wc -l'
|
||||
assert_success
|
||||
refute_output '0'
|
||||
_reset_tags
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@ -175,12 +148,7 @@ teardown(){
|
||||
assert_output --partial 'chaos'
|
||||
|
||||
_undeploy_app
|
||||
|
||||
# NOTE(d1): nuke it to ensure clean git state
|
||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
_fetch_recipe "$TEST_RECIPE"
|
||||
_reset_recipe
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
|
Reference in New Issue
Block a user