From df834f41f313df49ff41abc6f22b01b2eab5ee3a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 28 Jul 2018 00:19:13 -0400 Subject: [PATCH] feat: add a test to prove that tls breaks app renames --- tests/unit/10_apps.bats | 15 ++++++++++++++- tests/unit/30_core_1.bats | 6 ------ tests/unit/40_core_2.bats | 6 ------ tests/unit/test_helper.bash | 6 ++++++ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/tests/unit/10_apps.bats b/tests/unit/10_apps.bats index e58ec2e03..1fce0c5be 100644 --- a/tests/unit/10_apps.bats +++ b/tests/unit/10_apps.bats @@ -113,6 +113,19 @@ teardown () { assert_success } +@test "(apps) apps:rename with tls" { + setup_test_tls + deploy_app + run bash -c "dokku apps:rename $TEST_APP great-test-name" + echo "output: "$output + echo "status: "$status + assert_success + run bash -c "dokku --force apps:destroy great-test-name" + echo "output: "$output + echo "status: "$status + assert_success +} + @test "(apps) apps:clone" { deploy_app run bash -c "dokku apps:clone $TEST_APP great-test-name" @@ -213,4 +226,4 @@ teardown () { assert_output "false" destroy_app -} \ No newline at end of file +} diff --git a/tests/unit/30_core_1.bats b/tests/unit/30_core_1.bats index 310a2854c..e9c9c235d 100644 --- a/tests/unit/30_core_1.bats +++ b/tests/unit/30_core_1.bats @@ -24,12 +24,6 @@ assert_urls() { assert_output < <(tr ' ' '\n' <<< "${urls}") } -build_nginx_config() { - # simulate nginx post-deploy - dokku domains:setup $TEST_APP - dokku nginx:build-config $TEST_APP -} - @test "(core) remove exited containers" { deploy_app diff --git a/tests/unit/40_core_2.bats b/tests/unit/40_core_2.bats index a26d2c8b6..9a82423a5 100644 --- a/tests/unit/40_core_2.bats +++ b/tests/unit/40_core_2.bats @@ -31,12 +31,6 @@ assert_url() { assert_output "${url}" } -build_nginx_config() { - # simulate nginx post-deploy - dokku domains:setup $TEST_APP - dokku nginx:build-config $TEST_APP -} - @test "(core) run (with --options)" { deploy_app run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version" diff --git a/tests/unit/test_helper.bash b/tests/unit/test_helper.bash index ee94c70dc..ab4dbb5b5 100644 --- a/tests/unit/test_helper.bash +++ b/tests/unit/test_helper.bash @@ -372,3 +372,9 @@ cat< "$APP_REPO_DIR/nginx.conf.sigil" some lame nginx config EOF } + +build_nginx_config() { + # simulate nginx post-deploy + dokku domains:setup "$TEST_APP" + dokku nginx:build-config "$TEST_APP" +}