Repository navigation
test: migrate the tests to cycle/testing - #61
Merged
Merged
Conversation
testo.php stays in charge for now: the current tests depend on its custom plugin in tests/Acceptance/Testo, so testo.cycle.php only stages the cycle/testing config they move to. Assisted-By: Claude Opus 5.5 <[email protected]>
cycle/testing provides the database plugin, transaction isolation and the per-driver run that tests/Acceptance/Testo implemented locally; tests/Stub/OrmEnvironment keeps only what is specific to this package (entities, seed, behaviour-aware ORM, Facade binding) and plugs into the harness hooks. Assisted-By: Claude Opus 5.5 <[email protected]>
The package compose file waits for the database itself, which replaces the hand-written wait loops; DB_REQUIRED=1 makes an unreachable database fail the job instead of skipping its tests. test:pgsql becomes test:postgres to match the suite names. Assisted-By: Claude Opus 5.5 <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #61 +/- ##
==========================================
+ Coverage 93.26% 95.00% +1.73%
==========================================
Files 12 10 -2
Lines 104 100 -4
==========================================
- Hits 97 95 -2
+ Misses 7 5 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The Testo bridge of Infection passes testFrameworkOptions as one argument, so two --suite options in it select no suite at all. Assisted-By: Claude Opus 5.5 <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
The failed INSERT ... RETURNING stays in the prepared statement cache of cycle/database without a reset, and on SQLite the next user insert of the suite fails with "21 bad parameter or other API misuse": the 8 SQLite errors on PHP 8.2 and 8.3 in CI and on every local build. The cache should be fixed in cycle/database; this keeps the suite independent of test order until then. Assisted-By: Claude Opus 5.5 <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
… is fixed The failed insert stays unreset in the statement cache of cycle/database and breaks the next user insert on SQLite. Skipping the one test that triggers it keeps the SQLite suite running and reports the skip with the issue link, instead of clearing the cache from the test. Assisted-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
^0.1.1, from its VCS repository until it reaches Packagist):testo.phpis built onCycle\Testing\Configwith aUnitsuite and oneAcceptance/<Driver>suite per driver, with transaction isolation and an in-memory SQLitesecondarydatabase.tests/Stub/OrmEnvironmentkeeps only what is specific to this package (entities, seed, behaviour-aware ORM, Facade binding) and plugs into the harness hooks; Unit tests take their ORM fromCycle\Testing\ORM\Memory. The acceptance scenarios live in onetests/Acceptance/Common/ActiveRecordTest.test:<driver>runs that driver's suites (test:pgsqlis nowtest:postgres),db:up/db:downstart and stop the databases from the cycle/testing compose file. Infection runsUnitandAcceptance/SQLite..github/workflows/testing.ymlcalls the sharedcycle/gh-actionsTesto workflow with coverage on. Unit and SQLite run on PHP 8.2–8.6 with highest dependencies and on 8.2 with lowest; MySQL, Postgres and SQLServer run on PHP 8.2 and 8.6 (highest, plus lowest on 8.2); every job runs withDB_REQUIRED=1, so an unreachable database fails the job instead of skipping; coverage goes to Codecov with one flag per suite. It replaces the Unit and coverage jobs oftesting.ymlandtesting-mysql.yml,testing-pgsql.yml,testing-sqlserver.yml.saveOrFailThrowsOnUniqueViolationleaves its failed insert in the prepared statement cache of cycle/database without a reset, and the next user insert fails withSQLSTATE[HY000]: General error: 21 bad parameter or other API misuse(cycle/database#131). That test is skipped on SQLite with a link to the issue until it is fixed; it still runs on MySQL, Postgres and SQLServer.tests/Acceptance/Testo(database plugin, interceptor, connection pool,WithoutTransaction), the per-driver subclasses,BaseTestCase,tests/docker-compose.yml, the CI wait loops and connection env, and thetest:acceptance,test:no-driverandtest:pgsqlscripts.--suite=Acceptance/MySQL) instead of--group=driver-*.Why?
One harness for all Cycle packages: databases, driver matrix and isolation come from cycle/testing instead of a per-repo copy.
Checklist