tests: add assertions to various bats tests
Missing these assertions didn't necessarily break tests but they are more correct and having them should help suss out bugs.
This commit is contained in:
1 parent
69e56fc976
commit
622548057c
37 files changed
+623
-144
No files matched your search
@@ -9,13 +9,16 @@ setup() {
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app 0 $TEST_APP
|
||||
destroy_app
|
||||
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) logging" {
|
||||
deploy_app
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run [ -a "/var/log/nginx/$TEST_APP-access.log" ]
|
||||
echo "output: $output"
|
||||
@@ -39,7 +42,10 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) log-path" {
|
||||
deploy_app
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP access-log-path off"
|
||||
echo "output: $output"
|
||||
@@ -103,7 +109,10 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) access-log-format" {
|
||||
deploy_app
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP access-log-format combined"
|
||||
echo "output: $output"
|
||||
@@ -154,20 +163,52 @@ teardown() {
|
||||
|
||||
@test "(nginx-vhosts) proxy:build-config (with SSL and unrelated domain)" {
|
||||
setup_test_tls
|
||||
dokku domains:add $TEST_APP "node-js-app.dokku.me"
|
||||
dokku domains:add $TEST_APP "test.dokku.me"
|
||||
deploy_app
|
||||
dokku nginx:show-config $TEST_APP
|
||||
run /bin/bash -c "dokku domains:add $TEST_APP node-js-app.dokku.me"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku domains:add $TEST_APP test.dokku.me"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
assert_ssl_domain "node-js-app.dokku.me"
|
||||
assert_http_redirect "http://test.dokku.me" "https://test.dokku.me:443/"
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) proxy:build-config (wildcard SSL)" {
|
||||
setup_test_tls wildcard
|
||||
dokku domains:add $TEST_APP "wildcard1.dokku.me"
|
||||
dokku domains:add $TEST_APP "wildcard2.dokku.me"
|
||||
deploy_app
|
||||
dokku nginx:show-config $TEST_APP
|
||||
run /bin/bash -c "dokku domains:add $TEST_APP wildcard1.dokku.me"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku domains:add $TEST_APP wildcard2.dokku.me"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
assert_ssl_domain "wildcard1.dokku.me"
|
||||
assert_ssl_domain "wildcard2.dokku.me"
|
||||
}
|
||||
Reference in new issue
Block a user