From cd730e894a5bfc5b4f2d17ca540386e5afde366e Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 09:38:48 +0200 Subject: [PATCH 01/21] feat: upgrade to Pest v4 and implement testing improvements --- .github/workflows/test-runner.yml | 11 +-- composer.json | 13 ++- package-lock.json | 47 ++++++++++ package.json | 3 + tests/Browser/CountryResourceBrowserTest.php | 48 ++++++++++ tests/Browser/VisualRegressionTest.php | 93 ++++++++++++++++++++ tests/Feature/SmokeTest.php | 90 +++++++++++++++++++ tests/TestCase.php | 5 +- 8 files changed, 301 insertions(+), 9 deletions(-) create mode 100644 tests/Browser/CountryResourceBrowserTest.php create mode 100644 tests/Browser/VisualRegressionTest.php create mode 100644 tests/Feature/SmokeTest.php diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 7c73a73..45a3e94 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest - # Define the matrix of different PHP, Laravel, and testbench versions + # Define the matrix of different PHP, Laravel, testbench versions, and shards strategy: # Fail the whole workflow if one of the jobs fails fail-fast: true @@ -27,6 +27,7 @@ jobs: php: [ 8.2, 8.3, 8.4 ] laravel: [ 11.*, 12.* ] dependency-version: [ prefer-stable ] + shard: [ 1, 2, 3, 4 ] include: # Laravel 12 uses Orchestra Testbench 10 - laravel: 12.* @@ -34,7 +35,7 @@ jobs: # Laravel 11 uses Orchestra Testbench 9 - laravel: 11.* testbench: 9.* - name: PHP ${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }} + name: PHP ${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }} / Shard ${{ matrix.shard }}/4 steps: @@ -61,7 +62,7 @@ jobs: with: php-version: ${{ matrix.php }} coverage: xdebug - # extensions: mbstring, gd, intl + extensions: mbstring, gd, intl, pcntl - name: Install dependencies run: | @@ -69,11 +70,11 @@ jobs: composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction - name: Run test suite - run: composer test -- --coverage-clover ./coverage.xml + run: composer test -- --shard=${{ matrix.shard }}/4 --coverage-clover ./coverage.xml - name: Upload coverage reports to Codecov # Make sure the Codecov action is only executed once - if: matrix.php == '8.2' && matrix.laravel == '12.*' && matrix.dependency-version == 'prefer-stable' + if: matrix.php == '8.2' && matrix.laravel == '12.*' && matrix.dependency-version == 'prefer-stable' && matrix.shard == 1 uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/composer.json b/composer.json index af04be2..37ee2e2 100644 --- a/composer.json +++ b/composer.json @@ -53,8 +53,10 @@ "require-dev": { "laravel/pint": "^1.21", "orchestra/testbench": "^9.9|^10.0", - "pestphp/pest": "^3.7", - "pestphp/pest-plugin-livewire": "^3.0" + "pestphp/pest": "^4.0", + "pestphp/pest-plugin-browser": "^4.0", + "pestphp/pest-plugin-laravel": "^4.0", + "pestphp/pest-plugin-livewire": "^4.0" }, "scripts": { "post-autoload-dump": [ @@ -64,7 +66,12 @@ "post-install-cmd": "@setup", "post-update-cmd": "@setup", "format": "vendor/bin/pint", - "test": "vendor/bin/testbench package:test", + "test": "vendor/bin/testbench package:test --parallel", + "test-shard": "vendor/bin/pest --shard=%SHARD%/%SHARDS%", + "test-shard-1": "vendor/bin/pest --shard=1/4", + "test-shard-2": "vendor/bin/pest --shard=2/4", + "test-shard-3": "vendor/bin/pest --shard=3/4", + "test-shard-4": "vendor/bin/pest --shard=4/4", "clear": "@php vendor/bin/testbench package:purge-skeleton --ansi", "prepare": "@php vendor/bin/testbench package:discover --ansi", "build": "@php vendor/bin/testbench workbench:build --ansi", diff --git a/package-lock.json b/package-lock.json index 0eae449..de0e573 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,9 @@ "requires": true, "packages": { "": { + "dependencies": { + "playwright": "^1.56.1" + }, "devDependencies": { "@commitlint/cli": "^19.7.1", "@commitlint/config-conventional": "^19.7.1", @@ -633,6 +636,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -1042,6 +1059,36 @@ "dev": true, "license": "ISC" }, + "node_modules/playwright": { + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", + "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.56.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", + "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", diff --git a/package.json b/package.json index fc63ee2..fc2c7b3 100644 --- a/package.json +++ b/package.json @@ -8,5 +8,8 @@ "@commitlint/cli": "^19.7.1", "@commitlint/config-conventional": "^19.7.1", "husky": "^9.1.7" + }, + "dependencies": { + "playwright": "^1.56.1" } } diff --git a/tests/Browser/CountryResourceBrowserTest.php b/tests/Browser/CountryResourceBrowserTest.php new file mode 100644 index 0000000..ef760fa --- /dev/null +++ b/tests/Browser/CountryResourceBrowserTest.php @@ -0,0 +1,48 @@ +setUpSuperAdmin(); +}); + +test('can browse country resource page', function () { + $region = Region::factory()->create(['name' => 'Test Region']); + $country = Country::factory()->create([ + 'name' => 'Test Country', + 'id' => 'TC', + 'region_id' => $region->id, + ]); + + $this->visit(CountryResource::getUrl()) + ->assertSee('Countries') + ->assertSee('Test Country') + ->assertSee('TC') + ->assertSee('Test Region'); +}); + +test('can interact with country resource table', function () { + $region = Region::factory()->create(['name' => 'Browser Test Region']); + $country = Country::factory()->create([ + 'name' => 'Browser Test Country', + 'id' => 'BTC', + 'region_id' => $region->id, + ]); + + $this->visit(CountryResource::getUrl()) + ->assertSee('Browser Test Country') + ->assertSee('BTC') + ->assertSee('Browser Test Region') + ->assertSee('Countries'); +}); + +test('country resource page loads without JavaScript errors', function () { + $this->visit(CountryResource::getUrl()) + ->assertSee('Countries') + ->assertDontSee('Uncaught') + ->assertDontSee('ReferenceError') + ->assertDontSee('TypeError') + ->assertDontSee('SyntaxError'); +}); diff --git a/tests/Browser/VisualRegressionTest.php b/tests/Browser/VisualRegressionTest.php new file mode 100644 index 0000000..be670d4 --- /dev/null +++ b/tests/Browser/VisualRegressionTest.php @@ -0,0 +1,93 @@ +setUpSuperAdmin(); +}); + +describe('Visual Regression Tests', function () { + test('country resource page visual regression', function () { + $region = Region::factory()->create(['name' => 'Visual Test Region']); + $country = Country::factory()->create([ + 'name' => 'Visual Test Country', + 'id' => 'VT', + 'a3_id' => 'VTC', + 'num_code' => '999', + 'flag' => '🏳️', + 'region_id' => $region->id, + ]); + + $this->visit(CountryResource::getUrl()) + ->assertSee('Countries') + ->assertSee('Visual Test Country') + ->wait(1) + ->assertScreenshotMatches(); + }); + + test('currency resource page visual regression', function () { + $this->visit(CurrencyResource::getUrl()) + ->assertSee('Currencies') + ->wait(1) + ->assertScreenshotMatches(); + }); + + test('post resource page visual regression', function () { + $this->visit(PostResource::getUrl()) + ->assertSee('Posts') + ->wait(1) + ->assertScreenshotMatches(); + }); + + test('region resource page visual regression', function () { + $this->visit(RegionResource::getUrl()) + ->assertSee('Regions') + ->wait(1) + ->assertScreenshotMatches(); + }); + + test('country resource page with data visual regression', function () { + $region1 = Region::factory()->create(['name' => 'Europe']); + $region2 = Region::factory()->create(['name' => 'Asia']); + + Country::factory()->create([ + 'name' => 'Germany', + 'id' => 'DE', + 'a3_id' => 'DEU', + 'num_code' => '276', + 'flag' => 'πŸ‡©πŸ‡ͺ', + 'region_id' => $region1->id, + ]); + + Country::factory()->create([ + 'name' => 'Japan', + 'id' => 'JP', + 'a3_id' => 'JPN', + 'num_code' => '392', + 'flag' => 'πŸ‡―πŸ‡΅', + 'region_id' => $region2->id, + ]); + + Country::factory()->create([ + 'name' => 'United States', + 'id' => 'US', + 'a3_id' => 'USA', + 'num_code' => '840', + 'flag' => 'πŸ‡ΊπŸ‡Έ', + 'region_id' => $region1->id, + ]); + + $this->visit(CountryResource::getUrl()) + ->assertSee('Countries') + ->assertSee('Germany') + ->assertSee('Japan') + ->assertSee('United States') + ->wait(1) + ->assertScreenshotMatches(); + }); +}); diff --git a/tests/Feature/SmokeTest.php b/tests/Feature/SmokeTest.php new file mode 100644 index 0000000..00dda2f --- /dev/null +++ b/tests/Feature/SmokeTest.php @@ -0,0 +1,90 @@ +setUpSuperAdmin(); +}); + +describe('Smoke Tests', function () { + test('all resource URLs are accessible', function () { + $resources = [ + CountryResource::class, + CurrencyResource::class, + PostResource::class, + RegionResource::class, + ]; + + foreach ($resources as $resource) { + $this->get($resource::getUrl()) + ->assertSuccessful() + ->assertSee('Filament'); + } + }); + + test('country resource URLs are accessible', function () { + $this->get(CountryResource::getUrl()) + ->assertSuccessful() + ->assertSee('Countries') + ->assertSee('Filament'); + }); + + test('currency resource URLs are accessible', function () { + $this->get(CurrencyResource::getUrl()) + ->assertSuccessful() + ->assertSee('Currencies') + ->assertSee('Filament'); + }); + + test('post resource URLs are accessible', function () { + $this->get(PostResource::getUrl()) + ->assertSuccessful() + ->assertSee('Posts') + ->assertSee('Filament'); + }); + + test('region resource URLs are accessible', function () { + $this->get(RegionResource::getUrl()) + ->assertSuccessful() + ->assertSee('Regions') + ->assertSee('Filament'); + }); + + test('all resource URLs return valid HTML', function () { + $resources = [ + CountryResource::class, + CurrencyResource::class, + PostResource::class, + RegionResource::class, + ]; + + foreach ($resources as $resource) { + $response = $this->get($resource::getUrl()); + + $response->assertSuccessful(); + $response->assertHeader('content-type', 'text/html; charset=UTF-8'); + $response->assertSee('', false); + } + }); + + test('all resource URLs have no JavaScript errors', function () { + $resources = [ + CountryResource::class, + CurrencyResource::class, + PostResource::class, + RegionResource::class, + ]; + + foreach ($resources as $resource) { + $response = $this->get($resource::getUrl()); + + $response->assertSuccessful(); + $response->assertDontSee('Uncaught'); + $response->assertDontSee('ReferenceError'); + $response->assertDontSee('TypeError'); + } + }); +}); diff --git a/tests/TestCase.php b/tests/TestCase.php index a6a0767..68cd3be 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -40,7 +40,10 @@ protected function migrate(): self */ protected function setUpSuperAdmin(): self { - $this->superAdmin = User::factory()->create(); + $this->superAdmin = User::factory()->create([ + 'name' => 'Test Super Admin', + 'email' => 'test@example.com', + ]); // Assign super admin role and give all permissions $superAdminRole = \Spatie\Permission\Models\Role::where('name', 'super_admin')->first(); From fa19c594f96069dd3d8ffeb3420bce5deb958e00 Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 12:52:43 +0200 Subject: [PATCH 02/21] ci: upgrade php version --- .github/workflows/test-runner.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 45a3e94..358ae79 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -24,7 +24,7 @@ jobs: # Fail the whole workflow if one of the jobs fails fail-fast: true matrix: - php: [ 8.2, 8.3, 8.4 ] + php: [ 8.3, 8.4 ] laravel: [ 11.*, 12.* ] dependency-version: [ prefer-stable ] shard: [ 1, 2, 3, 4 ] @@ -74,7 +74,7 @@ jobs: - name: Upload coverage reports to Codecov # Make sure the Codecov action is only executed once - if: matrix.php == '8.2' && matrix.laravel == '12.*' && matrix.dependency-version == 'prefer-stable' && matrix.shard == 1 + if: matrix.php == '8.3' && matrix.laravel == '12.*' && matrix.dependency-version == 'prefer-stable' && matrix.shard == 1 uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} From 79f30139de6973228f2d680373432751c0285636 Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:27:42 +0200 Subject: [PATCH 03/21] ci: fix test command --- .github/workflows/test-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 358ae79..97c2482 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -70,7 +70,7 @@ jobs: composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction - name: Run test suite - run: composer test -- --shard=${{ matrix.shard }}/4 --coverage-clover ./coverage.xml + run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --coverage-clover ./coverage.xml - name: Upload coverage reports to Codecov # Make sure the Codecov action is only executed once From 3cedd8b36f080dd90043a2d69d4f6ffd8cd6b43e Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:30:22 +0200 Subject: [PATCH 04/21] ci: add playwright --- .github/workflows/test-runner.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 97c2482..a2a5e41 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -47,6 +47,17 @@ jobs: with: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install and update Playwright + run: | + npm install playwright@latest + npx playwright install + - name: Validate composer.json and composer.lock run: composer validate --strict From 6ca0fa8324a7de0728cfd98582beb3bc8bbaabbd Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:34:37 +0200 Subject: [PATCH 05/21] ci: re-add parallel flag --- .github/workflows/test-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index a2a5e41..59a4f36 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -81,7 +81,7 @@ jobs: composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction - name: Run test suite - run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --coverage-clover ./coverage.xml + run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel --coverage-clover ./coverage.xml - name: Upload coverage reports to Codecov # Make sure the Codecov action is only executed once From f647df5f836e12adc4f436a3fac525fed76993d5 Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:39:17 +0200 Subject: [PATCH 06/21] ci: install dependencies fixes --- .github/workflows/test-runner.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 59a4f36..9f52631 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -77,9 +77,16 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update + composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction + - name: Setup testbench environment + run: | + cp workbench/.env.example workbench/.env + sed -i 's/APP_KEY=/APP_KEY=base64:ZQvPGC7uVADkjOgtGIIuCI8u3\/Pzu+VaRObIbHsgjCc=/' workbench/.env + sed -i 's/APP_ENV=local/APP_ENV=testing/' workbench/.env + - name: Run test suite run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel --coverage-clover ./coverage.xml From ea4d44742e93f14268829cc6353eb34f68cdc63e Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:43:39 +0200 Subject: [PATCH 07/21] ci: fix attempt --- .github/workflows/test-runner.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 9f52631..3ad9918 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -79,13 +79,21 @@ jobs: run: | composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction + composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction --no-scripts - name: Setup testbench environment run: | + # Ensure .env file exists with proper APP_KEY cp workbench/.env.example workbench/.env sed -i 's/APP_KEY=/APP_KEY=base64:ZQvPGC7uVADkjOgtGIIuCI8u3\/Pzu+VaRObIbHsgjCc=/' workbench/.env sed -i 's/APP_ENV=local/APP_ENV=testing/' workbench/.env + # Verify the key was set correctly + grep "APP_KEY=base64:" workbench/.env + # Run the remaining setup steps that composer setup would run + npm install + php vendor/bin/testbench vendor:publish --tag='filament-shield-config' + php vendor/bin/testbench filament:assets + php vendor/bin/testbench package:sync-skeleton - name: Run test suite run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel --coverage-clover ./coverage.xml From def4d2f749a75b92fbd8f1fe6f7e384bb8d85598 Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:47:46 +0200 Subject: [PATCH 08/21] ci: fix attempt #2 --- .github/workflows/test-runner.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 3ad9918..89d0c6f 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -56,7 +56,8 @@ jobs: - name: Install and update Playwright run: | npm install playwright@latest - npx playwright install + npx playwright install --with-deps + export DISPLAY=:99 - name: Validate composer.json and composer.lock run: composer validate --strict @@ -75,6 +76,13 @@ jobs: coverage: xdebug extensions: mbstring, gd, intl, pcntl + - name: Start virtual display + run: | + sudo apt-get update + sudo apt-get install -y xvfb + export DISPLAY=:99 + Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & + - name: Install dependencies run: | composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update @@ -83,13 +91,10 @@ jobs: - name: Setup testbench environment run: | - # Ensure .env file exists with proper APP_KEY cp workbench/.env.example workbench/.env sed -i 's/APP_KEY=/APP_KEY=base64:ZQvPGC7uVADkjOgtGIIuCI8u3\/Pzu+VaRObIbHsgjCc=/' workbench/.env sed -i 's/APP_ENV=local/APP_ENV=testing/' workbench/.env - # Verify the key was set correctly grep "APP_KEY=base64:" workbench/.env - # Run the remaining setup steps that composer setup would run npm install php vendor/bin/testbench vendor:publish --tag='filament-shield-config' php vendor/bin/testbench filament:assets @@ -97,6 +102,10 @@ jobs: - name: Run test suite run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel --coverage-clover ./coverage.xml + env: + BROWSER_HEADLESS: true + BROWSER_SLOW_MO: 100 + BROWSER_TIMEOUT: 30000 - name: Upload coverage reports to Codecov # Make sure the Codecov action is only executed once From 4cf1881a5066fa9e376e9e5d3b1276b8c607345f Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:54:41 +0200 Subject: [PATCH 09/21] ci: remove custom virtual display --- .github/workflows/test-runner.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 89d0c6f..8006b9e 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -57,7 +57,6 @@ jobs: run: | npm install playwright@latest npx playwright install --with-deps - export DISPLAY=:99 - name: Validate composer.json and composer.lock run: composer validate --strict @@ -76,13 +75,6 @@ jobs: coverage: xdebug extensions: mbstring, gd, intl, pcntl - - name: Start virtual display - run: | - sudo apt-get update - sudo apt-get install -y xvfb - export DISPLAY=:99 - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - name: Install dependencies run: | composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update @@ -102,10 +94,6 @@ jobs: - name: Run test suite run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel --coverage-clover ./coverage.xml - env: - BROWSER_HEADLESS: true - BROWSER_SLOW_MO: 100 - BROWSER_TIMEOUT: 30000 - name: Upload coverage reports to Codecov # Make sure the Codecov action is only executed once From 63b2aebf01721cadcb6035c6c1c86c6ce14595ed Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 13:59:16 +0200 Subject: [PATCH 10/21] ci: cache playwright --- .github/workflows/test-runner.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 8006b9e..d69757a 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -53,7 +53,17 @@ jobs: node-version: '20' cache: 'npm' + - name: Cache Playwright browsers + id: playwright-cache + uses: actions/cache@v3 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + playwright-${{ runner.os }}- + - name: Install and update Playwright + if: steps.playwright-cache.outputs.cache-hit != 'true' run: | npm install playwright@latest npx playwright install --with-deps From 8e46a4be81d9f6aec64ae3407a2276e87ec1b643 Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 14:04:01 +0200 Subject: [PATCH 11/21] ci: improve caching --- .github/workflows/test-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index d69757a..2a0369a 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -58,7 +58,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + key: playwright-${{ runner.os }}-latest restore-keys: | playwright-${{ runner.os }}- From 13bd61aa716b142fc09da83d232d5a4324cce95d Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 22 Oct 2025 14:07:39 +0200 Subject: [PATCH 12/21] ci: fix playwright cache checking --- .github/workflows/test-runner.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 2a0369a..a916b73 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -60,13 +60,15 @@ jobs: path: ~/.cache/ms-playwright key: playwright-${{ runner.os }}-latest restore-keys: | + playwright-${{ runner.os }}-latest playwright-${{ runner.os }}- - name: Install and update Playwright - if: steps.playwright-cache.outputs.cache-hit != 'true' run: | - npm install playwright@latest - npx playwright install --with-deps + if [ ! -d ~/.cache/ms-playwright ]; then + npm install playwright@latest + npx playwright install --with-deps + fi - name: Validate composer.json and composer.lock run: composer validate --strict From 2f85d786181acd253ac0f38c311f363ea433a593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Wed, 22 Apr 2026 09:04:46 +0200 Subject: [PATCH 13/21] test: fix content-type header assertion in SmokeTest --- tests/Feature/SmokeTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Feature/SmokeTest.php b/tests/Feature/SmokeTest.php index 00dda2f..ed23abc 100644 --- a/tests/Feature/SmokeTest.php +++ b/tests/Feature/SmokeTest.php @@ -19,6 +19,7 @@ ]; foreach ($resources as $resource) { + /** @noinspection PhpUndefinedMethodInspection */ $this->get($resource::getUrl()) ->assertSuccessful() ->assertSee('Filament'); @@ -62,10 +63,11 @@ ]; foreach ($resources as $resource) { + /** @noinspection PhpUndefinedMethodInspection */ $response = $this->get($resource::getUrl()); $response->assertSuccessful(); - $response->assertHeader('content-type', 'text/html; charset=UTF-8'); + $response->assertHeader('content-type', 'text/html; charset=utf-8'); $response->assertSee('', false); } }); @@ -79,6 +81,7 @@ ]; foreach ($resources as $resource) { + /** @noinspection PhpUndefinedMethodInspection */ $response = $this->get($resource::getUrl()); $response->assertSuccessful(); From 29bdeb350adffa305e70903cbd46a4ff4eb6e4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Wed, 22 Apr 2026 09:25:15 +0200 Subject: [PATCH 14/21] build(npm): update playwright version to 1.59.1 --- package-lock.json | 50 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index b08aa80..78a277b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "playwright": "^1.56.1" + "playwright": "^1.59.1" }, "devDependencies": { "@commitlint/cli": "^19.7.1", @@ -306,13 +306,13 @@ } }, "node_modules/@types/node": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", - "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", + "version": "25.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz", + "integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~7.18.0" + "undici-types": "~7.19.0" } }, "node_modules/ajv": { @@ -514,13 +514,13 @@ } }, "node_modules/cosmiconfig-typescript-loader": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.2.0.tgz", - "integrity": "sha512-GEN39v7TgdxgIoNcdkRE3uiAzQt3UXLyHbRHD6YoL048XAeOomyxaP+Hh/+2C6C2wYjxJ2onhJcsQp+L4YEkVQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.3.0.tgz", + "integrity": "sha512-Akr82WH1Wfqatyiqpj8HDkO2o2KmJRu1FhKfSNJP3K4IdXwHfEyL7MOb62i1AGQVLtIQM+iCE9CGOtrfhR+mmA==", "dev": true, "license": "MIT", "dependencies": { - "jiti": "^2.6.1" + "jiti": "2.6.1" }, "engines": { "node": ">=v18" @@ -1061,12 +1061,12 @@ "license": "ISC" }, "node_modules/playwright": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", - "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", + "version": "1.59.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.1.tgz", + "integrity": "sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw==", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.1" + "playwright-core": "1.59.1" }, "bin": { "playwright": "cli.js" @@ -1079,9 +1079,9 @@ } }, "node_modules/playwright-core": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", - "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", + "version": "1.59.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.1.tgz", + "integrity": "sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg==", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" @@ -1192,9 +1192,9 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.4.tgz", - "integrity": "sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.1.1.tgz", + "integrity": "sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==", "dev": true, "license": "MIT", "engines": { @@ -1202,9 +1202,9 @@ } }, "node_modules/typescript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz", - "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "peer": true, @@ -1217,9 +1217,9 @@ } }, "node_modules/undici-types": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "version": "7.19.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz", + "integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index fc2c7b3..128faf8 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,6 @@ "husky": "^9.1.7" }, "dependencies": { - "playwright": "^1.56.1" + "playwright": "^1.59.1" } } From f8cabab6cc2fe536f6416af8c730e68cfac1683b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Wed, 22 Apr 2026 10:58:24 +0200 Subject: [PATCH 15/21] ci: separate code coverage report to a separate workflow --- .github/workflows/coverage.yml | 97 +++++++++++++++++++++++++++++++ .github/workflows/test-runner.yml | 14 +---- 2 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..5cda85c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,97 @@ +name: Coverage + +on: + # Run testing on all push and pull requests that have committed changes in PHP files + push: + paths: + - '**/*.php' + pull_request: + paths: + - '**/*.php' + # Make it possible to run the workflow manually + workflow_dispatch: + +permissions: + contents: read + +jobs: + coverage: + + runs-on: ubuntu-latest + + name: Code coverage report + + steps: + + #- name: Configure operating system + # run: sudo apt-get update && sudo apt-get install -y locales locales-all + + - name: Checkout code + uses: actions/checkout@v6.0.2 + with: + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Cache Playwright browsers + id: playwright-cache + uses: actions/cache@v3 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-latest + restore-keys: | + playwright-${{ runner.os }}-latest + playwright-${{ runner.os }}- + + - name: Install and update Playwright + run: | + if [ ! -d ~/.cache/ms-playwright ]; then + npm install playwright@latest + npx playwright install --with-deps + fi + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v5.0.5 + with: + path: vendor + key: coverage-${{ hashFiles('**/composer.lock') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + coverage: xdebug + extensions: mbstring, gd, intl, pcntl + + - name: Install dependencies + run: composer update --prefer-dist --no-progress --prefer-stable + + - name: Setup testbench environment + run: | + cp workbench/.env.example workbench/.env + sed -i 's/APP_KEY=/APP_KEY=base64:ZQvPGC7uVADkjOgtGIIuCI8u3\/Pzu+VaRObIbHsgjCc=/' workbench/.env + sed -i 's/APP_ENV=local/APP_ENV=testing/' workbench/.env + grep "APP_KEY=base64:" workbench/.env + npm install + php vendor/bin/testbench vendor:publish --tag='filament-shield-config' + php vendor/bin/testbench filament:assets + php vendor/bin/testbench package:sync-skeleton + + - name: Run test suite with coverage + run: vendor/bin/pest --coverage-clover ./coverage.xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v6.0.0 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: ./coverage.xml + verbose: true diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 7fe1e85..96f687b 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -84,7 +84,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - coverage: xdebug + coverage: none extensions: mbstring, gd, intl, pcntl - name: Install dependencies @@ -105,14 +105,4 @@ jobs: php vendor/bin/testbench package:sync-skeleton - name: Run test suite - run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel --coverage-clover ./coverage.xml - - - name: Upload coverage reports to Codecov - # Make sure the Codecov action is only executed once - if: matrix.php == '8.3' && matrix.laravel == '12.*' && matrix.dependency-version == 'prefer-stable' && matrix.shard == 1 - uses: codecov/codecov-action@v6.0.0 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: ./coverage.xml - verbose: true + run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel From 2872da6bebc9f9d0df9feef54405ec3edaed6431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Wed, 22 Apr 2026 11:17:20 +0200 Subject: [PATCH 16/21] build: remove shard scripts from composer.json --- composer.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/composer.json b/composer.json index c43aaf4..a605532 100644 --- a/composer.json +++ b/composer.json @@ -66,12 +66,7 @@ "post-install-cmd": "@setup", "post-update-cmd": "@setup", "format": "vendor/bin/pint", - "test": "vendor/bin/testbench package:test --parallel", - "test-shard": "vendor/bin/pest --shard=%SHARD%/%SHARDS%", - "test-shard-1": "vendor/bin/pest --shard=1/4", - "test-shard-2": "vendor/bin/pest --shard=2/4", - "test-shard-3": "vendor/bin/pest --shard=3/4", - "test-shard-4": "vendor/bin/pest --shard=4/4", + "test": "vendor/bin/pest --parallel", "clear": "@php vendor/bin/testbench package:purge-skeleton --ansi", "prepare": "@php vendor/bin/testbench package:discover --ansi", "build": "@php vendor/bin/testbench workbench:build --ansi", From 0b1700948dc1e9254b79bb4d48c6b684fde23659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Mon, 27 Apr 2026 10:39:06 +0200 Subject: [PATCH 17/21] ci(tests): add sockets extension and enable `--ci` flag for Pest runs --- .github/workflows/test-runner.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 96f687b..6d2fcbc 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -85,7 +85,7 @@ jobs: with: php-version: ${{ matrix.php }} coverage: none - extensions: mbstring, gd, intl, pcntl + extensions: mbstring, gd, intl, pcntl, sockets - name: Install dependencies run: | @@ -105,4 +105,4 @@ jobs: php vendor/bin/testbench package:sync-skeleton - name: Run test suite - run: vendor/bin/pest --shard=${{ matrix.shard }}/4 --parallel + run: vendor/bin/pest --ci --shard=${{ matrix.shard }}/4 --parallel From 480959778b2d327714b4ab4bdd419140136a3b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Mon, 27 Apr 2026 10:39:52 +0200 Subject: [PATCH 18/21] build: update slimdeluxe/php images to v1.5 and add Playwright dependencies setup --- .lando.dist.yml | 2 +- composer.json | 1 + env/php-8.4/.lando.dist.yml | 2 +- env/php-8.5/.lando.dist.yml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.lando.dist.yml b/.lando.dist.yml index 04e9e45..ef8a196 100644 --- a/.lando.dist.yml +++ b/.lando.dist.yml @@ -14,7 +14,7 @@ services: APP_BASE_PATH: "/app/workbench" TESTBENCH_WORKING_PATH: "/app" overrides: - image: slimdeluxe/php:8.3-v1.4 + image: slimdeluxe/php:8.3-v1.5 platform: linux/amd64 run: - composer install --no-interaction --prefer-dist diff --git a/composer.json b/composer.json index a605532..6dedfa3 100644 --- a/composer.json +++ b/composer.json @@ -79,6 +79,7 @@ "@php -r \"if (!file_exists('workbench/.env')) { copy('workbench/.env.example', 'workbench/.env'); echo '.env file created from .env.example\\n'; }\"", "@php vendor/bin/testbench key:generate --ansi", "npm install", + "npx playwright install --with-deps", "@php vendor/bin/testbench vendor:publish --tag='filament-shield-config'", "@php vendor/bin/testbench vendor:publish --tag='eclipse-common-config'", "@php vendor/bin/testbench filament:assets", diff --git a/env/php-8.4/.lando.dist.yml b/env/php-8.4/.lando.dist.yml index c7a192a..087f5f3 100644 --- a/env/php-8.4/.lando.dist.yml +++ b/env/php-8.4/.lando.dist.yml @@ -5,7 +5,7 @@ services: via: cli app_mount: delegated overrides: - image: slimdeluxe/php:8.4-v1.4 + image: slimdeluxe/php:8.4-v1.5 volumes: # Mount the project root directory to /app - "../..:/app" diff --git a/env/php-8.5/.lando.dist.yml b/env/php-8.5/.lando.dist.yml index e528042..16fd82c 100644 --- a/env/php-8.5/.lando.dist.yml +++ b/env/php-8.5/.lando.dist.yml @@ -5,7 +5,7 @@ services: via: cli app_mount: delegated overrides: - image: slimdeluxe/php:8.5-v1.4 + image: slimdeluxe/php:8.5-v1.5 volumes: # Mount the project root directory to /app - "../..:/app" From 6167fdb0d53bd088b7a87504dfa4e27235ca69f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Mon, 27 Apr 2026 10:40:46 +0200 Subject: [PATCH 19/21] test: add Pest shard timings file for improved test shard balancing --- tests/.pest/shards.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/.pest/shards.json diff --git a/tests/.pest/shards.json b/tests/.pest/shards.json new file mode 100644 index 0000000..a93fc82 --- /dev/null +++ b/tests/.pest/shards.json @@ -0,0 +1,18 @@ +{ + "timings": { + "Tests\\ArchTest": 2.9098, + "Tests\\Browser\\CountryResourceBrowserTest": 7.4148, + "Tests\\Browser\\VisualRegressionTest": 22.8256, + "Tests\\Feature\\CountryResourceTest": 28.9665, + "Tests\\Feature\\CurrencyResourceTest": 21.0076, + "Tests\\Feature\\PostResourceTest": 32.8607, + "Tests\\Feature\\RegionResourceTest": 31.2967, + "Tests\\Feature\\SmokeTest": 17.9596, + "Tests\\Feature\\TariffCodeResourceTest": 24.1813, + "Tests\\Unit\\ImportCountriesJobTest": 6.2526, + "Tests\\Unit\\ImportTariffCodesJobTest": 6.7996, + "Tests\\Unit\\RegionModelTest": 11.5147 + }, + "checksum": "90e926bef7b94d6d2bbc0858cb678632", + "updated_at": "2026-04-27T08:37:20+00:00" +} From d3b5270315d7db7bbc97530077d532fd7439424b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Mon, 27 Apr 2026 14:21:11 +0200 Subject: [PATCH 20/21] ci(tests): add Pest shard timings CI workflow --- .github/workflows/update-shards.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/update-shards.yml diff --git a/.github/workflows/update-shards.yml b/.github/workflows/update-shards.yml new file mode 100644 index 0000000..728a08a --- /dev/null +++ b/.github/workflows/update-shards.yml @@ -0,0 +1,30 @@ +name: Update Shards + +on: + # Run weekly on Monday + schedule: + - cron: '0 0 * * 1' + # Make it possible to run the workflow manually + workflow_dispatch: + +jobs: + update-shards: + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + + - name: Checkout code + uses: actions/checkout@v6.0.2 + + - name: Update shards.json + run: ./vendor/bin/pest --parallel --update-shards + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v7.1.0 + with: + commit_message: "test: update shards.json" From d824845bb7ed53bd5ae16e3149402aea727684c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omer=20=C5=A0abi=C4=87?= Date: Mon, 27 Apr 2026 14:54:27 +0200 Subject: [PATCH 21/21] ci(tests): disable test shard splitting in CI workflow --- .github/workflows/test-runner.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 6d2fcbc..f129d2b 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -27,7 +27,7 @@ jobs: php: [ 8.3, 8.4, 8.5 ] laravel: [ 11.*, 12.* ] dependency-version: [ prefer-stable ] - shard: [ 1, 2, 3, 4 ] + #shard: [ 1, 2, 3, 4 ] include: # Laravel 12 uses Orchestra Testbench 10 - laravel: 12.* @@ -35,7 +35,7 @@ jobs: # Laravel 11 uses Orchestra Testbench 9 - laravel: 11.* testbench: 9.* - name: PHP ${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }} / Shard ${{ matrix.shard }}/4 + name: PHP ${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }} #/ Shard ${{ matrix.shard }}/4 steps: @@ -105,4 +105,5 @@ jobs: php vendor/bin/testbench package:sync-skeleton - name: Run test suite - run: vendor/bin/pest --ci --shard=${{ matrix.shard }}/4 --parallel + #run: vendor/bin/pest --ci --shard=${{ matrix.shard }}/4 --parallel + run: vendor/bin/pest --ci --parallel