]> source.dussan.org Git - nextcloud-server.git/commitdiff
add 4 byte mysql test run
authorMorris Jobke <hey@morrisjobke.de>
Tue, 18 Oct 2016 08:31:05 +0000 (10:31 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Tue, 18 Oct 2016 22:15:01 +0000 (00:15 +0200)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
.drone.yml
autotest.sh

index c54907cc5d9a838a5049051e7c1011c943a07422..025d223f2d17d6f1c13f5404f8909cfe6979d17b 100644 (file)
@@ -148,6 +148,14 @@ pipeline:
       matrix:
         DB: postgres
         PHP: 5.6
+  mysqlmb4-php5.6:
+    image: nextcloudci/php5.6:php5.6-2
+    commands:
+      - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4
+    when:
+      matrix:
+        DB: mysqlmb4
+        PHP: 5.6
   integration-capabilities_features:
     image: nextcloudci/integration-php7.0:integration-php7.0-1
     commands:
@@ -368,6 +376,8 @@ matrix:
       PHP: 5.6
     - DB: postgres
       PHP: 5.6
+    - DB: mysqlmb4
+      PHP: 5.6
 
 services:
   cache:
@@ -390,3 +400,15 @@ services:
     when:
       matrix:
         DB: mysql
+  mysqlmb4:
+    image: mysql
+    environment:
+      - MYSQL_ROOT_PASSWORD=owncloud
+      - MYSQL_USER=oc_autotest
+      - MYSQL_PASSWORD=owncloud
+      - MYSQL_DATABASE=oc_autotest
+    volumes:
+      - /drone/src/github.com/nextcloud/server/tests/docker/mysqlmb4:/etc/mysql/conf.d
+    when:
+      matrix:
+        DB: mysqlmb4
index 4364e41fa349666a610a38b22edddbb2b13f32db..c77562e76029d77aec854f6e4c5a52848bb9b1ab 100755 (executable)
@@ -210,16 +210,30 @@ function execute_tests {
         fi
        fi
        if [ "$DB" == "mysqlmb4" ] ; then
-               echo "Fire up the mysql docker"
-               DOCKER_CONTAINER_ID=$(docker run \
-                       -v $BASEDIR/tests/docker/mysqlmb4:/etc/mysql/conf.d \
-                       -e MYSQL_ROOT_PASSWORD=owncloud \
-                       -e MYSQL_USER="$DATABASEUSER" \
-                       -e MYSQL_PASSWORD=owncloud \
-                       -e MYSQL_DATABASE="$DATABASENAME" \
-                       -d mysql:5.7)
+               if [ ! -z "$USEDOCKER" ] ; then
+                       echo "Fire up the mysql docker"
+                       DOCKER_CONTAINER_ID=$(docker run \
+                               -v $BASEDIR/tests/docker/mysqlmb4:/etc/mysql/conf.d \
+                               -e MYSQL_ROOT_PASSWORD=owncloud \
+                               -e MYSQL_USER="$DATABASEUSER" \
+                               -e MYSQL_PASSWORD=owncloud \
+                               -e MYSQL_DATABASE="$DATABASENAME" \
+                               -d mysql:5.7)
 
-               DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
+                       DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
+
+               else
+                       if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI
+                               if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
+                                       echo "Your mysql binary is not provided by mysql"
+                                       echo "To use the docker container set the USEDOCKER environment variable"
+                                       exit -1
+                               fi
+                               mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
+                       else
+                               DATABASEHOST=127.0.0.1
+                       fi
+               fi
 
                echo "Waiting for MySQL(utf8mb4) initialisation ..."