From fbb264f697106383528f8e134239623a14c95cc1 Mon Sep 17 00:00:00 2001 From: Mateusz Korszun Date: Wed, 19 Sep 2018 12:46:47 +0200 Subject: [PATCH] Downgrade ex_doc and verify doc generation in CI (#43) * Downgrade ex_doc and verify doc generation in CI * Add total download badge * Improve test consumer cleanup --- .travis.yml | 3 +++ README.md | 1 + mix.exs | 2 +- mix.lock | 4 ++-- test/gen_rmq_consumer_test.exs | 8 ++++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8595888..15a7061 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,6 @@ before_script: script: - make test_ci + +after_script: + - make doc diff --git a/README.md b/README.md index 4330f78..d47a74f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Build Status](https://travis-ci.org/meltwater/gen_rmq.svg?branch=master)](https://travis-ci.org/meltwater/gen_rmq) [![Hex Version](http://img.shields.io/hexpm/v/gen_rmq.svg)](https://hex.pm/packages/gen_rmq) [![Coverage Status](https://coveralls.io/repos/github/meltwater/gen_rmq/badge.svg?branch=master)](https://coveralls.io/github/meltwater/gen_rmq?branch=master) +[![Hex.pm Download Total](https://img.shields.io/hexpm/dt/gen_rmq.svg?style=flat-square)](https://hex.pm/packages/gen_rmq) # GenRMQ diff --git a/mix.exs b/mix.exs index 6f97821..1a2bd3c 100644 --- a/mix.exs +++ b/mix.exs @@ -42,7 +42,7 @@ defmodule GenRMQ.Mixfile do {:excoveralls, "~> 0.10.0", only: :test}, {:poison, "~> 3.1", only: [:dev, :test]}, {:earmark, "~> 1.2", only: :dev}, - {:ex_doc, "~> 0.18", only: :dev} + {:ex_doc, "~> 0.18.0", only: :dev} ] end diff --git a/mix.lock b/mix.lock index 455072c..1a95c99 100644 --- a/mix.lock +++ b/mix.lock @@ -4,8 +4,8 @@ "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, "certifi": {:hex, :certifi, "2.4.2", "75424ff0f3baaccfd34b1214184b6ef616d89e420b258bb0a5ea7d7bc628f7f0", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, "credo": {:hex, :credo, "0.10.1", "e85efaf2dd7054399083ab2c6a5199f6cb1805de1a5b00d9e8c5f07033407b1f", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, - "earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm"}, - "ex_doc": {:hex, :ex_doc, "0.19.0", "e22b6434373b4870ea77b24df069dbac7002c1f483615e9ebfc0c37497e1c75c", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.7", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, + "earmark": {:hex, :earmark, "1.2.6", "b6da42b3831458d3ecc57314dff3051b080b9b2be88c2e5aa41cd642a5b044ed", [:mix], [], "hexpm"}, + "ex_doc": {:hex, :ex_doc, "0.18.4", "4406b8891cecf1352f49975c6d554e62e4341ceb41b9338949077b0d4a97b949", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"}, "excoveralls": {:hex, :excoveralls, "0.10.0", "a4508bdd408829f38e7b2519f234b7fd5c83846099cda348efcb5291b081200c", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, "goldrush": {:hex, :goldrush, "0.1.9", "f06e5d5f1277da5c413e84d5a2924174182fb108dabb39d5ec548b27424cd106", [:rebar3], [], "hexpm"}, "hackney": {:hex, :hackney, "1.14.0", "66e29e78feba52176c3a4213d42b29bdc4baff93a18cfe480f73b04677139dee", [:rebar3], [{:certifi, "2.4.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, diff --git a/test/gen_rmq_consumer_test.exs b/test/gen_rmq_consumer_test.exs index aeeef5e..2dfd4b9 100644 --- a/test/gen_rmq_consumer_test.exs +++ b/test/gen_rmq_consumer_test.exs @@ -22,11 +22,13 @@ defmodule GenRMQ.ConsumerTest do test "should start a new consumer" do {:ok, pid} = Consumer.start_link(Default) assert Process.alive?(pid) + assert Consumer.stop(pid, :normal) == :ok end test "should start a new consumer registered by name" do {:ok, pid} = Consumer.start_link(Default, name: Default) assert pid == Process.whereis(Default) + assert Consumer.stop(pid, :normal) == :ok end end @@ -213,6 +215,12 @@ defmodule GenRMQ.ConsumerTest do |> :erlang.apply(:init, []) |> Keyword.get(:exchange) + on_exit(fn -> + if Process.alive?(consumer_pid) do + Consumer.stop(consumer_pid, :normal) + end + end) + {:ok, %{consumer: consumer_pid, exchange: exchange}} end end