Skip to content

Commit

Permalink
Merge branch 'master' into propertieslayout
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Oct 26, 2017
2 parents 3a547dc + 1ae0857 commit d097de4
Show file tree
Hide file tree
Showing 2,915 changed files with 519,289 additions and 37,479 deletions.
4 changes: 2 additions & 2 deletions .ci/travis/code_layout/script.sh
Expand Up @@ -16,9 +16,9 @@ set -e

pushd build

export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}
export CTEST_BUILD_COMMAND="/usr/bin/make -j3 -i -k"
python3 ${TRAVIS_BUILD_DIR}/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V --output-on-failure -S ${TRAVIS_BUILD_DIR}/.ci/travis/travis.ctest

ctest -V -R PyQgsDocCoverage
python3 ${TRAVIS_BUILD_DIR}/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V --output-on-failure -S ${TRAVIS_BUILD_DIR}/.ci/travis/travis.ctest

popd
4 changes: 0 additions & 4 deletions .ci/travis/linux/after_script.sh
Expand Up @@ -12,7 +12,3 @@
# (at your option) any later version. #
# #
###########################################################################

ccache -s

[ -r /tmp/ctest-important.log ] && cat /tmp/ctest-important.log
30 changes: 1 addition & 29 deletions .ci/travis/linux/before_install.sh
Expand Up @@ -13,33 +13,5 @@
# #
###########################################################################

##################################################
#
# Get precompiled dependencies
#
##################################################

pushd ${HOME}

# fetching data from github should be just as fast as S3
curl -s -S -L https://github.com/opengisch/osgeo4travis/archive/qt55bin.tar.gz | tar --strip-components=1 -xz -C /home/travis &
SETUP_OSGEO4W_PID=$!

mkdir /home/travis/osgeo4travis

# other dependencies live in a cached folder
pushd depcache
# Download newer version of cmake than in the repository
[[ -f cmake-3.5.0-Linux-x86_64.tar.gz ]] || curl -s -S -O https://cmake.org/files/v3.5/cmake-3.5.0-Linux-x86_64.tar.gz
tar --strip-components=1 -zx -f cmake-3.5.0-Linux-x86_64.tar.gz -C /home/travis/osgeo4travis

# Download OTB package for Processing tests
[[ -f OTB-5.6.0-Linux64.run ]] || curl -s -S -O https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-5.6.0-Linux64.run
sh ./OTB-5.6.0-Linux64.run

wait $SETUP_OSGEO4W_PID

popd
popd

pip install psycopg2 numpy nose2 pyyaml mock future termcolor
#pip3 install termcolor
21 changes: 18 additions & 3 deletions .ci/travis/linux/before_script.sh
Expand Up @@ -13,7 +13,22 @@
# #
###########################################################################

printf "[qgis_test]\nhost=localhost\ndbname=qgis_test\nuser=postgres" > ~/.pg_service.conf
set -e

export PGUSER=postgres
$TRAVIS_BUILD_DIR/tests/testdata/provider/testdata_pg.sh
pushd .docker

docker --version
docker-compose --version
docker-compose -f $DOCKER_COMPOSE config
#docker pull ubuntu:16.04
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" .
# image should be pushed even if QGIS build fails
# but push is achieved only on branches (not for PRs)
if [[ $DOCKER_PUSH =~ true ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
#docker tag "qgis/qgis3-build-deps:${DOCKER_TAG}" "qgis/qgis3-build-deps:latest"
docker push "qgis/qgis3-build-deps:${DOCKER_TAG}"
fi

popd
90 changes: 90 additions & 0 deletions .ci/travis/linux/docker-build-test.sh
@@ -0,0 +1,90 @@
#!/usr/bin/env bash

set -e

##############
# Setup ccache
##############
export CCACHE_TEMPDIR=/tmp
ccache -M 500M
ccache -z

############################
# Setup the (c)test environment
############################
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
export CTEST_BUILD_COMMAND="/usr/bin/ninja"
export CTEST_PARALLEL_LEVEL=1

##############################
# Variables for output styling
##############################

bold=$(tput bold)
endbold=$(tput sgr0)

###########
# Configure
###########
pushd /root/QGIS > /dev/null
mkdir -p build

pushd build > /dev/null

echo "travis_fold:start:cmake"
echo "${bold}Running cmake...${endbold}"
cmake \
-GNinja \
-DWITH_STAGED_PLUGINS=ON \
-DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=ON \
-DWITH_QSPATIALITE=ON \
-DWITH_QWTPOLAR=OFF \
-DWITH_APIDOC=OFF \
-DWITH_ASTYLE=OFF \
-DWITH_DESKTOP=ON \
-DWITH_BINDINGS=ON \
-DDISABLE_DEPRECATED=ON \
-DCXX_EXTRA_FLAGS=${CLANG_WARNINGS} ..
echo "travis_fold:end:cmake"

#######
# Build
#######
echo "travis_fold:start:ninja-build.1"
echo "${bold}Building QGIS...${endbold}"
${CTEST_BUILD_COMMAND}
echo "travis_fold:end:ninja-build.1"

############################
# Restore postgres test data
############################
printf "[qgis_test]\nhost=postgres\nport=5432\ndbname=qgis_test\nuser=docker\npassword=docker" > ~/.pg_service.conf
export PGUSER=docker
export PGHOST=postgres
export PGPASSWORD=docker
export PGDATABASE=qgis_test

pushd /root/QGIS > /dev/null
/root/QGIS/tests/testdata/provider/testdata_pg.sh
popd > /dev/null # /root/QGIS

###########
# Run tests
###########
python3 /root/QGIS/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V -E "$(cat /root/QGIS/.ci/travis/linux/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" -S /root/QGIS/.ci/travis/travis.ctest --output-on-failure

########################
# Show ccache statistics
########################
echo "travis_fold:start:ccache.stats"
echo "ccache statistics"
ccache -s
echo "travis_fold:end:ccache.stats"

popd > /dev/null # build
popd > /dev/null # /root/QGIS

[ -r /tmp/ctest-important.log ] && cat /tmp/ctest-important.log || true
66 changes: 2 additions & 64 deletions .ci/travis/linux/install.sh
Expand Up @@ -13,67 +13,5 @@
# #
###########################################################################

mkdir build
cd build

ln -s ${HOME}/osgeo4travis/bin/ccache ${HOME}/osgeo4travis/bin/clang++-${LLVM_VERSION}
ln -s ${HOME}/osgeo4travis/bin/ccache ${HOME}/osgeo4travis/bin/clang-${LLVM_VERSION}

ccache -s
ccache -z

export CXX="clang++-${LLVM_VERSION}"
export CC="clang-${LLVM_VERSION}"
#export CXX="g++-6"
#export CC="gcc-6"
export PATH=${HOME}/osgeo4travis/bin:${PATH}
export PYTHONPATH=${HOME}/osgeo4travis/lib/python3.3/site-packages/

cmake --version
${CC} --version
${CXX} --version

# CLANG_WARNINGS="-Wimplicit-fallthrough"
CLANG_WARNINGS=""

# Include this line for debug reasons
# -DCMAKE_BUILD_TYPE=RelWithDebInfo \
#
CMAKE_FLAGS="
-DCMAKE_PREFIX_PATH=/home/travis/osgeo4travis
-DWITH_STAGED_PLUGINS=ON
-DWITH_GRASS=ON
-DWITH_GRASS7=ON
-DGRASS_PREFIX7=/home/travis/osgeo4travis/grass-7.0.4
-DSUPPRESS_QT_WARNINGS=ON
-DENABLE_MODELTEST=ON
-DENABLE_PGTEST=ON
-DWITH_QSPATIALITE=ON
-DWITH_QWTPOLAR=OFF
-DWITH_APIDOC=OFF
-DWITH_ASTYLE=OFF
-DDISABLE_DEPRECATED=ON
-DCXX_EXTRA_FLAGS=${CLANG_WARNINGS}
-DPYTHON_TEST_WRAPPER="timeout -sSIGSEGV 55s"
"

# The following options trigger a minimalized build to
# reduce the travis build time so we don't time out and
# have a chance of slowly filling the ccache.
if [ "$CACHE_WARMING" = true ] ; then
CMAKE_FLAGS="
${CMAKE_FLAGS}
-DWITH_DESKTOP=OFF
-DWITH_SERVER=OFF
-DWITH_CUSTOM_WIDGETS=OFF
"
else
CMAKE_FLAGS="
${CMAKE_FLAGS}
-DWITH_DESKTOP=ON
-DWITH_SERVER=ON
-DWITH_CUSTOM_WIDGETS=ON
"
fi

cmake $CMAKE_FLAGS ..
shopt -s expand_aliases
alias python=python3
29 changes: 3 additions & 26 deletions .ci/travis/linux/script.sh
Expand Up @@ -15,31 +15,8 @@

set -e

export PYTHONPATH=${HOME}/osgeo4travis/lib/python3.3/site-packages/
export PATH=${HOME}/osgeo4travis/bin:${HOME}/osgeo4travis/sbin:${HOME}/OTB-5.6.0-Linux64/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/osgeo4travis/lib
export CTEST_PARALLEL_LEVEL=1
export CCACHE_TEMPDIR=/tmp
ccache -M 500M
ccache -z
DIR=$(git rev-parse --show-toplevel)/.docker

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
mkdir -p $CCACHE_DIR

# Set OTB application path (installed in before_install.sh script)
export OTB_APPLICATION_PATH=${HOME}/OTB-5.6.0-Linux64/lib/otb/applications
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so

export CTEST_BUILD_COMMAND="/usr/bin/make -j3 -i"

# This works around an issue where travis would timeout because
# when make is run inside ctest no output is generated. At the current time
# nobody know why, but at least this workaround gets travis results
# back. Better approaches VERY welcome.
pushd build
echo "travis_fold:start:qgis_build"
$CTEST_BUILD_COMMAND
echo "travis_fold:end:qgis_build"
popd

python ${TRAVIS_BUILD_DIR}/.ci/travis/scripts/ctest2travis.py \
xvfb-run ctest -V -E "$(cat ${DIR}/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" -S ${DIR}/../travis.ctest --output-on-failure
docker-compose -f $DOCKER_COMPOSE run --rm qgis-deps
1 change: 1 addition & 0 deletions .ci/travis/macos/script.sh
Expand Up @@ -30,6 +30,7 @@ ccache -z
TIMEOUT=$(expr 40 \* 60 - `date +%s` + `cat /tmp/travis_timestamp`)

export CTEST_BUILD_COMMAND=/usr/local/bin/ninja
export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}

gtimeout ${TIMEOUT}s ctest -V -E "$(cat ${DIR}/blacklist.txt | gsed -r '/^(#.*?)?$/d' | gpaste -sd '|' -)" -S ${DIR}/../travis.ctest --output-on-failure

Expand Down
5 changes: 4 additions & 1 deletion .ci/travis/scripts/ctest2travis.py
Expand Up @@ -77,7 +77,7 @@ def start_test_fold():
updated_line = line.decode('utf-8')
if re.match('Run dashboard with model Experimental', updated_line):
start_fold('build')
updated_line = 'Compiling\n{}'.format(updated_line)
updated_line = '{title}\n{line}'.format(title=colored('Running tests...', 'yellow', attrs=['bold']), line=updated_line)

elif re.match('Test project /home/travis/build/qgis/QGIS/build', updated_line):
end_fold() # tag=build
Expand Down Expand Up @@ -111,6 +111,9 @@ def start_test_fold():
if not in_failing_test and re.search('[0-9]+% tests passed, [0-9]+ tests failed out of', updated_line):
end_fold()

if re.search('100% tests passed', updated_line):
updated_line = colored(updated_line, 'green')

if re.match('Submit files', updated_line):
start_fold('submit')
elif re.search('Test results submitted to', updated_line):
Expand Down
4 changes: 2 additions & 2 deletions .ci/travis/travis.ctest
@@ -1,5 +1,5 @@
SET (CTEST_SOURCE_DIRECTORY $ENV{TRAVIS_BUILD_DIR})
SET (CTEST_BINARY_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}/build")
SET (CTEST_SOURCE_DIRECTORY $ENV{CTEST_BUILD_DIR})
SET (CTEST_BINARY_DIRECTORY $ENV{CTEST_BUILD_DIR}/build)
#SET (CTEST_SOURCE_DIRECTORY /usr/src/QGIS)
#SET (CTEST_BINARY_DIRECTORY /usr/src/qgis-build)

Expand Down

0 comments on commit d097de4

Please sign in to comment.