Skip to content

Commit

Permalink
Use rebar3 in Travis tests
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Apr 16, 2021
1 parent e462f0a commit 49c757f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
21 changes: 11 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,32 @@ before_script:

cache:
directories:
- deps/
- ~/.cache/rebar3/

script:
- ./autogen.sh
- ./configure --prefix=/tmp/ejabberd --enable-all --disable-odbc --disable-elixir
- ./configure --prefix=/tmp/ejabberd --enable-all --disable-odbc --disable-elixir --with-rebar=`which rebar3`
- make update
- make
- make install -s
- make xref
- ./tools/hook_deps.sh ebin
- make hooks
- sed -i -e 's/ct:pal/ct:log/' test/suite.erl
- ln -sf ../sql priv/
- echo "" >> rebar.config
- echo '{ct_extra_params, "-verbosity 20"}.' >> rebar.config
- escript ./rebar skip_deps=true ct -v
- grep -q 'TEST COMPLETE,.* 0 failed' logs/raw.log
- test $(find logs -empty -name error.log)
- rebar3 ct -v
- ln -s _build/test/logs/ logs
- grep -q 'TEST COMPLETE,.* 0 failed' `find logs/ -name suite.log`
- test $(find logs/ -empty -name error.log)

after_script:
- find logs -name suite.log -exec cat '{}' ';'
- find logs/ -name suite.log -exec cat '{}' ';'

after_failure:
- find logs -name exunit.log -exec cat '{}' ';'
- find logs -name ejabberd.log -exec cat '{}' ';'
- find logs -name suite.log -exec cat '{}' ';' | awk 'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
- find logs/ -name exunit.log -exec cat '{}' ';'
- find logs/ -name ejabberd.log -exec cat '{}' ';'
- find logs/ -name suite.log -exec cat '{}' ';' | awk 'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'

after_success:
- coveralls-merge erlang.json
Expand Down
9 changes: 5 additions & 4 deletions rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,13 @@ end,

TravisPostHooks =
fun(true) ->
[{ct, "echo '\n%%! -pa ebin/ deps/coveralls/ebin\n" ++
[{ct, "echo '\n%%! -pa _build/test/lib/ejabberd/ebin/ " ++
"_build/test/lib/coveralls/ebin _build/test/lib/jsx/ebin\n" ++
"main(_)->{ok,F}=file:open(\"erlang.json\",[write])," ++
"io:fwrite(F,\"~s\",[coveralls:convert_file(" ++
"\"logs/all.coverdata\", \"" ++
"\"_build/test/cover/ct.coverdata\", #{service_job_id => \"" ++
os:getenv("TRAVIS_JOB_ID") ++
"\", \"travis-ci\",\"\")]).' > getcover.erl"},
"\", service_name => \"travis-ci\"})]).' > getcover.erl"},
{ct, "escript ./getcover.erl"}];
(_) ->
[]
Expand All @@ -359,7 +360,7 @@ Rules = [
{clean, {asn, clean}}
]}]), []},
{[deps], os:getenv("TRAVIS") == "true",
AppendList([{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl", {tag, "v2.0.1"}}}]), []},
AppendList([{coveralls, "2.2.0"}, {jsx, "2.10.0"}]), []},
{[post_hooks], [cover_enabled], os:getenv("TRAVIS") == "true",
AppendList2(TravisPostHooks), [], false},
{[overrides], [post_hook_configure], SystemDeps == false,
Expand Down

0 comments on commit 49c757f

Please sign in to comment.