-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added QGIS testing environment to dockers
Also: - renamed .docker to docker (now it's public and official) - added dependencies for python CI testing
- Loading branch information
Showing
10 changed files
with
371 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pep8 | ||
pexpect | ||
capturer | ||
sphinx | ||
requests | ||
future | ||
six |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
; Supervisor config file for Xvfb | ||
|
||
[program:Xvfb] | ||
command=/usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset -nolisten tcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; Supervisor config file. | ||
|
||
[supervisord] | ||
nodaemon=true | ||
logfile=/var/log/supervisor/supervisord.log | ||
logfile_maxbytes=50MB | ||
logfile_backups=10 | ||
loglevel=info | ||
pidfile=/var/run/supervisord.pid | ||
childlogdir=/var/log | ||
|
||
[include] | ||
files = /etc/supervisor/supervisor.d/*.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
# Setup QGIS for the automated tests | ||
# This is normally called from Travis or rundockertests.sh | ||
# before running the tests for a particular plugin | ||
# | ||
# Note: on QGIS3 assumes the default profile for root user | ||
# | ||
# - create the folders | ||
# - install startup.py monkey patches | ||
# - disable tips | ||
# - enable the plugin | ||
|
||
PLUGIN_NAME=$1 | ||
CONF_FOLDER="/root/.config/QGIS" | ||
CONF_FILE="${CONF_FOLDER}/QGIS2.conf" | ||
CONF_MASTER_FOLDER="/root/.local/share/QGIS/QGIS3/profiles/default/QGIS/" | ||
CONF_MASTER_FILE="${CONF_MASTER_FOLDER}/QGIS3.ini" | ||
QGIS_FOLDER="/root/.qgis2" | ||
|
||
QGIS_MASTER_FOLDER="/root/.local/share/QGIS/QGIS3/profiles/default" | ||
PLUGIN_FOLDER="${QGIS_FOLDER}/python/plugins" | ||
PLUGIN_MASTER_FOLDER="${QGIS_MASTER_FOLDER}/python/plugins" | ||
|
||
STARTUP_FOLDER="${QGIS_FOLDER}/python" | ||
STARTUP_MASTER_FOLDER="/root/.local/share/QGIS/QGIS3/" | ||
|
||
# Creates the config file | ||
mkdir -p $CONF_FOLDER | ||
if [ -e "$CONF_FILE" ]; then | ||
rm -f $CONF_FILE | ||
fi | ||
touch $CONF_FILE | ||
|
||
|
||
mkdir -p $CONF_MASTER_FOLDER | ||
if [ -e "$CONF_MASTER_FILE" ]; then | ||
rm -f $CONF_MASTER_FILE | ||
fi | ||
touch $CONF_MASTER_FILE | ||
|
||
# Creates plugin folder | ||
mkdir -p $PLUGIN_FOLDER | ||
mkdir -p $PLUGIN_MASTER_FOLDER | ||
mkdir -p $STARTUP_MASTER_FOLDER | ||
|
||
# Install the monkey patches to prevent modal stacktrace on python errors | ||
cp /usr/bin/qgis_startup.py ${STARTUP_FOLDER}/startup.py | ||
cp /usr/bin/qgis_startup.py ${STARTUP_MASTER_FOLDER}/startup.py | ||
|
||
# Disable tips | ||
printf "[Qgis]\n" >> $CONF_FILE | ||
# !!!! Note that on master it is lowercase !!!! | ||
printf "[qgis]\n" >> $CONF_MASTER_FILE | ||
SHOW_TIPS=`qgis --help 2>&1 | head -2 | grep 'QGIS - ' | perl -npe 'chomp; s/QGIS - (\d+)\.(\d+).*/showTips\1\2=false/'` | ||
printf "$SHOW_TIPS\n\n" >> $CONF_FILE | ||
printf "$SHOW_TIPS\n\n" >> $CONF_MASTER_FILE | ||
|
||
if [ -n "$PLUGIN_NAME" ]; then | ||
# Enable plugin | ||
printf '[PythonPlugins]\n' >> $CONF_FILE | ||
printf "${PLUGIN_NAME}=true\n\n" >> $CONF_FILE | ||
|
||
printf '[PythonPlugins]\n' >> $CONF_MASTER_FILE | ||
printf "${PLUGIN_NAME}=true\n\n" >> $CONF_MASTER_FILE | ||
fi | ||
|
||
# Disable firstRunVersionFlag for master | ||
printf "\n[migration]\n" >> $CONF_MASTER_FILE | ||
printf "fileVersion=2\n" >> $CONF_MASTER_FILE | ||
printf "firstRunVersionFlag=29900\n" >> $CONF_MASTER_FILE | ||
printf "settings=true\n\n" >> $CONF_MASTER_FILE | ||
|
||
|
||
# Install the plugin | ||
if [ ! -L "${PLUGIN_FOLDER}/${PLUGIN_NAME}" ]; then | ||
ln -s /tests_directory/${PLUGIN_NAME} ${PLUGIN_FOLDER} | ||
echo "Plugin folder linked in ${PLUGIN_FOLDER}/${PLUGIN_NAME}" | ||
fi | ||
if [ ! -d "${PLUGIN_MASTER_FOLDER}/${PLUGIN_NAME}" ]; then | ||
ln -s /tests_directory/${PLUGIN_NAME} ${PLUGIN_MASTER_FOLDER} | ||
echo "Plugin master folder linked in ${PLUGIN_MASTER_FOLDER}/${PLUGIN_NAME}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Disable QGIS modal error dialog. | ||
This script is meant to be run automatically when QGIS starts. | ||
Is should be renamed to `startup.py` and placed into ~/.qgis2/python/startup.py | ||
or ~/.qgis-dev/python/startup.py or ~/.qgis3/python/startup.py | ||
""" | ||
from qgis import utils | ||
import traceback | ||
|
||
|
||
def _showException(type, value, tb, msg, messagebar=False): | ||
print(msg) | ||
logmessage = '' | ||
for s in traceback.format_exception(type, value, tb): | ||
logmessage += s.decode('utf-8', 'replace') if hasattr(s, 'decode') else s | ||
print(logmessage) | ||
|
||
|
||
def _open_stack_dialog(type, value, tb, msg, pop_error=True): | ||
print(msg) | ||
|
||
|
||
utils.showException = _showException | ||
utils.open_stack_dialog = _open_stack_dialog |
Oops, something went wrong.