tests: add test for app-json:set
This commit is contained in:
@@ -24,6 +24,6 @@ func CommandReport(appName string, format string, infoFlag string) error {
|
||||
|
||||
// CommandSet set or clear a builder property for an app
|
||||
func CommandSet(appName string, property string, value string) error {
|
||||
common.CommandPropertySet("builder", appName, property, value, DefaultProperties, GlobalProperties)
|
||||
common.CommandPropertySet("app-json", appName, property, value, DefaultProperties, GlobalProperties)
|
||||
return nil
|
||||
}
|
||||
|
||||
8
tests/apps/python/app2.json
Normal file
8
tests/apps/python/app2.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"scripts": {
|
||||
"dokku": {
|
||||
"predeploy": "touch /app/predeploy2.test",
|
||||
"postdeploy": "touch /app/postdeploy.test"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,3 +151,29 @@ teardown() {
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(app-json:set)" {
|
||||
run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path app2.json"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run deploy_app python
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_contains "touch /app/predeploy2.test"
|
||||
|
||||
run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path"
|
||||
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 "touch /app/predeploy.test"
|
||||
assert_output_contains "touch /app/predeploy2.test" 0
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user