Repository navigation
Improve CI test discovery, parallel checks, and dependency updates - #752
Conversation
Report a Double factory call when the test can use the double before choosing strict or passthru mode. Follow chained factories, conditional results and split setup in the same statement list. Configuring expectations before selecting a mode is valid. Exercise these cases in a rule fixture, including reassignments, conditional mode changes and first-class callables. Leave registration to the test analysis configuration so consumers can opt in independently.
Add a dedicated test analysis configuration and result cache, and include the command in the local analyse script. Exclude inputs that exercise PHPStan itself while keeping the executable analyzer tests in scope. Use identifier-specific ignores in the two tests that deliberately accept unrelated calls. Their existing explanations now sit next to the diagnostic they suppress.
Show packages how to enable the rule in a test configuration and document intentional leniency at the factory call. Point contributors to the test-only Composer command and distinguish it from normal source analysis. Align the documented PHPStan minimum with the package requirement of 2.3.6.
The root package replaces hypervel/support with its own version. On a feature branch Composer reports a dev branch name, which supports equality but does not satisfy ordered constraints against itself. Keep the replaced-package equality checks and exercise the ordering operators against the exact numeric version of psr/clock-implementation. The existing cases for wildcard and union constraints still run.
Give the path repository the 0.4.x-dev version required by the sample package. Otherwise a feature branch takes precedence over Packagist but has a dev branch name that cannot satisfy the requirement. This follows the AI and MCP samples and lets a clean install exercise the current checkout.
Run the framework and Permission suites independently of the PHPStan, Testbench and sample package suites. Share the PHP 8.4 and 8.5 matrix so both groups exercise the same runtimes. Run the code style and skeleton configuration checks once on PHP 8.4. They use the same inputs on both versions and no longer delay the runtime tests.
Add phpstan.tests.neon.dist to the existing PHP 8.4 configuration matrix. This applies the test-authoring rule to the same source once, while the PHPStan extension’s PHPUnit suite runs on both supported PHP versions.
Move the exact commits for the ten external actions used across our twenty workflows into GitHub's native actions.lock. Use the corresponding release tags in workflow files so version changes are easy to review. Dependabot can update those tags and their pins in the same grouped PR under the existing weekly schedule and five-day cooldown. Verify the lockfile on every pull request and on pushes to 0.4 in a single read-only job outside the PHP matrix. This catches missing pins when a workflow is added, even if another workflow already uses the same action. Install a pinned version of the verifier so the check itself uses a known release.
Run tests/Integration/<Package>/Redis in the Redis, Valkey and Redis Cluster jobs so adding a package suite no longer requires editing three lists. Redis and Valkey share the standalone ParaTest command with its 15-worker cap. Cluster uses serial PHPUnit because its tests share database zero. Keep the whole Cache, Horizon and Queue suites and their existing driver settings. Run Permission with the Redis cache store on both standalone backends, closing a gap in the Valkey job. Keep the narrower core Redis selection for Cluster. Move the three Reverb tests that need only Redis into Reverb/Redis. This adds shared-state and webhook-buffer coverage on Valkey while preserving the dedicated Reverb workflow and the clear-state command's Cluster skip. Document the directory convention and how to run filtered suites locally.
Run tests directly under each package's Database directory on MySQL, MariaDB, PostgreSQL and SQLite. Pair the shared PHPUnit suite with the matching driver suite in one ParaTest invocation so files can run in parallel across packages. Keep the existing default PHPUnit suite for ordinary framework runs. Replace driver wrappers that only inherited the same assertions with concrete package tests. Keep method-level requirements for driver-specific assertions and separate SQLite subclasses where the tests require a file-backed database or a controlled clock. Keep the NestedSet tree suites gated on MySQL 8 for their window functions. Run the schema tests on MySQL 5.7 as well, since they only exercise columns and indexes. All five schema tests passed on MySQL 5.7.44. Compared discovery against the previous selections for all four drivers and ran focused suites on MariaDB, PostgreSQL and SQLite.
Show where shared database tests, driver-specific tests, and Redis tests belong. Keeping shared assertions in one concrete class avoids creating empty subclasses for each driver. Clarify that suites outside these conventions need registration in their workflow or its runner. Remove the blanket instruction to edit a workflow for every new directory.
Give newly published releases three days before the Components development checkout, new Hypervel applications, and standalone dogfood projects can resolve them. This matches the pnpm minimum release age. Each project sets the policy in its own root manifest because Composer ignores configuration supplied by dependencies. Pull the latest stable Composer binary when building the CI image. The base image ships Composer 2.10.3, which accepts the configuration but does not enforce the cooldown. The existing weekly image rebuild keeps the tool current without updating it in each test job.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
@coderabbitai review |
Action not completed
|
PR Summary by QodoDiscover shared integration tests and parallelize CI checks
AI Description
Merge Risk
|
Code Review by Qodo
1. Database jobs cannot find package tests
|
[Medium impact] The reviewed changes appear safe to merge. SummaryThis PR improves service test discovery, splits CI checks, and adds safeguards for dependency updates.
No new actionable issues were found in the changes since the previous review. The earlier call-argument finding remains fixed. Reviews (3) · Last reviewed commit: "Recognize Double mode selection in array..." · Reviewed by Greptile |
Tests can set expectations on a double and then pass it to a collaborator by calling strict() or passthru() in an argument. Recognize those calls when PHP evaluates them before handing the double to the collaborator. Keep reporting cases where another call can use the double first or a conditional expression can skip mode selection. Cover constructor injection, a prior method call, and short-circuiting in the rule fixture.
|
I checked both findings. PHPUnit expands the directory patterns in this project. Listing the MariaDB suite includes the shared Auth tests and the MariaDB-specific Pennant tests, and the database jobs ran successfully with those patterns. The Composer tag is intentional. We want CI image rebuilds to pick up stable Composer releases automatically. The image build prints the chosen version, and subsequent jobs use the copy in that image. |
A test helper can set expectations on a double and return it in an array by calling strict() on the array item. PHP evaluates the item before returning the array, so the double already has a mode when the caller receives it. Reuse the existing expression check for array values and cover the helper pattern in the rule fixture. The checks for prior use and conditional mode selection still apply.
Test discovery
A package test that needed to run on every database used to need a subclass in each driver's directory. Now a single test in
tests/Integration/{Package}/Database/runs on MySQL, MariaDB, PostgreSQL, and SQLite. Tests in a driver subdirectory still run on that driver. The database job selects both sets in one ParaTest run. The NestedSet schema tests also run on MySQL 5.7. The tree tests that use window functions still require MySQL 8.Redis, Valkey, and Redis Cluster now discover
tests/Integration/{Package}/Redis/the same way. Redis and Valkey share a runner, which also picks up the Permission and Reverb coverage that Valkey was missing. Cluster runs serially because its tests share database zero.CI and static analysis
Framework tests and package tests can now run in parallel jobs on each supported PHP version. Code style and skeleton configuration run once. The Testbench sample package also resolves the local checkout when CI runs on a feature branch.
composer analyse:testschecks that a test choosesstrict()orpassthru()before using a Double. A test that intentionally relies on lenient behavior can say why at the call site. The rule runs in its own static analysis job and is opt-in for users of the PHPStan package.Dependency updates
The workflows use GitHub's native Actions lockfile. The migration preserves the action commits we already use, while letting the workflow files refer to readable release tags. A separate check verifies the lockfile on pull requests and pushes to
0.4. Dependabot updates the tags and lockfile together.Components, the application skeleton, and the standalone dogfood projects now wait three days before resolving a newly published Composer release, matching our pnpm policy. Installs from an existing lockfile keep their recorded versions. The CI image pulls the latest stable Composer at build time so fresh installs honor the policy.
Verification
Compared database and Redis test discovery with the previous workflows and ran the affected suites against the supported backends. Verified the Actions lockfile, checked that a missing workflow entry fails verification, and tested fresh Composer resolution for each project that sets the cooldown.
Note
Split CI jobs into parallel matrices and add test-only PHPStan rule
RequireExplicitDoubleModeRule, a PHPStan rule that reportsDouble::forfactories without an explicitstrict()orpassthru()mode, wired through the new phpstan.tests.neon.dist config andcomposer analyse:testsDatabasedirectory, withRequiresDatabaseattributes declaring MySQL, MariaDB, and PostgreSQL coverage; PHPUnit gains a default suite and driver-specificmysql,mariadb,pgsql, andsqlitesuites in phpunit.xml.distpolicy.cooldown.periodto Composer configs and pins Composer 2.11+ in the CI Docker imageMacroscope summarized e4c1c3b.