]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add redis cluster tests to our CI jobs
authorMorris Jobke <hey@morrisjobke.de>
Tue, 2 May 2017 21:08:43 +0000 (18:08 -0300)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 11 May 2017 22:07:20 +0000 (17:07 -0500)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
.drone.yml
autotest.sh
tests/redis-cluster.config.php [new file with mode: 0644]

index e5fda39f4ee22430b84580b218b5e11074c0ab24..b313760a5d25b9125ca3e0aabad177b95e8783fc 100644 (file)
@@ -526,6 +526,16 @@ pipeline:
     when:
       matrix:
         TEST: memcache-memcached
+  memcache-redis-cluster:
+    image: nextcloudci/php7.0:php7.0-7
+    commands:
+      - ./autotest.sh sqlite tests/lib/Memcache/RedisTest.php
+      - wget https://codecov.io/bash -O codecov.sh
+      - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
+      - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
+    when:
+      matrix:
+        TEST: memcache-redis-cluster
 matrix:
   include:
     - TESTS: checkers
@@ -582,6 +592,8 @@ matrix:
     - TESTS: sqlite-php7.0-samba-native
     - TESTS: sqlite-php7.0-samba-non-native
     - TEST: memcache-memcached
+    - TEST: memcache-redis-cluster
+      ENABLE_REDIS_CLUSTER: true
     - TESTS: sqlite-php7.0-webdav-apache
       ENABLE_REDIS: true
     - DB: NODB
@@ -618,6 +630,11 @@ services:
     when:
       matrix:
        ENABLE_REDIS: true
+  cache-cluster:
+    image: grokzen/redis-cluster
+    when:
+      matrix:
+       ENABLE_REDIS_CLUSTER: true
   postgres:
     image: postgres
     environment:
index b00946d0c026cd0104ecd4ef85d999ef99802559..069488a3346d70f2f9ac68b073ee82a6cd0e3f99 100755 (executable)
@@ -184,6 +184,8 @@ function execute_tests {
 
        if [ "$ENABLE_REDIS" == "true" ] ; then
                cp tests/redis.config.php config/redis.config.php
+       elif [ "$ENABLE_REDIS_CLUSTER" == "true" ] ; then
+               cp tests/redis-cluster.config.php config/redis.config.php
        fi
 
        _DB=$DB
diff --git a/tests/redis-cluster.config.php b/tests/redis-cluster.config.php
new file mode 100644 (file)
index 0000000..c7df2a9
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+$CONFIG = [
+       'memcache.local' => '\\OC\\Memcache\\Redis',
+       'memcache.distributed' => '\\OC\\Memcache\\Redis',
+       'memcache.locking' => '\\OC\\Memcache\\Redis',
+       'redis.cluster' => [
+               'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required
+                       'localhost:7000',
+                       'localhost:7001',
+                       'localhost:7002',
+                       'localhost:7003',
+                       'localhost:7004',
+                       'localhost:7005'
+               ],
+               'timeout' => 0.0,
+               'read_timeout' => 0.0,
+               'failover_mode' => \RedisCluster::FAILOVER_ERROR
+       ],
+];