diff options
author | kaniini <nenolod@gmail.com> | 2019-04-22 07:19:53 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-04-22 07:19:53 +0000 |
commit | 05862ded7a156ad6db16a70ec90045a2149da97d (patch) | |
tree | 3f87cabddf373b61a33b901fe4084414e21f2977 /test/healthcheck_test.exs | |
parent | 7fcbda702e76b6390076c28832f5aea80086d15a (diff) | |
parent | 88f0be96933c287b99469edcfb6483cc91fa73c8 (diff) | |
download | pleroma-05862ded7a156ad6db16a70ec90045a2149da97d.tar.gz pleroma-05862ded7a156ad6db16a70ec90045a2149da97d.zip |
Merge branch 'feature/826-healthcheck-endpoint' into 'develop'
Feature/826 healthcheck endpoint
Closes #826
See merge request pleroma/pleroma!1083
Diffstat (limited to 'test/healthcheck_test.exs')
-rw-r--r-- | test/healthcheck_test.exs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/healthcheck_test.exs b/test/healthcheck_test.exs new file mode 100644 index 000000000..e05061220 --- /dev/null +++ b/test/healthcheck_test.exs @@ -0,0 +1,22 @@ +defmodule Pleroma.HealthcheckTest do + use Pleroma.DataCase + alias Pleroma.Healthcheck + + test "system_info/0" do + result = Healthcheck.system_info() |> Map.from_struct() + + assert Map.keys(result) == [:active, :healthy, :idle, :memory_used, :pool_size] + end + + describe "check_health/1" do + test "pool size equals active connections" do + result = Healthcheck.check_health(%Healthcheck{pool_size: 10, active: 10}) + refute result.healthy + end + + test "chech_health/1" do + result = Healthcheck.check_health(%Healthcheck{pool_size: 10, active: 9}) + assert result.healthy + end + end +end |