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 integration tests in circleci #299

Merged
merged 12 commits into from
Jan 30, 2018
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,44 @@ jobs:
- run: coveralls-lcov -v --repo-token $COVERALLS_TOKEN coverage.info || true
- run: $HOME/valgrind/bin/valgrind build_with_boringssl/tests/soter_test 2>&1 | grep "ERROR SUMMARY\|definitely lost\|indirectly lost\|possibly lost" | awk '{sum += $4} END {print $0; if ( sum > 0 ) { exit 1 } }'
- run: $HOME/valgrind/bin/valgrind build_with_boringssl/tests/themis_test 2>&1 | grep "ERROR SUMMARY\|definitely lost\|indirectly lost\|possibly lost" | awk '{sum += $4} END {print $0; if ( sum > 0 ) { exit 1 } }'

integration_tests:
docker:
- image: cossacklabs/android-build
environment:
GOTHEMIS_IMPORT: github.com/cossacklabs/themis/gothemis
CFLAGS: "-DCIRICLE_TEST"
steps:
# dependencies
- run: sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get -y install libssl-dev python python-setuptools python3 python3-setuptools ruby-dev lcov libc6-dbg rsync software-properties-common
- run: sudo ln -sf /usr/bin/nodejs /usr/bin/node
# ruby rvm repository
- run: sudo apt-add-repository -y ppa:rael-gc/rvm
- run: sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get -y install rvm
# nodejs install (need to install fresh nodejs)
- run: cd $HOME && curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh && sudo bash nodesource_setup.sh && sudo apt-get -y install nodejs
# php7
- run: sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get -y install php7.0-dev php7.0-xml php7.0-mbstring

# themis
- checkout
- run: make
- run: make JAVA_HOME=/usr/lib/jvm/default-java themis_jni
- run: sudo make install
- run: sudo make themispp_install
- run: sudo make pythemis_install
- run: sudo make rubythemis_install
- run: sudo make phpthemis_install
- run: sudo bash -c 'echo "extension=phpthemis.so" > /etc/php/7.0/cli/conf.d/20-phpthemis.ini'
- run: npm install jsthemis
- run: mkdir -p $HOME/go/src/$GOTHEMIS_IMPORT
- run: rsync -auv gothemis/ $HOME/go/src/$GOTHEMIS_IMPORT/

- run: sudo /sbin/ldconfig
- run: chmod u+x ./tests/_integration/integration_total.sh
- run: ./tests/_integration/integration_total.sh


# using this php5 image until we ensure tests are working for php7
php5:
docker:
Expand All @@ -115,3 +153,4 @@ workflows:
- android
- x86_64
- php5
- integration_tests
Empty file modified tests/_integration/integration_total.sh
100644 → 100755
Empty file.
12 changes: 5 additions & 7 deletions tests/_integration/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ export TOP_PID=$$
trap "exit 1" TERM
export status=0

function fail {
fail () {
printf "\033[1m\033[31m ${2} fail \x1b[0m\n"
}
export -f fail
function success {

success () {
printf "\033[1m\033[32m ${2} success \x1b[0m\n"
}
export -f success

function check_result_zero (){
check_result_zero (){
result=$?
if [ ${result} != "0" ]
then
Expand All @@ -22,5 +21,4 @@ function check_result_zero (){
else
success
fi
}
export -f check_result_zero
}