-
Notifications
You must be signed in to change notification settings - Fork 428
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
Add codecov integration #1749
Conversation
Import coverdata into codecov.json Use module_info to find source files location
Codecov Report
@@ 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.
|
try | ||
AbsPath = proplists:get_value(source, Module:module_info(compile)), | ||
string:prefix(AbsPath, get_repo_dir()) | ||
of nomatch -> |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string:prefix/2
again
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.
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).
first auth codecov using github oauth. It does not give codecov code access, but they can comment to PRs.
than enable codecov for a specific repo on codecov site. Probably somewhere https://codecov.io/gh/esl/MongooseIM
The bot makes comments like this: do not merge, disables some tests arcusfelis/MongooseIM#26 (comment)
Should be free for public repos.