Skip to content

Commit 732cf38

Browse files
authored
Merge pull request #27804 from nextcloud/backport/27198/stable20
[stable20] Run s3 tests again
2 parents 4a28b8e + 8da867d commit 732cf38

4 files changed

Lines changed: 22 additions & 10 deletions

File tree

.drone.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,13 +2148,23 @@ kind: pipeline
21482148
name: object-store-s3
21492149

21502150
steps:
2151+
- name: minio
2152+
image: ghcr.io/nextcloud/continuous-integration-minio:latest
2153+
detach: true
2154+
commands:
2155+
- mkdir /s3data
2156+
- minio server /s3data
2157+
environment:
2158+
MINIO_ROOT_USER: nextcloud
2159+
MINIO_ROOT_PASSWORD: nextcloud
21512160
- name: submodules
21522161
image: docker:git
21532162
commands:
21542163
- git submodule update --init
21552164
- name: object-store
21562165
image: nextcloudci/php7.4:latest
21572166
environment:
2167+
OBJECT_STORE: s3
21582168
CODECOV_TOKEN:
21592169
from_secret: CODECOV_TOKEN
21602170
commands:
@@ -2188,6 +2198,7 @@ steps:
21882198
- name: object-store
21892199
image: nextcloudci/php7.4:latest
21902200
environment:
2201+
OBJECT_STORE: azure
21912202
CODECOV_TOKEN:
21922203
from_secret: CODECOV_TOKEN
21932204
commands:

tests/drone-wait-objectstore.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ function get_swift_token() {
1212
fi
1313
}
1414

15+
if [ "$OBJECT_STORE" == "s3" ]; then
16+
echo "Waiting for minio to be ready"
17+
timeout 60 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://minio:9000)" != "403" ]]; do sleep 5; done' || (
18+
echo "Failed to wait for minio to be ready" && exit 1
19+
)
20+
fi
1521
if [ "$OBJECT_STORE" == "swift" ]; then
1622
echo "waiting for keystone"
1723
until get_swift_token

tests/lib/Files/ObjectStore/S3Test.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,14 @@ public function stream_seek($offset, $whence = SEEK_SET) {
6262
class S3Test extends ObjectStoreTest {
6363
protected function getInstance() {
6464
$config = \OC::$server->getConfig()->getSystemValue('objectstore');
65-
if (!is_array($config) || $config['class'] !== 'OC\\Files\\ObjectStore\\S3') {
65+
if (!is_array($config) || $config['class'] !== S3::class) {
6666
$this->markTestSkipped('objectstore not configured for s3');
6767
}
6868

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

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

8075
$s3->writeObject('multiparttest', NonSeekableStream::wrap(fopen(__FILE__, 'r')));

tests/preseed-config.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
'arguments' => [
2626
'bucket' => 'nextcloud',
2727
'autocreate' => true,
28-
'key' => 'dummy',
29-
'secret' => 'dummy',
30-
'hostname' => getenv('DRONE') === 'true' ? 'fake-s3' : 'localhost',
31-
'port' => 4569,
28+
'key' => 'nextcloud',
29+
'secret' => 'nextcloud',
30+
'hostname' => getenv('DRONE') === 'true' ? 'minio' : 'localhost',
31+
'port' => 9000,
3232
'use_ssl' => false,
3333
// required for some non amazon s3 implementations
3434
'use_path_style' => true

0 commit comments

Comments
 (0)