cms icon indicating copy to clipboard operation
cms copied to clipboard

[5.x]: OperationAbortedException isn't shown during a codeception run, causing much confusion

Open jaspertandy opened this issue 6 months ago • 1 comments

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

  1. Update Craft between versions that cause a schemaVersion change
  2. Don't update project config
  3. 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

Installed plugins and versions

jaspertandy avatar Aug 12 '24 10:08 jaspertandy