From 5ea4c9a73d63d7603aa13457ab27518cfbb40b20 Mon Sep 17 00:00:00 2001 From: Michael Chen Date: Mon, 31 Aug 2020 18:28:59 +0200 Subject: [PATCH 1/2] :bug: Whitelist config:clear command in Makefile --- plugins/config/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/config/Makefile b/plugins/config/Makefile index afca09a61..8fd01f747 100644 --- a/plugins/config/Makefile +++ b/plugins/config/Makefile @@ -1,4 +1,4 @@ -SUBCOMMANDS = subcommands/bundle subcommands/export subcommands/get subcommands/keys subcommands/show subcommands/set subcommands/unset +SUBCOMMANDS = subcommands/bundle subcommands/clear subcommands/export subcommands/get subcommands/keys subcommands/show subcommands/set subcommands/unset TRIGGERS = triggers/config-get triggers/config-get-global BUILD = commands subcommands triggers PLUGIN_NAME = config From e64f7b34ff1744d3da5877a92664adbcbaab0d17 Mon Sep 17 00:00:00 2001 From: Michael Chen Date: Mon, 31 Aug 2020 18:48:36 +0200 Subject: [PATCH 2/2] Add unit test for config:clear --- tests/unit/config.bats | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/unit/config.bats b/tests/unit/config.bats index c0221ab80..376d577ff 100644 --- a/tests/unit/config.bats +++ b/tests/unit/config.bats @@ -117,6 +117,21 @@ teardown() { assert_output "hello world" } +@test "(config) config:clear" { + run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\" test_var3=\"with\\nnewline\" + echo "output: $output" + echo "status: $status" + assert_success + run /bin/bash -c "dokku config:clear $TEST_APP" + echo "output: $output" + echo "status: $status" + assert_success + run /bin/bash -c "dokku config:get $TEST_APP test_var" + echo "output: $output" + echo "status: $status" + assert_output "" +} + @test "(config) config:unset" { run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\" test_var3=\"with\\nnewline\" echo "output: $output"