Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codecov integration #1749

Merged
merged 3 commits into from
Mar 2, 2018
Merged

Add codecov integration #1749

merged 3 commits into from
Mar 2, 2018

Conversation

arcusfelis
Copy link
Contributor

@arcusfelis arcusfelis commented Mar 2, 2018

Example: https://codecov.io/gh/esl/MongooseIM/tree/651a44752aa95cb390c4e277a3119c9463905292/src

Import coverdata into codecov.json.

Use module_info to find source files location.

It increases travis job time by ~ 15 seconds.

  • pip install - 5 seconds
  • codecov - 5 seconds
  • codecov.json generation - 2 seconds

Admin stuff

The PR can be merged without "admin stuff" tasks.
Apparently, the only thing is missing without granting access is a check in "All checks have passed" from codecov.

To enable codecov bot, add esl/MongooseIM to https://codecov.io/ (10 minutes for someone who have admin access for esl github account).

Import coverdata into codecov.json

Use module_info to find source files location
@codecov-io
Copy link

codecov-io commented Mar 2, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@20f3323). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1749   +/-   ##
=========================================
  Coverage          ?   74.62%           
=========================================
  Files             ?      283           
  Lines             ?    26564           
  Branches          ?        0           
=========================================
  Hits              ?    19823           
  Misses            ?     6741           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20f3323...61db269. Read the comment docs.

try
AbsPath = proplists:get_value(source, Module:module_info(compile)),
string:prefix(AbsPath, get_repo_dir())
of nomatch ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious formatting here. :)

get_source_path(Module) when is_atom(Module) ->
try
AbsPath = proplists:get_value(source, Module:module_info(compile)),
string:prefix(AbsPath, get_repo_dir())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this function was introduced in Erlang 20, so paths would be messed up in other builds.

string_suffix(String, Suffix) ->
StringR = lists:reverse(String),
SuffixR = lists:reverse(Suffix),
lists:reverse(string:prefix(StringR, SuffixR)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string:prefix/2 again

@arcusfelis arcusfelis merged commit 472f1a7 into master Mar 2, 2018
@arcusfelis arcusfelis deleted the codecov-json branch March 2, 2018 17:35
@fenek fenek added this to the 3.0.0 milestone Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants