Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,16 @@ pipeline:
when:
matrix:
TESTS: db-codecov
object-store:
image: nextcloudci/php7.0:php7.0-7
commands:
- 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"
- 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:
TESTS: object-store
memcache-memcached:
image: nextcloudci/php7.0-memcached:php7.0-memcached-6
commands:
Expand Down Expand Up @@ -462,6 +472,8 @@ matrix:
- TESTS: litmus-v2
- TESTS: caldavtester
- TESTS: carddavtester
- TESTS: object-store
OBJECT_STORE: s3
- TESTS: sqlite-php7.0-samba-native
- TESTS: sqlite-php7.0-samba-non-native
- TEST: memcache-memcached
Expand Down Expand Up @@ -517,3 +529,8 @@ services:
when:
matrix:
DB: mysqlmb4
fake-s3:
image: lphoward/fake-s3
when:
matrix:
OBJECT_STORE: s3
3 changes: 3 additions & 0 deletions autotest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ function execute_tests {
if [ "$TEST_SELECTION" == "NODB" ]; then
GROUP='--exclude-group DB,SLOWDB'
fi
if [ "$TEST_SELECTION" == "PRIMARY-s3" ]; then
GROUP='--group PRIMARY-s3'
fi

COVER=''
if [ -z "$NOCOVERAGE" ]; then
Expand Down
6 changes: 2 additions & 4 deletions tests/lib/Files/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,9 @@ public function testHomeMount() {
$homeMount = \OC\Files\Filesystem::getStorage('/' . $userId . '/');

$this->assertTrue($homeMount->instanceOfStorage('\OCP\Files\IHomeStorage'));
if (getenv('RUN_OBJECTSTORE_TESTS')) {
$this->assertTrue($homeMount->instanceOfStorage('\OC\Files\ObjectStore\HomeObjectStoreStorage'));
if ($homeMount->instanceOfStorage('\OC\Files\ObjectStore\HomeObjectStoreStorage')) {
$this->assertEquals('object::user:' . $userId, $homeMount->getId());
} else {
$this->assertTrue($homeMount->instanceOfStorage('\OC\Files\Storage\Home'));
} else if ($homeMount->instanceOfStorage('\OC\Files\Storage\Home')) {
$this->assertEquals('home::' . $userId, $homeMount->getId());
}

Expand Down
3 changes: 3 additions & 0 deletions tests/lib/Files/ObjectStore/S3Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

use OC\Files\ObjectStore\S3;

/**
* @group PRIMARY-s3
*/
class S3Test extends ObjectStoreTest {
/**
* @return \OCP\Files\ObjectStore\IObjectStore
Expand Down
17 changes: 17 additions & 0 deletions tests/preseed-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,20 @@
if (substr(strtolower(PHP_OS), 0, 3) === 'win') {
$CONFIG['openssl'] = ['config' => OC::$SERVERROOT . '/tests/data/openssl.cnf'];
}

if (getenv('OBJECT_STORE') === 's3') {
$CONFIG['objectstore'] = [
'class' => 'OC\\Files\\ObjectStore\\S3',
'arguments' => array(
'bucket' => 'nextcloud',
'autocreate' => true,
'key' => 'dummy',
'secret' => 'dummy',
'hostname' => 'localhost',
'port' => 4569,
'use_ssl' => false,
// required for some non amazon s3 implementations
'use_path_style' => true
)
];
}