mirror of
https://github.com/nextcloud/server.git
synced 2026-05-26 03:04:35 -04:00
Merge pull request #53424 from nextcloud/backport/53378/stable30
[stable30] test: run all files_external tests for S3
This commit is contained in:
commit
b9b0b573d9
4 changed files with 32 additions and 26 deletions
33
.github/workflows/files-external-s3.yml
vendored
33
.github/workflows/files-external-s3.yml
vendored
|
|
@ -44,9 +44,9 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['8.1', '8.2', '8.3']
|
||||
php-versions: ['8.1', '8.2']
|
||||
include:
|
||||
- php-versions: '8.2'
|
||||
- php-versions: '8.3'
|
||||
coverage: ${{ github.event_name != 'pull_request' }}
|
||||
|
||||
name: php${{ matrix.php-versions }}-s3
|
||||
|
|
@ -87,18 +87,19 @@ jobs:
|
|||
composer install
|
||||
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
|
||||
./occ app:enable --force files_external
|
||||
echo "<?php return ['run' => true, 'secret' => 'actually-not-secret', 'passwordsalt' => 'actually-not-secret', 'hostname' => 'localhost','key' => '$OBJECT_STORE_KEY','secret' => '$OBJECT_STORE_SECRET', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/files_external/tests/config.amazons3.php
|
||||
echo "<?php return ['run' => true, 'minio' => true, 'secret' => 'actually-not-secret', 'passwordsalt' => 'actually-not-secret', 'hostname' => 'localhost','key' => '$OBJECT_STORE_KEY','secret' => '$OBJECT_STORE_SECRET', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/files_external/tests/config.amazons3.php
|
||||
|
||||
- name: Wait for S3
|
||||
run: |
|
||||
sleep 10
|
||||
curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready
|
||||
|
||||
- name: PHPUnit
|
||||
run: composer run test:files_external -- \
|
||||
apps/files_external/tests/Storage/Amazons3Test.php \
|
||||
apps/files_external/tests/Storage/VersionedAmazonS3Test.php \
|
||||
${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
|
||||
run: |
|
||||
composer run test:files_external -- \
|
||||
--group S3 \
|
||||
--log-junit junit.xml \
|
||||
apps/files_external/tests/Storage \
|
||||
${{ matrix.coverage && '--coverage-clover ./clover.xml' || '' }}
|
||||
|
||||
- name: Upload code coverage
|
||||
if: ${{ !cancelled() && matrix.coverage }}
|
||||
|
|
@ -121,7 +122,7 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['8.1', '8.2', '8.3']
|
||||
php-versions: ['8.1', '8.2', '8.4']
|
||||
include:
|
||||
- php-versions: '8.3'
|
||||
coverage: true
|
||||
|
|
@ -133,7 +134,7 @@ jobs:
|
|||
env:
|
||||
SERVICES: s3
|
||||
DEBUG: 1
|
||||
image: localstack/localstack@sha256:b52c16663c70b7234f217cb993a339b46686e30a1a5d9279cb5feeb2202f837c # v4.4.0
|
||||
image: localstack/localstack@sha256:9d4253786e0effe974d77fe3c390358391a56090a4fff83b4600d8a64404d95d # v4.5.0
|
||||
ports:
|
||||
- "4566:4566"
|
||||
|
||||
|
|
@ -160,13 +161,15 @@ jobs:
|
|||
composer install
|
||||
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
|
||||
./occ app:enable --force files_external
|
||||
echo "<?php return ['run' => true,'hostname' => 'localhost','key' => 'ignored','secret' => 'ignored', 'bucket' => 'bucket', 'port' => 4566, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/files_external/tests/config.amazons3.php
|
||||
echo "<?php return ['run' => true, 'localstack' => true, 'hostname' => 'localhost','key' => 'ignored','secret' => 'ignored', 'bucket' => 'bucket', 'port' => 4566, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/files_external/tests/config.amazons3.php
|
||||
|
||||
- name: PHPUnit
|
||||
run: composer run test:files_external -- \
|
||||
apps/files_external/tests/Storage/Amazons3Test.php \
|
||||
apps/files_external/tests/Storage/VersionedAmazonS3Test.php \
|
||||
${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
|
||||
run: |
|
||||
composer run test:files_external -- \
|
||||
--group S3 \
|
||||
--log-junit junit.xml \
|
||||
apps/files_external/tests/Storage \
|
||||
${{ matrix.coverage && '--coverage-clover ./clover.xml' || '' }}
|
||||
|
||||
- name: Upload code coverage
|
||||
if: ${{ !cancelled() && matrix.coverage }}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ use OCA\Files_External\Lib\Storage\AmazonS3;
|
|||
* Class Amazons3Test
|
||||
*
|
||||
* @group DB
|
||||
* @group S3
|
||||
*
|
||||
* @package OCA\Files_External\Tests\Storage
|
||||
*/
|
||||
|
|
@ -24,7 +25,7 @@ class Amazons3MultiPartTest extends \Test\Files\Storage\Storage {
|
|||
parent::setUp();
|
||||
|
||||
$this->config = include('files_external/tests/config.amazons3.php');
|
||||
if (! is_array($this->config) or ! $this->config['run']) {
|
||||
if (!is_array($this->config) || !$this->config['run']) {
|
||||
$this->markTestSkipped('AmazonS3 backend not configured');
|
||||
}
|
||||
$this->instance = new AmazonS3($this->config + [
|
||||
|
|
@ -44,8 +45,4 @@ class Amazons3MultiPartTest extends \Test\Files\Storage\Storage {
|
|||
public function testStat() {
|
||||
$this->markTestSkipped('S3 doesn\'t update the parents folder mtime');
|
||||
}
|
||||
|
||||
public function testHashInFileName() {
|
||||
$this->markTestSkipped('Localstack has a bug with hashes in filename');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,12 @@ use OCA\Files_External\Lib\Storage\AmazonS3;
|
|||
* Class Amazons3Test
|
||||
*
|
||||
* @group DB
|
||||
* @group S3
|
||||
*
|
||||
* @package OCA\Files_External\Tests\Storage
|
||||
*/
|
||||
class Amazons3Test extends \Test\Files\Storage\Storage {
|
||||
private $config;
|
||||
protected $config;
|
||||
/** @var AmazonS3 */
|
||||
protected $instance;
|
||||
|
||||
|
|
@ -25,7 +26,7 @@ class Amazons3Test extends \Test\Files\Storage\Storage {
|
|||
parent::setUp();
|
||||
|
||||
$this->config = include('files_external/tests/config.amazons3.php');
|
||||
if (! is_array($this->config) or ! $this->config['run']) {
|
||||
if (!is_array($this->config) || !$this->config['run']) {
|
||||
$this->markTestSkipped('AmazonS3 backend not configured');
|
||||
}
|
||||
$this->instance = new AmazonS3($this->config);
|
||||
|
|
@ -42,8 +43,4 @@ class Amazons3Test extends \Test\Files\Storage\Storage {
|
|||
public function testStat() {
|
||||
$this->markTestSkipped('S3 doesn\'t update the parents folder mtime');
|
||||
}
|
||||
|
||||
public function testHashInFileName() {
|
||||
$this->markTestSkipped('Localstack has a bug with hashes in filename');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ namespace OCA\Files_External\Tests\Storage;
|
|||
|
||||
/**
|
||||
* @group DB
|
||||
* @group S3
|
||||
*/
|
||||
class VersionedAmazonS3Test extends Amazons3Test {
|
||||
protected function setUp(): void {
|
||||
|
|
@ -25,4 +26,12 @@ class VersionedAmazonS3Test extends Amazons3Test {
|
|||
$this->markTestSkipped("s3 backend doesn't seem to support versioning");
|
||||
}
|
||||
}
|
||||
|
||||
public function testCopyOverWriteDirectory(): void {
|
||||
if (isset($this->config['minio'])) {
|
||||
$this->markTestSkipped('MinIO has a bug with batch deletion on versioned storages, see https://github.com/minio/minio/issues/21366');
|
||||
}
|
||||
|
||||
parent::testCopyOverWriteDirectory();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue