diff --git a/.github/workflows/files-external-s3.yml b/.github/workflows/files-external-s3.yml index 5148ef079024d..89ddc2e508ea6 100644 --- a/.github/workflows/files-external-s3.yml +++ b/.github/workflows/files-external-s3.yml @@ -45,9 +45,9 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.1', '8.2', '8.4'] include: - - php-versions: '8.2' + - php-versions: '8.3' coverage: ${{ github.event_name != 'pull_request' }} name: php${{ matrix.php-versions }}-s3-minio @@ -88,18 +88,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 " 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 " 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 \ - --log-junit junit.xml \ - ${{ 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 }} @@ -114,6 +115,11 @@ jobs: with: flags: phpunit-files-external-s3 + - name: Nextcloud logs + if: always() + run: | + cat data/nextcloud.log + - name: S3 logs if: always() run: | @@ -128,7 +134,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: ${{ github.event_name != 'pull_request' }} @@ -140,7 +146,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" @@ -167,14 +173,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 " 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 " 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 \ - --log-junit junit.xml \ - ${{ 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 }} diff --git a/apps/files_external/tests/Storage/Amazons3MultiPartTest.php b/apps/files_external/tests/Storage/Amazons3MultiPartTest.php index 93f2d7bf66e98..aa3925899f3c7 100644 --- a/apps/files_external/tests/Storage/Amazons3MultiPartTest.php +++ b/apps/files_external/tests/Storage/Amazons3MultiPartTest.php @@ -13,6 +13,7 @@ * Class Amazons3Test * * @group DB + * @group S3 * * @package OCA\Files_External\Tests\Storage */ @@ -25,7 +26,7 @@ protected function setUp(): void { 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 + [ @@ -45,8 +46,4 @@ protected function tearDown(): void { public function testStat(): void { $this->markTestSkipped('S3 doesn\'t update the parents folder mtime'); } - - public function testHashInFileName(): void { - $this->markTestSkipped('Localstack has a bug with hashes in filename'); - } } diff --git a/apps/files_external/tests/Storage/Amazons3Test.php b/apps/files_external/tests/Storage/Amazons3Test.php index 6d27b0b3253ae..d02dec0230ce8 100644 --- a/apps/files_external/tests/Storage/Amazons3Test.php +++ b/apps/files_external/tests/Storage/Amazons3Test.php @@ -14,11 +14,12 @@ * 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; @@ -26,7 +27,7 @@ protected function setUp(): void { 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); @@ -43,8 +44,4 @@ protected function tearDown(): void { public function testStat(): void { $this->markTestSkipped('S3 doesn\'t update the parents folder mtime'); } - - public function testHashInFileName(): void { - $this->markTestSkipped('Localstack has a bug with hashes in filename'); - } } diff --git a/apps/files_external/tests/Storage/VersionedAmazonS3Test.php b/apps/files_external/tests/Storage/VersionedAmazonS3Test.php index 4d9d1e3206758..9d413620292bf 100644 --- a/apps/files_external/tests/Storage/VersionedAmazonS3Test.php +++ b/apps/files_external/tests/Storage/VersionedAmazonS3Test.php @@ -10,6 +10,7 @@ /** * @group DB + * @group S3 */ class VersionedAmazonS3Test extends Amazons3Test { protected function setUp(): void { @@ -25,4 +26,12 @@ protected function setUp(): void { $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(); + } }