From a431937b500f261403dff1c9ca5acdd0c8fa36d6 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Fri, 7 Apr 2017 15:14:56 +0100 Subject: [PATCH] Attempt to better catch errors in the CI tests. --- ci/build_docs.sh | 4 ++-- ci/build_pip_wheel.sh | 4 ++-- ci/build_runtime_qt4.sh | 4 ++-- ci/build_runtime_qt5.sh | 4 ++-- ci/build_tarballs.sh | 4 ++-- ci/create_config.sh | 14 +++++++------- ci/run_jasmine_tests.sh | 4 ++-- ci/run_python_tests.sh | 10 +++++----- ci/update_messages.sh | 2 +- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 1a61cea69..13b5cff35 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -12,6 +12,6 @@ if [ "$PYTHON_VERSION" = "2.6" -o "$PYTHON_VERSION" = "3.3" ]; then SPHINX_VER="==1.4.9" fi -$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER +$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER || { echo 'ERROR: Failed to install Sphinx to build the docs.' ; exit 1; } -make docs +make docs || { echo 'ERROR: Failed to build the documentation.' ; exit 1; } diff --git a/ci/build_pip_wheel.sh b/ci/build_pip_wheel.sh index f535e1553..871b33df3 100755 --- a/ci/build_pip_wheel.sh +++ b/ci/build_pip_wheel.sh @@ -12,6 +12,6 @@ if [ "$PYTHON_VERSION" = "2.6" -o "$PYTHON_VERSION" = "3.3" ]; then SPHINX_VER="==1.4.9" fi -$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER +$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER || { echo 'ERROR: Failed to install Sphinx to build the PIP wheel.' ; exit 1; } -make pip \ No newline at end of file +make pip || { echo 'ERROR: Failed to build the PIP wheel.' ; exit 1; } \ No newline at end of file diff --git a/ci/build_runtime_qt4.sh b/ci/build_runtime_qt4.sh index 788fa524e..713a2533b 100755 --- a/ci/build_runtime_qt4.sh +++ b/ci/build_runtime_qt4.sh @@ -6,5 +6,5 @@ echo cd $WORKSPACE/runtime make clean -PATH=/usr/local/python-$PYTHON_VERSION/bin:$PATH /bin/qmake-qt4 -make all +PATH=/usr/local/python-$PYTHON_VERSION/bin:$PATH /bin/qmake-qt4 || { echo 'ERROR: Failed to run the QT4 qmake step.' ; exit 1; } +make all || { echo 'ERROR: Failed to build the QT4 runtime.' ; exit 1; } diff --git a/ci/build_runtime_qt5.sh b/ci/build_runtime_qt5.sh index 82a7c08ee..2360d9f5a 100755 --- a/ci/build_runtime_qt5.sh +++ b/ci/build_runtime_qt5.sh @@ -6,5 +6,5 @@ echo cd $WORKSPACE/runtime make clean -PATH=/usr/local/python-$PYTHON_VERSION/bin:$PATH /bin/qmake-qt5 DEFINES+=PGADMIN4_USE_WEBKIT -make all +PATH=/usr/local/python-$PYTHON_VERSION/bin:$PATH /bin/qmake-qt5 DEFINES+=PGADMIN4_USE_WEBKIT || { echo 'ERROR: Failed to run the QT5 qmake step.' ; exit 1; } +make all || { echo 'ERROR: Failed to build the QT4 runtime.' ; exit 1; } diff --git a/ci/build_tarballs.sh b/ci/build_tarballs.sh index 42a4e0edf..317cc3eee 100755 --- a/ci/build_tarballs.sh +++ b/ci/build_tarballs.sh @@ -12,6 +12,6 @@ if [ "$PYTHON_VERSION" = "2.6" -o "$PYTHON_VERSION" = "3.3" ]; then SPHINX_VER="==1.4.9" fi -$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER +$WORKSPACE/pgadmin-venv/bin/pip install Sphinx$SPHINX_VER || { echo 'ERROR: Failed to install Sphinx to build the tarballs.' ; exit 1; } cd $WORKSPACE/ -make src \ No newline at end of file +make src || { echo 'ERROR: Failed to build the tarballs.' ; exit 1; } \ No newline at end of file diff --git a/ci/create_config.sh b/ci/create_config.sh index 192f08a64..ba2961e33 100755 --- a/ci/create_config.sh +++ b/ci/create_config.sh @@ -5,11 +5,11 @@ echo cd $WORKSPACE -cp $JENKINS_HOME/pgadmin-configs/config_local.py $WORKSPACE/web/config_local.py -echo LOG_FILE = \"$WORKSPACE/var/pgadmin4.log\" >> $WORKSPACE/web/config_local.py -echo SESSION_DB_PATH = \"$WORKSPACE/var/sessions\" >> $WORKSPACE/web/config_local.py -echo STORAGE_DIR = \"$WORKSPACE/var/storage\" >> $WORKSPACE/web/config_local.py -echo SQLITE_PATH = \"$WORKSPACE/var/pgadmin4.db\" >> $WORKSPACE/web/config_local.py -echo TEST_SQLITE_PATH = \"$WORKSPACE/var/pgadmin4.db\" >> $WORKSPACE/web/config_local.py +cp $JENKINS_HOME/pgadmin-configs/config_local.py $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo LOG_FILE = \"$WORKSPACE/var/pgadmin4.log\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo SESSION_DB_PATH = \"$WORKSPACE/var/sessions\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo STORAGE_DIR = \"$WORKSPACE/var/storage\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo SQLITE_PATH = \"$WORKSPACE/var/pgadmin4.db\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } +echo TEST_SQLITE_PATH = \"$WORKSPACE/var/pgadmin4.db\" >> $WORKSPACE/web/config_local.py || { echo 'ERROR: Failed to create config_local.py.' ; exit 1; } -cp $JENKINS_HOME/pgadmin-configs/test_config.json $WORKSPACE/web/regression/test_config.json +cp $JENKINS_HOME/pgadmin-configs/test_config.json $WORKSPACE/web/regression/test_config.json || { echo 'ERROR: Failed to copy the test configuration.' ; exit 1; } diff --git a/ci/run_jasmine_tests.sh b/ci/run_jasmine_tests.sh index 14cd73aa7..e44bc3905 100755 --- a/ci/run_jasmine_tests.sh +++ b/ci/run_jasmine_tests.sh @@ -5,5 +5,5 @@ echo cd $WORKSPACE/web/ -/bin/npm install -./node_modules/.bin/karma start --single-run +/bin/npm install || { echo 'ERROR: Failed to install the required Javascript modules.' ; exit 1; } +./node_modules/.bin/karma start --single-run || { echo 'ERROR: Error detected when running the Jasmine tests.' ; exit 1; } diff --git a/ci/run_python_tests.sh b/ci/run_python_tests.sh index bdfef2892..3fd92e9f5 100755 --- a/ci/run_python_tests.sh +++ b/ci/run_python_tests.sh @@ -21,15 +21,15 @@ if [[ "$PYTHON_VERSION" == 3* ]]; then PYTHON_SUFFIX="3" fi -/usr/bin/virtualenv -p /usr/local/python-$PYTHON_VERSION/bin/python$PYTHON_SUFFIX $WORKSPACE/pgadmin-venv -. $WORKSPACE/pgadmin-venv/bin/activate -$WORKSPACE/pgadmin-venv/bin/pip install -r requirements.txt -$WORKSPACE/pgadmin-venv/bin/pip install -r web/regression/requirements.txt +/usr/bin/virtualenv -p /usr/local/python-$PYTHON_VERSION/bin/python$PYTHON_SUFFIX $WORKSPACE/pgadmin-venv || { echo 'ERROR: Failed to create the Python virtual environment.' ; exit 1; } +. $WORKSPACE/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } +$WORKSPACE/pgadmin-venv/bin/pip install -r requirements.txt || { echo 'ERROR: Failed to install the application requirements.' ; exit 1; } +$WORKSPACE/pgadmin-venv/bin/pip install -r web/regression/requirements.txt || { echo 'ERROR: Failed to install the regression test requirements.' ; exit 1; } echo "Running regression tests..." echo -$WORKSPACE/pgadmin-venv/bin/python $WORKSPACE/web/regression/runtests.py +$WORKSPACE/pgadmin-venv/bin/python $WORKSPACE/web/regression/runtests.py || { echo 'ERROR: Error detected when running the Python tests.' ; exit 1; } echo "Cleaning up..." echo diff --git a/ci/update_messages.sh b/ci/update_messages.sh index 8fe187b16..1ea4c7f6a 100755 --- a/ci/update_messages.sh +++ b/ci/update_messages.sh @@ -5,7 +5,7 @@ echo cd $WORKSPACE/web -. $WORKSPACE/pgadmin-venv/bin/activate +. $WORKSPACE/pgadmin-venv/bin/activate || { echo 'ERROR: Failed to activate the Python virtual environment.' ; exit 1; } pybabel extract -F babel.cfg -o pgadmin/messages.pot pgadmin || { echo 'ERROR: Failed to extract messages from the source code.' ; exit 1; }