diff --git a/plugins/buildpacks/.gitignore b/plugins/buildpacks/.gitignore index 56aebe3b7..cd4903d6f 100644 --- a/plugins/buildpacks/.gitignore +++ b/plugins/buildpacks/.gitignore @@ -3,4 +3,5 @@ /triggers/* /install /post-delete +/post-extract /report diff --git a/plugins/resource/resource.go b/plugins/resource/resource.go index bd299e58c..526589cca 100644 --- a/plugins/resource/resource.go +++ b/plugins/resource/resource.go @@ -29,7 +29,7 @@ func ReportSingleApp(appName, infoFlag string) { resources, err := common.PropertyGetAll("resource", appName) if err != nil { - common.LogFail(err.Error()) + return } flags := []string{} diff --git a/tests/unit/40_report.bats b/tests/unit/40_report.bats new file mode 100644 index 000000000..a6daecec7 --- /dev/null +++ b/tests/unit/40_report.bats @@ -0,0 +1,48 @@ +#!/usr/bin/env bats + +load test_helper + +setup() { + global_setup + deploy_app +} + +teardown() { + destroy_app + global_teardown +} + +@test "(report) report" { + run /bin/bash -c "dokku report" + echo "output: $output" + echo "status: $status" + assert_output_contains "herokuish version:" + assert_success + + run /bin/bash -c "dokku report $TEST_APP 2>&1" + echo "output: $output" + echo "status: $status" + assert_output_contains "herokuish version:" + assert_output_contains "not deployed" "0" + assert_success + + run /bin/bash -c "dokku report fake-app-name" + echo "output: $output" + echo "status: $status" + assert_failure + + run /bin/bash -c "dokku report fake-app-name 2>&1" + echo "output: $output" + echo "status: $status" + assert_output_contains "App fake-app-name does not exist" + assert_failure + + dokku apps:create "${TEST_APP}-2" + run /bin/bash -c "dokku report ${TEST_APP}-2 2>&1" + echo "output: $output" + echo "status: $status" + assert_output_contains "not deployed" + assert_success + + dokku --force apps:destroy "${TEST_APP}-2" +}