Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run s3 tests again #27198

Merged
merged 2 commits into from
Jul 5, 2021
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
15 changes: 11 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2117,13 +2117,23 @@ kind: pipeline
name: object-store-s3

steps:
- name: minio
image: ghcr.io/nextcloud/continuous-integration-minio:latest
detach: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to move this to a detached step to properly pass the commands starting the server

commands:
- mkdir /s3data
- minio server /s3data
environment:
MINIO_ROOT_USER: nextcloud
MINIO_ROOT_PASSWORD: nextcloud
- name: submodules
image: ghcr.io/nextcloud/continuous-integration-alpine-git:latest
commands:
- git submodule update --init
- name: object-store
image: ghcr.io/nextcloud/continuous-integration-php7.4:php7.4-3
environment:
OBJECT_STORE: s3
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
commands:
Expand All @@ -2133,10 +2143,6 @@ steps:
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml

services:
- name: fake-s3
image: ghcr.io/nextcloud/continuous-integration-fake-s3:latest

trigger:
branch:
- master
Expand All @@ -2157,6 +2163,7 @@ steps:
- name: object-store
image: ghcr.io/nextcloud/continuous-integration-php7.4:php7.4-3
environment:
OBJECT_STORE: azure
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
commands:
Expand Down
6 changes: 6 additions & 0 deletions tests/drone-wait-objectstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ function get_swift_token() {
fi
}

if [ "$OBJECT_STORE" == "s3" ]; then
echo "Waiting for minio to be ready"
timeout 60 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://minio:9000)" != "403" ]]; do sleep 5; done' || (
echo "Failed to wait for minio to be ready" && exit 1
)
fi
if [ "$OBJECT_STORE" == "swift" ]; then
echo "waiting for keystone"
until get_swift_token
Expand Down
7 changes: 1 addition & 6 deletions tests/lib/Files/ObjectStore/S3Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,14 @@ public function stream_seek($offset, $whence = SEEK_SET) {
class S3Test extends ObjectStoreTest {
protected function getInstance() {
$config = \OC::$server->getConfig()->getSystemValue('objectstore');
if (!is_array($config) || $config['class'] !== 'OC\\Files\\ObjectStore\\S3') {
if (!is_array($config) || $config['class'] !== S3::class) {
$this->markTestSkipped('objectstore not configured for s3');
}

return new S3($config['arguments']);
}

public function testUploadNonSeekable() {
$config = \OC::$server->getConfig()->getSystemValue('objectstore');
if (!is_array($config) || $config['class'] !== 'OC\\Files\\ObjectStore\\S3') {
$this->markTestSkipped('objectstore not configured for s3');
}

$s3 = $this->getInstance();

$s3->writeObject('multiparttest', NonSeekableStream::wrap(fopen(__FILE__, 'r')));
Expand Down
8 changes: 4 additions & 4 deletions tests/preseed-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
'arguments' => [
'bucket' => 'nextcloud',
'autocreate' => true,
'key' => 'dummy',
'secret' => 'dummy',
'hostname' => getenv('DRONE') === 'true' ? 'fake-s3' : 'localhost',
'port' => 4569,
'key' => 'nextcloud',
'secret' => 'nextcloud',
'hostname' => getenv('DRONE') === 'true' ? 'minio' : 'localhost',
'port' => 9000,
'use_ssl' => false,
// required for some non amazon s3 implementations
'use_path_style' => true
Expand Down