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

Reduce waiting time for cover on CI #1893

Merged
merged 1 commit into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ install:
before_script:
- tools/travis-setup-db.sh
- if [ $PRESET = 'ldap_mnesia' ]; then sudo tools/travis-setup-ldap.sh; fi
script: tools/travis-test.sh -p $PRESET
script: KEEP_COVER_RUNNING=1 tools/travis-test.sh -p $PRESET

after_failure:
- cat `ls -1 -d -t apps/ejabberd/logs/ct_run* | head -1`/apps.ejabberd.logs/run.*/suite.log
Expand Down
9 changes: 9 additions & 0 deletions big_tests/run_common_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,15 @@ analyze(Test, CoverOpts) ->
report_time("Export cover data from MongooseIM nodes", fun() ->
multicall(Nodes, mongoose_cover_helper, analyze, [], cover_timeout())
end),
case os:getenv("KEEP_COVER_RUNNING") of
"1" ->
io:format("Skip stopping cover~n"),
ok;
_ ->
report_time("Stopping cover on MongooseIM nodes", fun() ->
multicall(Nodes, mongoose_cover_helper, stop, [], cover_timeout())
end)
end,
Files = filelib:wildcard(repo_dir() ++ "/_build/**/cover/*.coverdata"),
io:format("Files: ~p", [Files]),
report_time("Import cover data into run_common_test node", fun() ->
Expand Down
5 changes: 4 additions & 1 deletion src/mongoose_cover_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


%% API
-export([start/1, analyze/0]).
-export([start/1, analyze/0, stop/0]).

-spec start([atom()]) -> list().
start(Apps) ->
Expand All @@ -27,6 +27,9 @@ start(Apps) ->
analyze() ->
file:make_dir("priv/cover"),
cover:export("priv/cover/" ++ atom_to_list(node()) ++ ".coverdata"),
ok.

stop() ->
cover:stop().

cover_compile_app(App) ->
Expand Down