cms
cms copied to clipboard
[5.x]: OperationAbortedException isn't shown during a codeception run, causing much confusion
What happened?
Description
This might be a little niche but it's just cost me an hour of chasing non-existent bugs so even if it's something Google picks up somehow it might be useful.
I'm adding codeception to an existing project. Followed all instructions, but keep getting this sort of error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'craft_test.migrations' doesn't exist
The reason for this error is that the install migration is failing:
https://github.com/craftcms/cms/blob/5.x/src/migrations/Install.php#L77
Because of a schema version mismatch:
Project config validation failed: Craft CMS is Composer-installed with schema version 5.3.0.2, but project.yaml expects 5.0.0.21.
Run `composer install` or remove your `config/project/` folder and try again.
Aborting install.
Obviously this is completely my fault, but would have been good to surface that error and crash out there so I could fix that error.
Steps to reproduce
- Update Craft between versions that cause a schemaVersion change
- Don't update project config
- Try to run tests
Expected behavior
Error about mismatched schemaVersions between project config and installed version
Actual behavior
Error about missing database tables.
Craft CMS version
5.3.2
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response