fix: update tests to properly handle case where app is not running
This commit is contained in:
@@ -633,6 +633,7 @@ service_link() {
|
||||
plugn trigger service-action post-link "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "$APP"
|
||||
if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]] || [[ "$SERVICE_RESTART_APPS" == "false" ]]; then
|
||||
config_set --no-restart "$APP" "${ALIAS}_URL=$SERVICE_URL"
|
||||
dokku_log_verbose "Skipping restart of linked app"
|
||||
else
|
||||
config_set "$APP" "${ALIAS}_URL=$SERVICE_URL"
|
||||
fi
|
||||
@@ -977,6 +978,7 @@ service_unlink() {
|
||||
plugn trigger service-action post-unlink "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "$APP"
|
||||
if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]] || [[ "$SERVICE_RESTART_APPS" == "false" ]]; then
|
||||
config_unset --no-restart "$APP" "${LINK[@]}"
|
||||
dokku_log_verbose "Skipping restart of linked app"
|
||||
else
|
||||
config_unset "$APP" "${LINK[@]}"
|
||||
fi
|
||||
|
||||
@@ -117,11 +117,12 @@ teardown() {
|
||||
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
|
||||
}
|
||||
|
||||
|
||||
@test "($PLUGIN_COMMAND_PREFIX:link) respects --no-restart" {
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --no-restart
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Restarting app my-app" 1
|
||||
assert_output_contains "Skipping restart of linked app" 0
|
||||
assert_success
|
||||
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
|
||||
@@ -132,7 +133,7 @@ teardown() {
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --no-restart
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Restarting app my-app" 0
|
||||
assert_output_contains "Skipping restart of linked app"
|
||||
assert_success
|
||||
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
|
||||
|
||||
@@ -56,7 +56,7 @@ teardown() {
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Restarting app my-app" 1
|
||||
assert_output_contains "Skipping restart of linked app" 0
|
||||
assert_success
|
||||
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
|
||||
@@ -67,6 +67,6 @@ teardown() {
|
||||
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app --no-restart
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Restarting app my-app" 0
|
||||
assert_output_contains "Skipping restart of linked app"
|
||||
assert_success
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user