From 9c8366564da02c60d3db3a63a2ccbf192ace6816 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Mon, 2 Oct 2017 12:46:08 -0400 Subject: [PATCH 1/2] Changes the behavior of mix coveralls.post so that it recognizes that coverage is being run against an umbrella app and only posts to coveralls.io once all sub-applications have been analysed --- lib/mix/tasks.ex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/mix/tasks.ex b/lib/mix/tasks.ex index 1979654b..1629ebf2 100644 --- a/lib/mix/tasks.ex +++ b/lib/mix/tasks.ex @@ -182,9 +182,12 @@ defmodule Mix.Tasks.Coveralls do @preferred_cli_env :test def run(args) do + switches = [filter: :string, umbrella: :boolean, verbose: :boolean, pro: :boolean, parallel: :boolean] + aliases = [f: :filter, u: :umbrella, v: :verbose] {options, params, _} = OptionParser.parse(args, - aliases: [n: :name, b: :branch, c: :committer, m: :message, s: :sha, t: :token]) + switches: switches, + aliases: aliases ++ [n: :name, b: :branch, c: :committer, m: :message, s: :sha, t: :token]) Mix.Tasks.Coveralls.do_run(params, [ type: "post", @@ -194,7 +197,10 @@ defmodule Mix.Tasks.Coveralls do branch: options[:branch] || "", committer: options[:committer] || "", sha: options[:sha] || "", - message: options[:message] || "[no commit message]" ]) + message: options[:message] || "[no commit message]", + umbrella: options[:umbrella], + verbose: options[:verbose] + ]) end def extract_service_name(options) do From 85ca2d914d470c5d15c6d39cd83155c0b22e0a28 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Mon, 2 Oct 2017 13:27:39 -0400 Subject: [PATCH 2/2] Fixing tests --- test/mix/tasks_test.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/mix/tasks_test.exs b/test/mix/tasks_test.exs index 30b125a1..09a3d463 100644 --- a/test/mix/tasks_test.exs +++ b/test/mix/tasks_test.exs @@ -134,7 +134,8 @@ defmodule Mix.Tasks.CoverallsTest do assert(ExCoveralls.ConfServer.get == [type: "post", endpoint: nil, token: "dummy_token", service_name: "dummy_service_name", branch: "branch", - committer: "committer", sha: "asdf", message: "message", args: []]) + committer: "committer", sha: "asdf", message: "message", + umbrella: nil, verbose: nil, args: []]) System.put_env("COVERALLS_REPO_TOKEN", org_token) System.put_env("COVERALLS_SERVICE_NAME", org_name) @@ -153,7 +154,8 @@ defmodule Mix.Tasks.CoverallsTest do assert(ExCoveralls.ConfServer.get == [type: "post", endpoint: nil, token: "token", service_name: "excoveralls", branch: "", - committer: "", sha: "", message: "[no commit message]", args: []]) + committer: "", sha: "", message: "[no commit message]", + umbrella: nil, verbose: nil, args: []]) if org_token != nil do System.put_env("COVERALLS_REPO_TOKEN", org_token)