Merge pull request #3597 from dokku/trace-tests

Allow default trace function to work
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2019-06-21 11:05:58 -04:00
commit 23d647ee51
2 files changed
+63 -1

No files matched your search

+1 -1
View File
@@ -137,7 +137,7 @@ execute_dokku_cmd() {
deploy | delete | ls | run | cleanup) deploy | delete | ls | run | cleanup)
local PLUGIN_NAME="00_dokku-standard" local PLUGIN_NAME="00_dokku-standard"
;; ;;
trace | url | urls | report) url | urls | report)
local PLUGIN_NAME="00_dokku-standard" local PLUGIN_NAME="00_dokku-standard"
;; ;;
esac esac
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env bats
load test_helper
setup() {
global_setup
rm -f "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
}
teardown() {
rm -f "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
global_teardown
}
@test "(trace) trace:on" {
run /bin/bash -c "dokku trace:on"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "test -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(trace) trace on" {
run /bin/bash -c "dokku trace on"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "test -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(trace) trace:off, trace off" {
touch "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
run /bin/bash -c "dokku trace:off"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "test -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
echo "output: $output"
echo "status: $status"
assert_failure
touch "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
run /bin/bash -c "dokku trace off"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "test -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
echo "output: $output"
echo "status: $status"
assert_failure
}