]> source.dussan.org Git - nextcloud-server.git/commitdiff
use tmpfs at /dev/shm to speedup unit test execution
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 30 Jul 2013 15:41:52 +0000 (17:41 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 30 Jul 2013 15:41:52 +0000 (17:41 +0200)
autotest.sh

index abe0b92586ca24191e9b4f99742189ba88888b1b..a343f6a25ab7bb887b2d1135614e9229316315e3 100755 (executable)
 DATABASENAME=oc_autotest$EXECUTOR_NUMBER
 DATABASEUSER=oc_autotest$EXECUTOR_NUMBER
 ADMINLOGIN=admin$EXECUTOR_NUMBER
-DATADIR=data-autotest
 BASEDIR=$PWD
 
+# use tmpfs for datadir - should speedup unit test execution
+if [ -d /dev/shm ]; then
+  DATADIR=/dev/shm/data-autotest$EXECUTOR_NUMBER
+else
+  DATADIR=$BASEDIR/data-autotest
+fi
+
 echo "Using database $DATABASENAME"
 
 # create autoconfig for sqlite, mysql and postgresql
@@ -24,7 +30,7 @@ cat > ./tests/autoconfig-sqlite.php <<DELIM
   'dbtableprefix' => 'oc_',
   'adminlogin' => '$ADMINLOGIN',
   'adminpass' => 'admin',
-  'directory' => '$BASEDIR/$DATADIR',
+  'directory' => '$DATADIR',
 );
 DELIM
 
@@ -36,7 +42,7 @@ cat > ./tests/autoconfig-mysql.php <<DELIM
   'dbtableprefix' => 'oc_',
   'adminlogin' => '$ADMINLOGIN',
   'adminpass' => 'admin',
-  'directory' => '$BASEDIR/$DATADIR',
+  'directory' => '$DATADIR',
   'dbuser' => '$DATABASEUSER',
   'dbname' => '$DATABASENAME',
   'dbhost' => 'localhost',
@@ -52,7 +58,7 @@ cat > ./tests/autoconfig-pgsql.php <<DELIM
   'dbtableprefix' => 'oc_',
   'adminlogin' => '$ADMINLOGIN',
   'adminpass' => 'admin',
-  'directory' => '$BASEDIR/$DATADIR',
+  'directory' => '$DATADIR',
   'dbuser' => '$DATABASEUSER',
   'dbname' => '$DATABASENAME',
   'dbhost' => 'localhost',
@@ -68,7 +74,7 @@ cat > ./tests/autoconfig-oci.php <<DELIM
   'dbtableprefix' => 'oc_',
   'adminlogin' => '$ADMINLOGIN',
   'adminpass' => 'admin',
-  'directory' => '$BASEDIR/$DATADIR',
+  'directory' => '$DATADIR',
   'dbuser' => '$DATABASENAME',
   'dbname' => 'XE',
   'dbhost' => 'localhost',