Skip to content
Permalink
Browse files

Configure Oracle continuous integration

  • Loading branch information
troopa81 authored and nyalldawson committed Nov 4, 2019
1 parent 28f70c0 commit cf0186b246f7ba12509cbd7a6d6a277e4089fd20
@@ -11,6 +11,16 @@ services:
- SSL_KEY_FILE=/etc/ssl/private/postgres_key.key
- SSL_CA_FILE=/etc/ssl/certs/issuer_ca_cert.pem

oracle:
image: oslandia/oracle-for-qgis-tests:18.4.0-xe
environment:
- ORACLE_SID=XE
- ORACLE_PWD=adminpass
- ORACLE_PDB=ORCLPDBTEST
- ORACLE_CHARACTERSET=AL32UTF8
ports:
- 1521:1521

# Proving very fragile!
# mssql:
# image: microsoft/mssql-server-linux:2017-latest
@@ -25,7 +35,7 @@ services:
- ${TRAVIS_BUILD_DIR}:/root/QGIS
links:
- postgres
- oracle
# - mssql
env_file:
- docker-variables.env

@@ -52,6 +52,10 @@ cmake \
-DWITH_DESKTOP=ON \
-DWITH_BINDINGS=ON \
-DWITH_SERVER=ON \
-DWITH_ORACLE=ON \
-DENABLE_ORACLETEST=ON \
-DORACLE_INCLUDEDIR="/instantclient_19_3/sdk/include/" \
-DORACLE_LIBDIR="/instantclient_19_3/" \
-DDISABLE_DEPRECATED=ON \
-DPYTHON_TEST_WRAPPER="timeout -sSIGSEGV 55s"\
-DCXX_EXTRA_FLAGS="${CLANG_WARNINGS}" \
@@ -17,7 +17,7 @@ export PGPASSWORD=docker
export PGDATABASE=qgis_test

# wait for the DB to be available
echo "Wait a moment while loading the database."
echo "Wait a moment while loading PostGreSQL database."
while ! PGPASSWORD='docker' psql -h postgres -U docker -p 5432 -l &> /dev/null
do
printf "🐘"
@@ -29,6 +29,26 @@ pushd /root/QGIS > /dev/null
/root/QGIS/tests/testdata/provider/testdata_pg.sh
popd > /dev/null # /root/QGIS

##############################
# Restore Oracle test data
##############################

export ORACLE_HOST="oracle"
export QGIS_ORACLETEST_DBNAME="${ORACLE_HOST}/XEPDB1"
export QGIS_ORACLETEST_DB="host=${QGIS_ORACLETEST_DBNAME} port=1521 user='QGIS' password='qgis'"

echo "Wait a moment while loading Oracle database."
while ! echo exit | sqlplus -L SYSTEM/adminpass@$QGIS_ORACLETEST_DBNAME &> /dev/null
do
printf "."
sleep 1
done
echo " done"

pushd /root/QGIS > /dev/null
/root/QGIS/tests/testdata/provider/testdata_oracle.sh $ORACLE_HOST
popd > /dev/null # /root/QGIS

# this is proving very flaky:

##############################
@@ -81,6 +101,3 @@ if [ $rv -eq 124 ] ; then
printf '\n\n${bold}Build and test timeout. Please restart the build for meaningful results.${endbold}\n'
exit #$rv
fi



@@ -25,6 +25,7 @@ RUN apt-get update \
git \
graphviz \
grass-dev \
libaio1 \
libexiv2-dev \
libexpat1-dev \
libfcgi-dev \
@@ -96,6 +97,7 @@ RUN apt-get update \
saga \
spawn-fcgi \
txt2tags \
unzip \
xauth \
xfonts-100dpi \
xfonts-75dpi \
@@ -115,6 +117,17 @@ RUN apt-get update \
pyopenssl \
&& apt-get clean

# Oracle : client side
RUN curl https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip > instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
RUN curl https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip > instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
RUN curl https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip > instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip

RUN unzip instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
RUN unzip instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
RUN unzip instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip

ENV PATH="/instantclient_19_3:${PATH}"
ENV LD_LIBRARY_PATH="/instantclient_19_3:${LD_LIBRARY_PATH}"

# MSSQL: client side
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
@@ -26,6 +26,7 @@ RUN apt-get update \
git \
graphviz \
grass-dev \
libaio1 \
libexiv2-dev \
libexpat1-dev \
libfcgi-dev \
@@ -98,6 +99,7 @@ RUN apt-get update \
saga \
spawn-fcgi \
txt2tags \
unzip \
xauth \
xfonts-100dpi \
xfonts-75dpi \
@@ -128,6 +130,17 @@ RUN apt-get update \
six \
&& apt-get clean

# Oracle : client side
RUN curl https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip > instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
RUN curl https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip > instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
RUN curl https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip > instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip

RUN unzip instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
RUN unzip instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
RUN unzip instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip

ENV PATH="/instantclient_19_3:${PATH}"
ENV LD_LIBRARY_PATH="/instantclient_19_3:${LD_LIBRARY_PATH}"

# MSSQL: client side
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
@@ -149,4 +162,3 @@ ENV OTB_INSTALL_DIR=/opt/otb
ENV QT_SELECT=5
ENV LANG=C.UTF-8
ENV PATH="/usr/local/bin:${PATH}"

@@ -40,7 +40,7 @@ class TestPyQgsOracleProvider(unittest.TestCase, ProviderTestCase):
@classmethod
def setUpClass(cls):
"""Run before all tests"""
cls.dbconn = "host=localhost port=1521 user='QGIS' password='qgis'"
cls.dbconn = "host=localhost/XEPDB1 port=1521 user='QGIS' password='qgis'"
if 'QGIS_ORACLETEST_DB' in os.environ:
cls.dbconn = os.environ['QGIS_ORACLETEST_DB']
# Create test layers
@@ -54,7 +54,7 @@ def setUpClass(cls):
cls.poly_provider = cls.poly_vl.dataProvider()

cls.conn = QSqlDatabase.addDatabase('QOCISPATIAL', "oracletest")
cls.conn.setDatabaseName('10.0.0.2/orcl')
cls.conn.setDatabaseName('localhost/XEPDB1')
if 'QGIS_ORACLETEST_DBNAME' in os.environ:
cls.conn.setDatabaseName(os.environ['QGIS_ORACLETEST_DBNAME'])
cls.conn.setUserName('QGIS')
@@ -0,0 +1,12 @@
#!/bin/sh

HOST=$1

set -e

echo "create user QGIS identified by qgis;
grant create session to qgis;
grant all privileges to qgis;
exit" | sqlplus SYSTEM/adminpass@$HOST/XEPDB1

echo exit | sqlplus QGIS/qgis@$HOST/XEPDB1 @tests/testdata/provider/testdata_oracle.sql

0 comments on commit cf0186b

Please sign in to comment.
You can’t perform that action at this time.