refactor: cleanup zero'd out processes when a Procfile omitting those process types is set

This change also moves the referenced Procfile out to a host path once on deploy vs potentially several times, which should speed up deploys a small amount and simplify reasoning about the file.

Closes #5112
This commit is contained in:
Jose Diaz-Gonzalez
2022-11-25 00:41:55 -05:00
parent 3100eeb151
commit fe4d80a82b
9 changed files with 139 additions and 166 deletions

View File

@@ -128,3 +128,50 @@ teardown() {
assert_success
assert_output_contains 'SECRET_KEY:'
}
@test "(ps:scale) remove zerod processes" {
run /bin/bash -c "dokku builder-herokuish:set $TEST_APP allowed true"
echo "output: $output"
echo "status: $status"
assert_success
run deploy_app python
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
run /bin/bash -c "dokku --quiet ps:scale $TEST_APP"
output=$(echo "$output" | tr -s " ")
echo "output: ($output)"
assert_output $'cron: 0\ncustom: 0\nrelease: 0\nweb: 1\nworker: 1'
run /bin/bash -c "dokku ps:scale $TEST_APP worker=0"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku --quiet ps:scale $TEST_APP"
output=$(echo "$output" | tr -s " ")
echo "output: ($output)"
assert_output $'cron: 0\ncustom: 0\nrelease: 0\nweb: 1\nworker: 0'
run /bin/bash -c "dokku ps:set $TEST_APP procfile-path second.Procfile"
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
run /bin/bash -c "dokku --quiet ps:scale $TEST_APP"
output=$(echo "$output" | tr -s " ")
echo "output: ($output)"
assert_output 'web: 1'
}