]> git.mxchange.org Git - friendica.git/commitdiff
Some new tests and fixings
authorPhilipp Holzer <admin+github@philipp.info>
Mon, 23 Sep 2019 13:23:09 +0000 (15:23 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Mon, 30 Sep 2019 12:03:13 +0000 (14:03 +0200)
.drone.yml
autotest.sh
tests/Util/VFSTrait.php
tests/src/Util/Logger/StreamLoggerTest.php

index 0d826cf694f8931edfea785d8c7aa3bfff784500..5ad22fa420ba90b22eeadf77f0ef549131e019d7 100644 (file)
@@ -3,7 +3,7 @@ name: mysql-php7.1
 
 steps:
 - name: mysql-php7.1
-  image: friendicaci/php7.1:php7.1
+  image: friendicaci/php7.1:php7.1.32
   commands:
     - NOCOVERAGE=true ./autotest.sh
   environment:
@@ -32,3 +32,145 @@ services:
 #  event:
 #    - pull_request
 #    - push
+---
+kind: pipeline
+name: mysql-php7.2
+
+steps:
+    - name: mysql-php7.2
+      image: friendicaci/php7.2:php7.2.22
+      commands:
+          - NOCOVERAGE=true ./autotest.sh
+      environment:
+          MYSQL_USERNAME: friendica
+          MYSQL_PASSWORD: friendica
+          MYSQL_DATABASE: friendica
+          MYSQL_HOST: mysql
+
+services:
+    - name: mysql
+      image: mysql:8.0
+      command: [ "--default-authentication-plugin=mysql_native_password" ]
+      environment:
+          MYSQL_ROOT_PASSWORD: friendica
+          MYSQL_USER: friendica
+          MYSQL_PASSWORD: friendica
+          MYSQL_DATABASE: friendica
+      tmpfs:
+          - /var/lib/mysql
+
+#trigger:
+#  branch:
+#    - master
+#    - develop
+#    - "*-rc"
+#  event:
+#    - pull_request
+#    - push
+---
+kind: pipeline
+name: mysql-php7.3
+
+steps:
+    - name: mysql-php7.3
+      image: friendicaci/php7.3:php7.3.9
+      commands:
+          - NOCOVERAGE=true ./autotest.sh
+      environment:
+          MYSQL_USERNAME: friendica
+          MYSQL_PASSWORD: friendica
+          MYSQL_DATABASE: friendica
+          MYSQL_HOST: mysql
+
+services:
+    - name: mysql
+      image: mysql:8.0
+      command: [ "--default-authentication-plugin=mysql_native_password" ]
+      environment:
+          MYSQL_ROOT_PASSWORD: friendica
+          MYSQL_USER: friendica
+          MYSQL_PASSWORD: friendica
+          MYSQL_DATABASE: friendica
+      tmpfs:
+          - /var/lib/mysql
+
+#trigger:
+#  branch:
+#    - master
+#    - develop
+#    - "*-rc"
+#  event:
+#    - pull_request
+#    - push
+---
+kind: pipeline
+name: redis-php7.1
+
+steps:
+    - name: redis-php7.1
+      image: friendicaci/php7.1:php7.1.32
+      commands:
+          - NOCOVERAGE=true NOINSTALL=true TEST_SELECTION=REDIS ./autotest.sh
+      environment:
+          REDIS_HOST: redis
+
+services:
+    - name: redis
+      image: redis
+
+#trigger:
+#  branch:
+#    - master
+#    - develop
+#    - "*-rc"
+#  event:
+#    - pull_request
+#    - push
+---
+kind: pipeline
+name: redis-php7.2
+
+steps:
+    - name: redis-php7.2
+      image: friendicaci/php7.2:php7.2.22
+      commands:
+          - NOCOVERAGE=true NOINSTALL=true TEST_SELECTION=REDIS ./autotest.sh
+      environment:
+        REDIS_HOST: redis
+
+services:
+    - name: redis
+      image: redis
+
+#trigger:
+#  branch:
+#    - master
+#    - develop
+#    - "*-rc"
+#  event:
+#    - pull_request
+#    - push
+---
+kind: pipeline
+name: redis-php7.3
+
+steps:
+    - name: redis-php7.3
+      image: friendicaci/php7.3:php7.3.9
+      commands:
+          - NOCOVERAGE=true NOINSTALL=true TEST_SELECTION=REDIS ./autotest.sh
+      environment:
+        REDIS_HOST: redis
+
+services:
+    - name: redis
+      image: redis
+
+#trigger:
+#  branch:
+#    - master
+#    - develop
+#    - "*-rc"
+#  event:
+#    - pull_request
+#    - push
index b160950275ef93f0229d8f14e600367d21f6b821..9c3d56f17839fdb0b0105a1e5bc891761b557bab 100755 (executable)
@@ -79,45 +79,47 @@ function execute_tests {
       mv config/local.config.php config/local.config-autotest-backup.php
     fi
 
-    if [ -n "$USEDOCKER" ]; then
-      echo "Fire up the mysql docker"
-      DOCKER_CONTAINER_ID=$(docker run \
-              -e MYSQL_ROOT_PASSWORD=friendica \
-              -e MYSQL_USER="$DATABASEUSER" \
-              -e MYSQL_PASSWORD=friendica \
-              -e MYSQL_DATABASE="$DATABASENAME" \
-              -d mysql)
-      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 3
-        fi
-        mysql -u "$DATABASEUSER" -pfriendica -e "DROP DATABASE IF EXISTS $DATABASENAME"
-        mysql -u "$DATABASEUSER" -pfriendica -e "CREATE DATABASE $DATABASENAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
+    if [ -z "$NOINSTALL" ]; then
+      if [ -n "$USEDOCKER" ]; then
+        echo "Fire up the mysql docker"
+        DOCKER_CONTAINER_ID=$(docker run \
+                -e MYSQL_ROOT_PASSWORD=friendica \
+                -e MYSQL_USER="$DATABASEUSER" \
+                -e MYSQL_PASSWORD=friendica \
+                -e MYSQL_DATABASE="$DATABASENAME" \
+                -d mysql)
+        DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
       else
-        DATABASEHOST=mysql
+        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 3
+          fi
+          mysql -u "$DATABASEUSER" -pfriendica -e "DROP DATABASE IF EXISTS $DATABASENAME"
+          mysql -u "$DATABASEUSER" -pfriendica -e "CREATE DATABASE $DATABASENAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
+        else
+          DATABASEHOST=mysql
+        fi
       fi
-    fi
 
-    echo "Waiting for MySQL $DATABASEHOST initialization..."
-    if ! bin/wait-for-connection $DATABASEHOST 3306 300; then
-      echo "[ERROR] Waited 300 seconds, no response" >&2
-      exit 1
-    fi
+      echo "Waiting for MySQL $DATABASEHOST initialization..."
+      if ! bin/wait-for-connection $DATABASEHOST 3306 300; then
+        echo "[ERROR] Waited 300 seconds, no response" >&2
+        exit 1
+      fi
 
-    if [ -n "$USEDOCKER" ]; then
-      echo "Initialize database..."
-      docker exec $DOCKER_CONTAINER_ID mysql -u root -pfriendica -e 'CREATE DATABASE IF NOT EXISTS $DATABASENAME;'
-    fi
+      if [ -n "$USEDOCKER" ]; then
+        echo "Initialize database..."
+        docker exec $DOCKER_CONTAINER_ID mysql -u root -pfriendica -e 'CREATE DATABASE IF NOT EXISTS $DATABASENAME;'
+      fi
 
-    export MYSQL_HOST="$DATABASEHOST"
+      export MYSQL_HOST="$DATABASEHOST"
 
-    #call installer
-    echo "Installing Friendica..."
-    "$PHP" ./bin/console.php autoinstall --dbuser="$DATABASEUSER" --dbpass=friendica --dbdata="$DATABASENAME" --dbhost="$DATABASEHOST" --url=https://friendica.local --admin=admin@friendica.local
+      #call installer
+      echo "Installing Friendica..."
+      "$PHP" ./bin/console.php autoinstall --dbuser="$DATABASEUSER" --dbpass=friendica --dbdata="$DATABASENAME" --dbhost="$DATABASEHOST" --url=https://friendica.local --admin=admin@friendica.local
+    fi
 
     #test execution
     echo "Testing..."
@@ -137,16 +139,16 @@ function execute_tests {
     # per default, there is no cache installed
     GROUP='--exclude-group=REDIS,MEMCACHE,MEMCACHED,APCU'
     if [ "$TEST_SELECTION" == "REDIS" ]; then
-      GROUP="--group REDIS"
+      GROUP="--group=REDIS"
     fi
     if [ "$TEST_SELECTION" == "MEMCACHE" ]; then
-      GROUP="--group MEMCACHE"
+      GROUP="--group=MEMCACHE"
     fi
     if [ "$TEST_SELECTION" == "MEMCACHED" ]; then
-      GROUP="--group MEMCACHED"
+      GROUP="--group=MEMCACHED"
     fi
     if [ "$TEST_SELECTION" == "APCU" ]; then
-      GROUP="--group APCU"
+      GROUP="--group=APCU"
     fi
     if [ "$TEST_SELECTION" == "NODB" ]; then
       GROUP="--exclude-group=DB,SLOWDB"
index 565e693c95e322d5502d794acba7341637097de2..ecf0880d29b68729da0ec46e41003521639e3165 100644 (file)
@@ -23,6 +23,7 @@ trait VFSTrait
                        'bin' => [],
                        'static' => [],
                        'test' => [],
+                       'logs' => [],
                ];
 
                // create a virtual directory and copy all needed files and folders to it
index bbf94419a6b6b970ec5703a566c41e3cf237d7f1..460f39e26b105282c7e5f2b960cb234c2f6e1d01 100644 (file)
@@ -121,7 +121,7 @@ class StreamLoggerTest extends AbstractLoggerTest
         */
        public function testWrongDir()
        {
-               $logger = new StreamLogger('test', '/a/wrong/directory/file.txt', $this->introspection);
+               $logger = new StreamLogger('test', '/$%/wrong/directory/file.txt', $this->introspection);
 
                $logger->emergency('not working');
        }