diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 4075baeeede..35a0db1e340 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -196,10 +196,14 @@ jobs: fail-fast: false matrix: suite: + - "coreApiAuth,coreApiCapabilities,coreApiFavorites,coreApiMain,coreApiVersions" - "coreApiShareManagementBasicToShares,coreApiShareManagementToShares" - "coreApiSharees,coreApiSharePublicLink2" - "coreApiShareOperationsToShares1,coreApiShareOperationsToShares2,coreApiSharePublicLink1,coreApiShareCreateSpecialToShares1,coreApiShareCreateSpecialToShares2,coreApiShareUpdateToShares" - "coreApiTrashbin,coreApiTrashbinRestore,coreApiWebdavEtagPropagation1,coreApiWebdavEtagPropagation2" + - "coreApiWebdavDelete,coreApiWebdavOperations,coreApiWebdavMove2" + - "coreApiWebdavProperties" + - "coreApiWebdavMove1,coreApiWebdavPreviews,coreApiWebdavUpload,coreApiWebdavUploadTUS" steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 @@ -249,20 +253,13 @@ jobs: EXPECTED_FAILURES_FILE=tests/acceptance/expected-failures-API-on-OCIS-storage.md python3 tests/acceptance/run-github.py - - name: Upload test logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: test-logs-${{ matrix.suite }} - path: tests/acceptance/output/ - litmus: name: litmus needs: [build-and-test] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version-file: go.mod cache: true @@ -274,8 +271,8 @@ jobs: needs: [build-and-test] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version-file: go.mod cache: true @@ -287,8 +284,8 @@ jobs: needs: [build-and-test] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version-file: go.mod cache: true @@ -300,8 +297,8 @@ jobs: needs: [build-and-test] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version-file: go.mod cache: true diff --git a/tests/acceptance/bootstrap/WebDav.php b/tests/acceptance/bootstrap/WebDav.php index c737ea81c79..f565a69fb20 100644 --- a/tests/acceptance/bootstrap/WebDav.php +++ b/tests/acceptance/bootstrap/WebDav.php @@ -4063,10 +4063,46 @@ public function checkImageDimensions(string $width, string $height, ?ResponseInt * @throws Exception */ public function theDownloadedPreviewContentShouldMatchWithFixturesPreviewContentFor(string $filename): void { - $expectedPreview = \file_get_contents(__DIR__ . "/../fixtures/" . $filename); + $fixturePath = __DIR__ . "/../fixtures/" . $filename; + $fixtureImg = \imagecreatefromstring(\file_get_contents($fixturePath)); + Assert::assertNotFalse($fixtureImg, "Could not decode fixture image $filename"); + $this->getResponse()->getBody()->rewind(); $responseBodyContent = $this->getResponse()->getBody()->getContents(); - Assert::assertEquals($expectedPreview, $responseBodyContent); + $responseImg = \imagecreatefromstring($responseBodyContent); + Assert::assertNotFalse($responseImg, "Downloaded preview is not a valid image"); + + $w = \imagesx($fixtureImg); + $h = \imagesy($fixtureImg); + Assert::assertEquals($w, \imagesx($responseImg), "Image width mismatch for fixture $filename"); + Assert::assertEquals($h, \imagesy($responseImg), "Image height mismatch for fixture $filename"); + + $tolerance = 12; // per-channel tolerance for libvips version differences + $maxDiff = 0; + for ($x = 0; $x < $w; $x++) { + for ($y = 0; $y < $h; $y++) { + $fc = \imagecolorat($fixtureImg, $x, $y); + $rc = \imagecolorat($responseImg, $x, $y); + $maxDiff = \max( + $maxDiff, + \abs(($fc >> 16 & 0xFF) - ($rc >> 16 & 0xFF)), + \abs(($fc >> 8 & 0xFF) - ($rc >> 8 & 0xFF)), + \abs(($fc & 0xFF) - ($rc & 0xFF)), + ); + } + } + $rw = \imagesx($responseImg); + $rh = \imagesy($responseImg); + echo " [preview-fixture] $filename: fixture={$w}x{$h} response={$rw}x{$rh} maxPixelDiff=$maxDiff\n"; + + Assert::assertLessThanOrEqual( + $tolerance, + $maxDiff, + "Preview pixel values differ by more than $tolerance from fixture $filename (max diff: $maxDiff)", + ); + + \imagedestroy($fixtureImg); + \imagedestroy($responseImg); } /** diff --git a/tests/acceptance/expected-failures-without-remotephp.md b/tests/acceptance/expected-failures-without-remotephp.md index 357e98a3ba3..f8eccd6f2fb 100644 --- a/tests/acceptance/expected-failures-without-remotephp.md +++ b/tests/acceptance/expected-failures-without-remotephp.md @@ -1,12 +1,4 @@ ## Scenarios that are expected to fail when remote.php is not used -#### [Trying to create .. resource with /webdav root (old dav path) without remote.php returns html](https://github.com/owncloud/ocis/issues/10339) - -- [coreApiWebdavProperties/createFileFolder.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature#L176) -- [coreApiWebdavProperties/createFileFolder.feature:177](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature#L177) -- [coreApiWebdavProperties/createFileFolder.feature:196](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature#L196) -- [coreApiWebdavProperties/createFileFolder.feature:197](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/createFileFolder.feature#L197) -- [coreApiWebdavUploadTUS/uploadFile.feature:177](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUploadTUS/uploadFile.feature#L177) - Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/run-github.py b/tests/acceptance/run-github.py index 16654bd52b7..dd1e25b60fa 100755 --- a/tests/acceptance/run-github.py +++ b/tests/acceptance/run-github.py @@ -355,6 +355,8 @@ def main() -> int: # generate IDP web assets (required for IDP service to start; matches drone ci-node-generate) run(["make", "-C", str(repo_root / "services/idp"), "ci-node-generate"]) + # download web UI assets (required for robots.txt and other static assets; no pnpm needed) + run(["make", "-C", str(repo_root / "services/web"), "ci-node-generate"]) # build (ENABLE_VIPS=true when libvips-dev is installed, matching drone) build_env = {}