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

Dialyzer on travis #677

Merged
merged 4 commits into from
Feb 26, 2016
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ ebin/
#idea
.idea/
*.iml
dialyzer/
site/
etc/
log/
Mnesia.*
tags
24 changes: 20 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
language: erlang
sudo: required
addons:
apt:
packages:
- libpam0g-dev
- libexpat1-dev
- odbc-postgresql
- libmyodbc
- slapd
- ldap-utils
before_install:
- sudo apt-get update
- sudo apt-get install libpam0g-dev libexpat1-dev odbc-postgresql libmyodbc
- if [ $PRESET = 'ldap_mnesia' ]; then sudo apt-get install slapd ldap-utils; fi
- tools/travis-generate-pass.sh
install:
- tools/travis-build.sh
Expand Down Expand Up @@ -42,6 +49,7 @@ env:
- PRESET=ldap_mnesia DB=mnesia REL_CONFIG=minimal
- PRESET=riak_mnesia DB=riak REL_CONFIG=with-riak
- PRESET=external_mnesia DB=mnesia REL_CONFIG=minimal
- PRESET=dialyzer_only

matrix:
include:
Expand All @@ -56,4 +64,12 @@ after_failure:
notifications:
webhooks:
# trigger Buildtime Trend Service to parse Travis CI log
- https://buildtimetrend.herokuapp.com/travis
- https://buildtimetrend.herokuapp.com/travis

cache:
directories:
- dialyzer

before_cache:
- rm -f dialyzer/apps.*

93 changes: 50 additions & 43 deletions tools/travis-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,65 @@ source tools/travis-common-vars.sh

echo ${BASE}

SUMMARIES_DIRS=${BASE}'/test/ejabberd_tests/ct_report/ct_run*'
if [ $PRESET = "dialyzer_only" ]; then
make dialyzer

echo "############################"
echo "Running embeded common tests"
echo "############################"
else

make ct
EMBEDED_CT_STATUS=$?
SUMMARIES_DIRS=${BASE}'/test/ejabberd_tests/ct_report/ct_run*'

echo "############################"
echo "Running ejabberd_tests"
echo "############################"
echo "############################"
echo "Running embeded common tests"
echo "############################"

echo -n "starting MongooseIM node 1: "
${EJD1CTL} start && echo ok || echo failed
echo -n "starting MongooseIM node 2: "
${EJD2CTL} start && echo ok || echo failed
sleep 1
echo -n "pinging MongooseIM node 1: "
${EJD1CTL} ping
echo -n "pinging MongooseIM node 2: "
${EJD2CTL} ping
make ct
EMBEDED_CT_STATUS=$?

make cover_test_preset TESTSPEC=default.spec PRESET=$PRESET
echo "############################"
echo "Running ejabberd_tests"
echo "############################"

RAN_TESTS=`cat /tmp/ct_count`
echo -n "starting MongooseIM node 1: "
${EJD1CTL} start && echo ok || echo failed
echo -n "starting MongooseIM node 2: "
${EJD2CTL} start && echo ok || echo failed
sleep 1
echo -n "pinging MongooseIM node 1: "
${EJD1CTL} ping
echo -n "pinging MongooseIM node 2: "
${EJD2CTL} ping

echo -n "stopping MongooseIM node 1: "
${EJD1CTL} stop
echo -n "stopping MongooseIM node 2: "
${EJD2CTL} stop
make cover_test_preset TESTSPEC=default.spec PRESET=$PRESET

if [ `uname` = "Darwin" ]; then
SUMMARIES_DIR=`ls -dt ${SUMMARIES_DIRS} | head -n ${RAN_TESTS}`
else
SUMMARIES_DIR=`eval ls -d ${SUMMARIES_DIRS} --sort time | head -n ${RAN_TESTS}`
fi
RAN_TESTS=`cat /tmp/ct_count`

${TOOLS}/summarise-ct-results ${SUMMARIES_DIR}
CT_STATUS=$?
echo -n "stopping MongooseIM node 1: "
${EJD1CTL} stop
echo -n "stopping MongooseIM node 2: "
${EJD2CTL} stop

echo
echo "All tests done."
TEST_STATUSES="${EMBEDED_CT_STATUS}${CT_STATUS}"
if [ `uname` = "Darwin" ]; then
SUMMARIES_DIR=`ls -dt ${SUMMARIES_DIRS} | head -n ${RAN_TESTS}`
else
SUMMARIES_DIR=`eval ls -d ${SUMMARIES_DIRS} --sort time | head -n ${RAN_TESTS}`
fi

if [ ${TEST_STATUSES} = "00" ]
then
RESULT=0
echo "Build succeeded"
else
RESULT=1
echo "Build failed - ${TEST_STATUSES}"
fi
${TOOLS}/summarise-ct-results ${SUMMARIES_DIR}
CT_STATUS=$?

exit ${RESULT}
echo
echo "All tests done."
TEST_STATUSES="${EMBEDED_CT_STATUS}${CT_STATUS}"

if [ ${TEST_STATUSES} = "00" ]
then
RESULT=0
echo "Build succeeded"
else
RESULT=1
echo "Build failed - ${TEST_STATUSES}"
fi

exit ${RESULT}

fi