feat: split tests out even more and start deploy tests in parallel
This commit is contained in:
1 parent
42a46df51f
commit
36ceca7a94
20 files changed
+1347
-1203
No files matched your search
@@ -16,102 +16,6 @@ teardown() {
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx (no server tokens)" {
|
||||
deploy_app
|
||||
run /bin/bash -c "curl -s -D - $(dokku url $TEST_APP) -o /dev/null | grep -E '^Server' | grep -E '[0-9]+'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) logging" {
|
||||
deploy_app
|
||||
|
||||
run [ -a "/var/log/nginx/$TEST_APP-access.log" ]
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run [ -a "/var/log/nginx/$TEST_APP-error.log" ]
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:access-logs $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:error-logs $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) log-path" {
|
||||
deploy_app
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP access-log-path off"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_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_output_contains "off;"
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP access-log-path"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_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_output_contains "off;" 0
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP error-log-path off"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_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_output_contains "off;"
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP error-log-path"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_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_output_contains "off;" 0
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:build-config (with SSL and unrelated domain)" {
|
||||
setup_test_tls
|
||||
add_domain "node-js-app.dokku.me"
|
||||
@@ -152,222 +56,3 @@ teardown() {
|
||||
assert_ssl_domain "www.test.dokku.me"
|
||||
assert_ssl_domain "www.test.app.dokku.me"
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:build-config (wildcard SSL and custom nginx template)" {
|
||||
setup_test_tls wildcard
|
||||
add_domain "wildcard1.dokku.me"
|
||||
add_domain "wildcard2.dokku.me"
|
||||
deploy_app nodejs-express dokku@dokku.me:$TEST_APP custom_ssl_nginx_template
|
||||
|
||||
assert_ssl_domain "wildcard1.dokku.me"
|
||||
assert_ssl_domain "wildcard2.dokku.me"
|
||||
assert_http_redirect "http://${CUSTOM_TEMPLATE_SSL_DOMAIN}" "https://${CUSTOM_TEMPLATE_SSL_DOMAIN}:443/"
|
||||
assert_http_success "https://${CUSTOM_TEMPLATE_SSL_DOMAIN}"
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:build-config (custom nginx template - no ssl)" {
|
||||
add_domain "www.test.app.dokku.me"
|
||||
run deploy_app nodejs-express dokku@dokku.me:$TEST_APP custom_nginx_template
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku ps:scale $TEST_APP worker=1"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
assert_nonssl_domain "www.test.app.dokku.me"
|
||||
assert_http_success "customtemplate.dokku.me"
|
||||
|
||||
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "${TEST_APP}-worker-5000"
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:build-config (failed validate_nginx)" {
|
||||
run deploy_app nodejs-express dokku@dokku.me:$TEST_APP bad_custom_nginx_template
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:set hsts" {
|
||||
setup_test_tls wildcard
|
||||
local HSTS_CONF="/home/dokku/${TEST_APP}/nginx.conf.d/hsts.conf"
|
||||
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_contains "Enabling HSTS"
|
||||
|
||||
run /bin/bash -c "test -f $HSTS_CONF"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "cat $HSTS_CONF | grep includeSubdomains"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "cat $HSTS_CONF | grep 'max-age=15724800'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "cat $HSTS_CONF | grep preload"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP hsts-include-subdomains false"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "cat $HSTS_CONF | grep includeSubdomains"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP hsts-max-age 120"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "cat $HSTS_CONF | grep 'max-age=120'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP hsts-preload true"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "cat $HSTS_CONF | grep preload"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP hsts false"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_contains "Enabling HSTS" 0
|
||||
|
||||
run /bin/bash -c "test -f $DOKKU_ROOT/$TEST_APP/nginx.conf.d/hsts.conf"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:set bind-address" {
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4 127.0.0.1"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv6 ::1"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_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_output_contains "[::1]:80;"
|
||||
assert_output_contains "127.0.0.1:80;"
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv6"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_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_output_contains "[::1]:80;" 0
|
||||
assert_output_contains "127.0.0.1:80;" 0
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:validate-config" {
|
||||
deploy_app
|
||||
run /bin/bash -c "dokku nginx:validate-config"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:validate-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
echo "invalid config" > "/home/dokku/${TEST_APP}/nginx.conf"
|
||||
|
||||
run /bin/bash -c "dokku nginx:validate-config"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
|
||||
run /bin/bash -c "dokku nginx:validate-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
|
||||
run /bin/bash -c "dokku nginx:validate-config --clean"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:validate-config"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
echo "invalid config" > "/home/dokku/${TEST_APP}/nginx.conf"
|
||||
|
||||
run /bin/bash -c "dokku nginx:validate-config $TEST_APP --clean"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:validate-config"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
}
|
||||
Reference in new issue
Block a user