Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test dependencies #102

Merged
merged 13 commits into from
Oct 21, 2019
Merged
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ addons:
sources:
- sourceline: 'ppa:cartodb/odbc'
packages:
- mysql-server-core-5.6
- mysql-client-5.6
- mysql-server-5.6
- mysql-server-core-5.7
- mysql-client-5.7
- mysql-server-5.7
- unixodbc-dev
- odbcinst # ODBC core
- odbc-postgresql=1:09.02.0100-2ubuntu1 # PgSQL ODBC
- odbc-postgresql # PgSQL ODBC
- libmyodbc # MySQL ODBC
- freetds # Custom package to use freetds >= 1.x in trusty

Expand All @@ -47,6 +47,8 @@ before_install:
- sudo bash $TRAVIS_BUILD_DIR/test/scripts/ci/install_postgres.sh
# Install Hive (sudos in script as needed)
- bash $TRAVIS_BUILD_DIR/test/scripts/ci/install_hive.sh
# Starting up MySQL
- sudo service mysql start
# ODBC installation ini file
- sudo cp $TRAVIS_BUILD_DIR/test/scripts/ci/odbcinst.ini /etc

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ in the `/etc/odbcinst.ini` file.
Driver requirements
--------------------

- odbc-postgreql: 9.x
- odbc-postgresql: >= 9.x
- libmyodbc: >= 5.1
- FreeTDS: >= 1.0
- hive-odbc-native: >= 2.1
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/load_all_fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ load_all()
load_hive_fixtures $BASEDIR
load_postgres_fixtures $BASEDIR
load_mysql_fixtures $BASEDIR
load_sqlserver_fixtures $BASEDIR
#load_sqlserver_fixtures $BASEDIR
}

load_all
10 changes: 6 additions & 4 deletions test/scripts/ci/install_hive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@
# HIVE_HOME
# HIVE_VERSION

# authorizes ssh to localhost and 0.0.0.0 in Xenial
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
echo -e "Host *\n StrictHostKeyChecking no" | sudo tee ~/.ssh/config
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
sudo apt-get -y install openjdk-7-jre

sudo apt-get -y install openjdk-8-jre
wget --quiet --directory-prefix=/opt http://archive.apache.org/dist/hadoop/common/hadoop-${HADOOP_VERSION}/hadoop-${HADOOP_VERSION}.tar.gz
wget --quiet --directory-prefix=/opt http://archive.apache.org/dist/hive/hive-${HIVE_VERSION}/apache-hive-${HIVE_VERSION}-bin.tar.gz
tar -xzf /opt/hadoop-${HADOOP_VERSION}.tar.gz -C /opt
tar -xzf /opt/apache-hive-${HIVE_VERSION}-bin.tar.gz -C /opt
sed -i -- 's/export JAVA_HOME=${JAVA_HOME}/export JAVA_HOME=\/usr\/lib\/jvm\/java-7-openjdk-amd64/g' ${HADOOP_HOME}/etc/hadoop/hadoop-env.sh
sed -i -- 's/export JAVA_HOME=${JAVA_HOME}/export JAVA_HOME=\/usr\/lib\/jvm\/java-8-openjdk-amd64/g' ${HADOOP_HOME}/etc/hadoop/hadoop-env.sh
${HADOOP_HOME}/bin/hdfs dfs -mkdir /tmp/warehouse
${HADOOP_HOME}/bin/hdfs dfs -chmod g+w /tmp/warehouse
${HADOOP_HOME}/bin/hdfs dfs -mkdir /tmp/warehouse/fdw_tests
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/ci/odbcinst.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Debug = 0
CommLog = 1
UsageCount = 1

[MySQL]
[MySQL] # Unicode
Description = MySQL driver
Driver = libmyodbc.so
Driver = libmyodbc5w.so
Setup = libodbcmyS.so
CPTimeout =
CPReuse =
Expand Down
9 changes: 6 additions & 3 deletions test/tests-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ generate()
echo "Config file for $connector_type connector not found!"
exit 1
fi
generated_test=$(render "$i" "test/config/${connector_type}.config")
echo "$generated_test" > "test/sql/${connector_type}_10_installation_test.sql"
echo "$generated_test" > "test/expected/${connector_type}_10_installation_test.out"
# skipping sqlserver tests meanwhile a new one is deployed
if [ $connector_type != "sqlserver" ]; then
generated_test=$(render "$i" "test/config/${connector_type}.config")
echo "$generated_test" > "test/sql/${connector_type}_10_installation_test.sql"
echo "$generated_test" > "test/expected/${connector_type}_10_installation_test.out"
fi
done
}

Expand Down