tests: add a test case to cover new functionality
This commit is contained in:
@@ -149,3 +149,67 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_output_contains "proxy_busy_buffers_size 10k;" 0
|
assert_output_contains "proxy_busy_buffers_size 10k;" 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@test "(nginx-vhosts) nginx:set nginx.conf.sigil" {
|
||||||
|
local TMP=$(mktemp -d "/tmp/dokku.me.XXXXX")
|
||||||
|
trap 'popd &>/dev/null || true; rm -rf "$TMP"' INT TERM
|
||||||
|
export CUSTOM_TMP="$TMP"
|
||||||
|
|
||||||
|
run deploy_app python
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains "Overriding default nginx.conf with detected nginx.conf.sigil" 0
|
||||||
|
|
||||||
|
pushd $TMP
|
||||||
|
custom_nginx_template "$TEST_APP" "$CUSTOM_TMP"
|
||||||
|
|
||||||
|
run /bin/bash -c "git add nginx.conf.sigil"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "git commit -m 'Add custom nginx.conf.sigil'"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "git push target master:master"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains "Overriding default nginx.conf with detected nginx.conf.sigil"
|
||||||
|
|
||||||
|
mv "$CUSTOM_TMP/nginx.conf.sigil" "$CUSTOM_TMP/nginx.conf.sigil-2"
|
||||||
|
|
||||||
|
run /bin/bash -c "git add nginx.conf.sigil nginx.conf.sigil-2"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "git commit -m 'Moving nginx.conf.sigil'"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "git push target master:master"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains "Overriding default nginx.conf with detected nginx.conf.sigil" 0
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku nginx:set $TEST_APP nginx-conf-sigil-path nginx.conf.sigil-2"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains "Overriding default nginx.conf with detected nginx.conf.sigil"
|
||||||
|
|
||||||
|
popd
|
||||||
|
rm -rf "$TMP"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user