Skip to content

Commit

Permalink
v1.1.3 : Travis functional testing & minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan LE GLAUNEC committed Nov 23, 2016
1 parent e9ffb44 commit d98d78c
Show file tree
Hide file tree
Showing 22 changed files with 188 additions and 173 deletions.
34 changes: 25 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ sudo: required
dist: trusty

before_install:
- echo "Testing Docker Hub credentials"
- docker login -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD
- echo "Docker Hub credentials are working"
- sudo apt-get update -qq
- sudo apt-get install -y software-properties-common
- sudo add-apt-repository -y ppa:mc3man/trusty-media
Expand All @@ -19,24 +22,37 @@ before_install:
- sudo apt-get install -y libmysqlclient18
- sudo apt-get install -y mysql-client

install:
- export DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- export PACKAGE_NAME="cameradar_*_Debug_Linux"

matrix:
include:
- os: linux
env: COMPILER_NAME=gcc CXX=g++-5 CC=gcc-5 CMAKE_CXX_COMPILER=g++-5
env: TEST_TYPE='BUILD' WORKDIR='deployment' COMPILER_NAME=gcc CXX=g++-5 CC=gcc-5 CMAKE_CXX_COMPILER=g++-5
addons:
apt:
packages:
- g++-5
sources: &sources
- ubuntu-toolchain-r-test
- os: linux
env: TEST_TYPE='TEST' WORKDIR='test' COMPILER_NAME=gcc CXX=g++-5 CC=gcc-5 CMAKE_CXX_COMPILER=g++-5
addons:
apt:
packages:
- g++-5
sources: &sources
- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test

script:
- cd deployment
- cd ${WORKDIR}
- ./build_last_package.sh Debug
- tar xvf cameradar_*_Debug_Linux.tar.gz
- cp /home/travis/build/EtixLabs/cameradar/deps/jsoncpp/src/deps.jsoncpp/src/lib_json/libjsoncpp*.so* cameradar_*_Debug_Linux/libraries/
- cp /home/travis/build/EtixLabs/cameradar/deps/mysql-connector/lib/libmysqlcppconn.so* cameradar_*_Debug_Linux/libraries/
- tar -czvf cameradar_*_Debug_Linux.tar.gz cameradar_*_Debug_Linux
- docker build -t cameradar .
- docker run -v /tmp/thumbs:/tmp/thumbs cameradar
- tar xvf ${PACKAGE_NAME}.tar.gz
- find ${DEPS_DIR} -name "*.so*" -exec cp {} ${PACKAGE_NAME}/libraries \;
- tar -czvf ${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME}
- if [[ "$TEST_TYPE" == "BUILD" ]]; then docker build -t cameradar . && docker run -v /tmp/thumbs:/tmp/thumbs cameradar; else ./test.sh ; fi

after_success:
- echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then echo -e "Push Container to Docker Hub" && docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD && docker tag cameradar $DOCKER_REPO:latest && docker push $DOCKER_REPO; fi
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

This file lists all versions of the repository and precises all changes.

## v1.1.3

#### Minor changes :
* Added automatic pushes to DockerHub to the travis integration
* Made travis configuration file better
* Changed the package generation scripts to make them report errors
* Removed old etix_rtsp_server binary from the test folder

#### Bugfixes :
* Fixed an issue that made it mandatory to launch tests at least once so that they can work the second time
* Fixed an issue that made the golang testing tool not compile in the testing script
* Fixed an issue that made the golang testing tool sometimes ignore some tests
* The previous known issue has been investigated and we don't know where it came from. However after a night of testing I have been unable to reproduce it, so I will consider it closed

## v1.1.2

#### Minor changes :
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project (${PROJECT_NAME})

set (${PROJECT_NAME}_VERSION_MAJOR 1)
set (${PROJECT_NAME}_VERSION_MINOR 1)
set (${PROJECT_NAME}_VERSION_PATCH 2)
set (${PROJECT_NAME}_VERSION_PATCH 3)
set (${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}${${PROJECT_NAME}_SUFFIX}")

find_package(Git REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![cameradar License](https://img.shields.io/badge/license-Apache-blue.svg?style=flat-square)](#license)
[![Docker Pulls](https://img.shields.io/docker/pulls/ullaakut/cameradar.svg?style=flat-square)](https://hub.docker.com/r/ullaakut/cameradar/)
[![Build](https://img.shields.io/travis/EtixLabs/cameradar/master.svg?style=flat-square)](https://travis-ci.org/EtixLabs/cameradar)
[![Latest release](https://img.shields.io/badge/release-1.1.2-green.svg?style=flat-square)](https://github.com/EtixLabs/cameradar/releases/latest)
[![Latest release](https://img.shields.io/badge/release-1.1.3-green.svg?style=flat-square)](https://github.com/EtixLabs/cameradar/releases/latest)


#### Cameradar allows you to:
Expand Down
1 change: 1 addition & 0 deletions cameradar_standalone/src/describe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ size_t
write_data(void* buffer, size_t size, size_t nmemb, void* userp) {
// I'm sorry for this
// Forget you ever saw it
(void)userp;
if (not buffer || not size || not nmemb) return 0;

return size * nmemb;
Expand Down
52 changes: 41 additions & 11 deletions deployment/build_last_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,51 @@ COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m"

echo -e $COL_YELLOW"Deleting old package ... "$COL_RESET
rm -f cameradar_*_${1:-"Release"}_Linux.tar.gz
echo -e $COL_GREEN"OK!"$COL_RESET

echo -e $COL_YELLOW"Creating package ... "$COL_RESET
cd ..
mkdir build
cd build
rm -f cameradar_*_${1:-"Release"}_Linux.tar.gz
cmake .. -DCMAKE_BUILD_TYPE=${1:-"Release"}
make package
cp cameradar_*_${1:-"Release"}_Linux.tar.gz ../deployment
cd ../deployment

cd ..
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

mkdir build

cd build
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

rm -f cameradar_*_${1:-"Release"}_Linux.tar.gz

cmake .. -DCMAKE_BUILD_TYPE=${1:-"Release"}
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

make package
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

cp cameradar_*_${1:-"Release"}_Linux.tar.gz ../deployment

cd ../deployment
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi
echo -e $COL_GREEN"OK!"$COL_RESET
Binary file removed deployment/cameradar_1.1.2_Release_Linux.tar.gz
Binary file not shown.
Binary file added deployment/cameradar_1.1.3_Release_Linux.tar.gz
Binary file not shown.
56 changes: 42 additions & 14 deletions test/build_last_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,51 @@ COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m"

echo -e $COL_YELLOW"Deleting old package ... "$COL_RESET
rm -f cameradar_*_Debug_Linux.tar.gz
rm -f cameradar_*_${1:-"Release"}_Linux.tar.gz
echo -e $COL_GREEN"OK!"$COL_RESET

echo -e $COL_YELLOW"Creating package ... "$COL_RESET
{
cd ..
mkdir build
cd build
rm -f cameradar_*_Debug_Linux.tar.gz
cmake .. -DCMAKE_BUILD_TYPE=Debug
make package
cp cameradar_*_Debug_Linux.tar.gz ../test
cd ../test
} &> /dev/null

cd ..
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

mkdir build

cd build
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

rm -f cameradar_*_${1:-"Release"}_Linux.tar.gz

cmake .. -DCMAKE_BUILD_TYPE=${1:-"Release"}
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

make package
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi

cp cameradar_*_${1:-"Release"}_Linux.tar.gz ../test

cd ../test
ret=$?
if [ "$ret" -ne "0" ]; then
echo -e $COL_RED"KO!"$COL_RESET;
exit 1;
fi
echo -e $COL_GREEN"OK!"$COL_RESET
Binary file modified test/camera_emulation_server
Binary file not shown.
6 changes: 6 additions & 0 deletions test/docker/run_cameradartest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ cp /tmp/tests/*.xml ./
# run test
./cameradartest /tmp/tests/cameradartest.conf.json

ret=$?

echo "Tests exited with code ${ret}"

cat *.xml

cp *.xml /tmp/tests/

exit $ret
7 changes: 6 additions & 1 deletion test/docker/run_ces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ else
url="rtsp://$user:$passw@:$port/$route"
fi

./camera_emulation_server -u $2 -p $3 -r $4
if [ "$2" == "" && "$3" == "" ]; then
./camera_emulation_server -r $4
else
./camera_emulation_server -u $2 -p $3 -r $4
fi

echo "Stream started on ${url}"
Binary file removed test/etix_rtsp_server
Binary file not shown.
2 changes: 1 addition & 1 deletion test/src/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (t *Tester) dropDB() bool {
if err != nil {
fmt.Println(err)
}
fmt.Println("------ Dropped CCTV Database -------")
fmt.Println("------ Dropped Cameradar Database -------")
return true
}

Expand Down
24 changes: 0 additions & 24 deletions test/src/dropDB.go

This file was deleted.

24 changes: 0 additions & 24 deletions test/src/getResult.go

This file was deleted.

4 changes: 3 additions & 1 deletion test/src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package main

import (
"fmt"
"os"
)

func main() {
Expand All @@ -38,7 +39,8 @@ func main() {
fmt.Println("--- Writing results... ---")
if !Tester.WriteResults(*(Tester.Result), Tester.Output) {
fmt.Println("-> Write results FAILED")
return
os.Exit(1)
}
fmt.Println("--- Writing results done ---")
os.Exit(0)
}
55 changes: 0 additions & 55 deletions test/src/manager.go

This file was deleted.

Loading

0 comments on commit d98d78c

Please sign in to comment.