aboutsummaryrefslogtreecommitdiffstats
path: root/build/prepareTestsOracle.sh
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2014-06-06 09:29:01 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-08-05 16:53:27 +0200
commit472d896ce9aad4d526126a7aefa96127920585e6 (patch)
tree2d2ba785bfbf43f4de2db732593622322ed4229a /build/prepareTestsOracle.sh
parent892d82480430b3c8d8e47feaa4f903922deec27e (diff)
downloadnextcloud-server-472d896ce9aad4d526126a7aefa96127920585e6.tar.gz
nextcloud-server-472d896ce9aad4d526126a7aefa96127920585e6.zip
Travis support
* use PHPUnit 4.x * force php memory limit on travis to 1024MB * create script for travis * whitelist branches master, stable5 and stable6 on travis (and PRs) * sqlplus64 * conditional JS tests and ocular temporal removal * enable scrutinizer code coverage * move oracle to top to decrease overall test duration
Diffstat (limited to 'build/prepareTestsOracle.sh')
-rwxr-xr-xbuild/prepareTestsOracle.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/build/prepareTestsOracle.sh b/build/prepareTestsOracle.sh
new file mode 100755
index 00000000000..65a59036659
--- /dev/null
+++ b/build/prepareTestsOracle.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+#
+# ownCloud - prepareTestOracle.sh
+#
+# @author Morris Jobke
+# @copyright 2014 Morris Jobke hey@morrisjobke.de
+#
+
+DATABASENAME=$1
+DATABASEUSER=$2
+ADMINLOGIN=$3
+DATADIR=$4
+
+# set oracle home if it is not set
+TRAVIS_ORACLE_HOME="/usr/lib/oracle/xe/app/oracle/product/10.2.0/server"
+[ -z "$ORACLE_HOME" ] && ORACLE_HOME=$TRAVIS_ORACLE_HOME
+
+echo "Load Oracle environment variables so that we can run 'sqlplus'."
+ . $ORACLE_HOME/bin/oracle_env.sh
+
+echo "drop the database"
+sqlplus64 -s -l / as sysdba <<EOF
+ drop user $DATABASENAME cascade;
+EOF
+
+echo "create the database"
+sqlplus64 -s -l / as sysdba <<EOF
+ create user $DATABASENAME identified by owncloud;
+ alter user $DATABASENAME default tablespace users
+ temporary tablespace temp
+ quota unlimited on users;
+ grant create session
+ , create table
+ , create procedure
+ , create sequence
+ , create trigger
+ , create view
+ , create synonym
+ , alter session
+ to $DATABASENAME;
+ exit;
+EOF
+
+# there was a maximum cursor limit exceed
+# therefore increase the limit
+sqlplus64 -s -l / as sysdba <<EOF
+ ALTER SYSTEM SET open_cursors = 1000 SCOPE=BOTH;
+EOF
+
+cat > ./config/autoconfig.php <<DELIM
+<?php
+\$AUTOCONFIG = array (
+ 'installed' => false,
+ 'dbtype' => 'oci',
+ 'dbtableprefix' => 'oc_',
+ 'adminlogin' => '$ADMINLOGIN',
+ 'adminpass' => 'admin',
+ 'directory' => '$DATADIR',
+ 'dbuser' => '$DATABASEUSER',
+ 'dbname' => 'XE',
+ 'dbhost' => 'localhost',
+ 'dbpass' => 'owncloud',
+);
+DELIM
+