Skip to content

Commit

Permalink
Merge pull request #8565 from elpaso/docker-testing-env-fixes
Browse files Browse the repository at this point in the history
Docker testing env minor fixes and improvements
  • Loading branch information
elpaso committed Nov 29, 2018
2 parents f10b62c + 52eeaba commit 88d962f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
27 changes: 12 additions & 15 deletions .docker/qgis_resources/test_runner/qgis_setup.sh
Expand Up @@ -8,7 +8,7 @@
# - create the folders
# - install startup.py monkey patches
# - disable tips
# - enable the plugin
# - enable the plugin (optionally)

PLUGIN_NAME=$1
CONF_MASTER_FOLDER="/root/.local/share/QGIS/QGIS3/profiles/default/QGIS/"
Expand Down Expand Up @@ -42,20 +42,17 @@ if [ -n "$PLUGIN_NAME" ]; then
# Enable plugin
printf '[PythonPlugins]\n' >> $CONF_MASTER_FILE
printf "%s=true\n\n" "$PLUGIN_NAME" >> $CONF_MASTER_FILE
# Install the plugin
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
fi

# Disable firstRunVersionFlag for master
{
printf
"\n[migration]\n"
"fileVersion=2\n"
"firstRunVersionFlag=30500\n"
"settings=true\n\n"
} >> $CONF_MASTER_FILE


# Install the plugin
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
echo "
[migration]
fileVersion=2
firstRunVersionFlag=30500
settings=true
" >> $CONF_MASTER_FILE
6 changes: 3 additions & 3 deletions .docker/qgis_resources/test_runner/qgis_testrunner.py
Expand Up @@ -70,7 +70,7 @@ def __get_test_function(test_module_name):
test_module = importlib.import_module(test_module_name)
function_name = 'run_all'
except ImportError as e:
traceback.print_exc(file=sys.stdout)
#traceback.print_exc(file=sys.stdout)
# Strip latest name
pos = test_module_name.rfind('.')
if pos <= 0:
Expand All @@ -81,7 +81,7 @@ def __get_test_function(test_module_name):
try:
test_module = importlib.import_module(test_module_name)
except ImportError as e:
traceback.print_exc(file=sys.stdout)
#traceback.print_exc(file=sys.stdout)
raise e
return getattr(test_module, function_name, None)

Expand Down Expand Up @@ -132,7 +132,7 @@ def __get_test_function(test_module_name):
else: # We are inside QGIS!
# Start as soon as the initializationCompleted signal is fired
from qgis.core import QgsApplication, QgsProjectBadLayerHandler, QgsProject
from PyQt.QtCore import QDir
from qgis.PyQt.QtCore import QDir
from qgis.utils import iface

class QgsProjectBadLayerDefaultHandler(QgsProjectBadLayerHandler):
Expand Down

0 comments on commit 88d962f

Please sign in to comment.