Browse Source

add ci for swift primary storage

Signed-off-by: Robin Appelman <robin@icewind.nl>
Robin Appelman 6 years ago
parent
commit
df6e23c98c
5 changed files with 43 additions and 0 deletions
  1. 11 0
      .drone.yml
  2. 3 0
      autotest.sh
  3. 10 0
      tests/drone-wait-objectstore.sh
  4. 3 0
      tests/lib/Files/ObjectStore/SwiftTest.php
  5. 16 0
      tests/preseed-config.php

+ 11 - 0
.drone.yml

@@ -596,6 +596,7 @@ pipeline:
       image: nextcloudci/php7.0:php7.0-19
       commands:
         - phpenmod xdebug
+        - ./tests/drone-wait-objectstore.sh
         - TEST_SELECTION=PRIMARY-${OBJECT_STORE} ./autotest.sh sqlite
         - 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"
@@ -743,6 +744,8 @@ matrix:
     - TESTS: carddavtester-old-endpoint
     - TESTS: object-store
       OBJECT_STORE: s3
+    - TESTS: object-store
+      OBJECT_STORE: swift
     - TESTS: sqlite-php7.0-samba-native
     - TESTS: sqlite-php7.0-samba-non-native
     - TEST: memcache-memcached
@@ -838,6 +841,14 @@ services:
       when:
         matrix:
           OBJECT_STORE: s3
+  dockswift:
+      image: icewind1991/dockswift
+      environment:
+      - INITIALIZE=yes
+      - IPADDRESS=dockswift
+      when:
+        matrix:
+          OBJECT_STORE: swift
   selenium:
     image: selenium/standalone-firefox:2.53.1-beryllium
     environment:

+ 3 - 0
autotest.sh

@@ -369,6 +369,9 @@ function execute_tests {
 	if [ "$TEST_SELECTION" == "PRIMARY-s3" ]; then
 		GROUP='--group PRIMARY-s3'
 	fi
+	if [ "$TEST_SELECTION" == "PRIMARY-swift" ]; then
+		GROUP='--group PRIMARY-swift'
+	fi
 
 	COVER=''
 	if [ -z "$NOCOVERAGE" ]; then

+ 10 - 0
tests/drone-wait-objectstore.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ "$OBJECT_STORE" == "swift" ]; then
+    echo "waiting for swift"
+    until curl -I http://dockswift:5000/v3
+    do
+        sleep 2
+    done
+    sleep 30
+fi

+ 3 - 0
tests/lib/Files/ObjectStore/SwiftTest.php

@@ -23,6 +23,9 @@ namespace Test\Files\ObjectStore;
 
 use OC\Files\ObjectStore\Swift;
 
+/**
+ * @group PRIMARY-swift
+ */
 class SwiftTest extends ObjectStoreTest {
 	/**
 	 * @return \OCP\Files\ObjectStore\IObjectStore

+ 16 - 0
tests/preseed-config.php

@@ -34,3 +34,19 @@ if (getenv('OBJECT_STORE') === 's3') {
 		)
 	];
 }
+if (getenv('OBJECT_STORE') === 'swift') {
+	$swiftHost = getenv('DRONE') === 'true' ? 'dockswift' : 'localhost';
+	$CONFIG['objectstore'] = [
+		'class' => 'OC\\Files\\ObjectStore\\Swift',
+		'arguments' => array(
+			'autocreate' => true,
+			'username' => 'swift',
+			'tenantName' => 'service',
+			'password' => 'swift',
+			'serviceName' => 'swift',
+			'region' => 'regionOne',
+			'url' => "http://$swiftHost:5000/v2.0",
+			'bucket' => 'nextcloud'
+		)
+	];
+}