Skip to content

test: migrate the tests to cycle/testing - #11

Merged
roxblnfk merged 8 commits into
1.xfrom
test/testo
Nov 20, 2026
Merged

roxblnfk merged 8 commits into
1.xfrom
test/testo

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • Tests run on the shared cycle/testing harness (^0.1.1, from its VCS repository until it reaches Packagist): testo.php is built on Cycle\Testing\Config with a Unit suite and one Acceptance/<Driver> suite per driver, each with an in-memory SQLite secondary database and the ORM plugin.
  • The acceptance scenarios live in one tests/Acceptance/Common/TransactionTest that cycle/testing runs against every driver.
  • Composer scripts: test:<driver> runs that driver's suites, db:up / db:down start and stop the databases from the cycle/testing compose file. Infection runs the Unit suite.
  • CI: .github/workflows/testing.yml calls the shared cycle/gh-actions Testo 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 with DB_REQUIRED=1, so an unreachable database fails the job instead of skipping; coverage goes to Codecov with one flag per suite. It replaces testing.yml (Unit, coverage) and ci-sqlite.yml, ci-mysql.yml, ci-pgsql.yml, ci-mssql.yml. Composer runs with --ignore-platform-req=php+: yiisoft/di (used by the Yii3 config test) declares PHP up to 8.5, so PHP 8.6 cannot resolve without dropping that upper bound.
Suite PHPUnit-era baseline (own Testo harness) Now
Unit 62 tests, 74 assertions 62 tests, 74 assertions
Acceptance SQLite 17 tests 17 tests
Acceptance MySQL / Postgres / SQLServer 17 each, not run at baseline 17 each
  • Deleted: the per-driver test subclasses under tests/Acceptance/Driver, BaseTestCase, tests/docker-compose.yml, the hand-written database wait loops and connection env in CI, and the test:acceptance, test:integration and test:no-driver scripts.
  • Deliberate difference: drivers are selected by suite (--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 per-repo copies.

Checklist

  • Tested
    • Unit and SQLite suites run locally
    • MySQL, Postgres and SQLServer suites run in CI
    • Unit tests added

testo.php keeps driving the composer scripts and CI until the suites move over; testo.cycle.php is the cycle/testing config they move to.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
cycle/testing runs one Common test class against every driver, so the per-driver subclasses, BaseTestCase and the local docker-compose file have no job left.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk requested a review from a team November 20, 2026 11:48
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d8c98b2) to head (0d667a5).

Additional details and impacted files
@@             Coverage Diff             @@
##              1.x       #11      +/-   ##
===========================================
+ Coverage   96.15%   100.00%   +3.84%     
===========================================
  Files           8         5       -3     
  Lines          78        75       -3     
===========================================
  Hits           75        75              
+ Misses          3         0       -3     
Flag Coverage Δ
mysql 40.00% <ø> (?)
postgres 40.00% <ø> (?)
sqlite 40.00% <ø> (?)
sqlserver 40.00% <ø> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
yiisoft/di, used by the Yii3 config test, declares php 8.1 - 8.5 even on master, so composer cannot resolve on PHP 8.6.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk merged commit 106e20a into 1.x Nov 20, 2026
22 checks passed
@roxblnfk
roxblnfk deleted the test/testo branch November 20, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant