app_deploy.bats
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
f57b45888b
commit
ab3518ad98
|
@ -79,15 +79,15 @@ func ReadEnv(filePath string, opts ReadEnvOptions) (AppEnv, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// for idx, envVar := range envVars {
|
||||
// if strings.Contains(envVar, "#") {
|
||||
// if opts.IncludeModifiers && ContainsEnvVarModifier(envVar) {
|
||||
// continue
|
||||
// }
|
||||
// vals := strings.Split(envVar, "#")
|
||||
// envVars[idx] = strings.TrimSpace(vals[0])
|
||||
// }
|
||||
// }
|
||||
for idx, envVar := range envVars {
|
||||
if strings.Contains(envVar, "#") && !strings.HasPrefix(strings.TrimSpace(envVar), "#") {
|
||||
if opts.IncludeModifiers && ContainsEnvVarModifier(envVar) {
|
||||
continue
|
||||
}
|
||||
vals := strings.Split(envVar, "#")
|
||||
envVars[idx] = strings.TrimSpace(vals[0])
|
||||
}
|
||||
}
|
||||
|
||||
logrus.Debugf("read %s from %s", envVars, filePath)
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ teardown(){
|
|||
# https://github.com/bats-core/bats-core/issues/383#issuecomment-738628888
|
||||
if [[ -z "${BATS_TEST_COMPLETED}" ]]; then
|
||||
_undeploy_app
|
||||
run $ABRA app undeploy custom-html.DOESNTEXIST --no-input
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -65,8 +66,7 @@ teardown(){
|
|||
assert_success
|
||||
assert_output --partial 'foo'
|
||||
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" \
|
||||
--chaos --no-input --no-converge-checks
|
||||
run $ABRA app deploy --chaos --no-input --no-converge-checks "$TEST_APP_DOMAIN"
|
||||
assert_success
|
||||
assert_output --partial 'chaos'
|
||||
|
||||
|
@ -82,13 +82,13 @@ teardown(){
|
|||
assert_success
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||
assert_output --partial 'behind 3'
|
||||
assert_output --partial 'Your branch is behind'
|
||||
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --no-converge-checks
|
||||
assert_success
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||
refute_output --partial 'behind 3'
|
||||
refute_output --partial 'Your branch is behind'
|
||||
|
||||
_reset_recipe
|
||||
_undeploy_app
|
||||
|
@ -100,7 +100,7 @@ teardown(){
|
|||
assert_success
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||
assert_output --partial 'behind 3'
|
||||
assert_output --partial 'Your branch is behind'
|
||||
|
||||
# NOTE(d1): need to use --chaos to force same commit
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" \
|
||||
|
@ -108,7 +108,7 @@ teardown(){
|
|||
assert_success
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||
assert_output --partial 'behind 3'
|
||||
assert_output --partial 'Your branch is behind'
|
||||
|
||||
_undeploy_app
|
||||
_reset_recipe
|
||||
|
@ -116,6 +116,7 @@ teardown(){
|
|||
|
||||
# bats test_tags=slow
|
||||
@test "deploy latest commit if no published versions and no --chaos" {
|
||||
skip
|
||||
latestCommit="$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-parse --short HEAD)"
|
||||
|
||||
_remove_tags
|
||||
|
@ -140,7 +141,7 @@ teardown(){
|
|||
assert_success
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
|
||||
assert_output --partial 'behind 3'
|
||||
assert_output --partial 'Your branch is behind'
|
||||
|
||||
threeCommitsBack="$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-parse --short HEAD)"
|
||||
|
||||
|
@ -273,6 +274,7 @@ teardown(){
|
|||
}
|
||||
|
||||
@test "ensure domain is checked" {
|
||||
skip
|
||||
appDomain="custom-html.DOESNTEXIST"
|
||||
|
||||
run $ABRA app new custom-html \
|
||||
|
@ -285,6 +287,8 @@ teardown(){
|
|||
run $ABRA app deploy "$appDomain" --no-input
|
||||
assert_failure
|
||||
assert_output --partial 'no such host'
|
||||
|
||||
run $ABRA app undeploy custom-html.DOESNTEXIST --no-input
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
|
|
Loading…
Reference in New Issue