Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add MySQL e2e tests #332

Closed
michaelbromley opened this issue May 6, 2020 · 3 comments
Closed

CI: Add MySQL e2e tests #332

michaelbromley opened this issue May 6, 2020 · 3 comments
Labels
blocked 🚧 Resolution is blocked by some other issue or external factor type: chore 🧤 Not related to production code (build tasks, dependencies etc)
Milestone

Comments

@michaelbromley
Copy link
Member

We have e2e tests in CI using SQLite, Postgres and MariaDB. However, we need to add MySQL. Even though MariaDB is supposed to be a drop-in replacement, there are some differences which lead to issues like #331

@michaelbromley michaelbromley added the type: chore 🧤 Not related to production code (build tasks, dependencies etc) label May 6, 2020
@michaelbromley michaelbromley added this to the v0.12.0 milestone May 7, 2020
@michaelbromley
Copy link
Member Author

This is currently proving problematic due to bugs in TypeORM's schema sync code. With MySQL, TypeORM attempts to re-create certain foreign key constraints every time, resulting in:

error 5/7/20, 14:14 - [TypeORM] Query error: Error: ER_FK_DUP_NAME: Duplicate foreign key
   constraint name 'FK_0e6f516053cf982b537836e21cf', "ALTER TABLE `product_variant` ADD
   CONSTRAINT `FK_0e6f516053cf982b537836e21cf` FOREIGN KEY (`featuredAssetId`) REFERENCES
   `asset`(`id`) ON DELETE NO ACTION ON UPDATE NO ACTION" -- [undefined] 

This means that the e2e tests cannot run. There are numerous issues on the TypeORM repo relating to schema sync.

It is something Vendure users also run into on doing routine schema migrations - lots of unnecessary migration code. I am tempted to dive in and try to fix it myself upstream...

@michaelbromley michaelbromley removed this from the v0.12.0 milestone May 7, 2020
@michaelbromley
Copy link
Member Author

See #333 for a deeper analysis of the problems here.

@michaelbromley michaelbromley added the blocked 🚧 Resolution is blocked by some other issue or external factor label Jul 2, 2020
michaelbromley added a commit that referenced this issue Aug 31, 2020
@michaelbromley michaelbromley added this to the v0.15.1 milestone Sep 1, 2020
@michaelbromley
Copy link
Member Author

Got this working at last with 136b3e9! And it was good to put in the effort as I found a couple of compatibility issues where MySQL does not work the same as MariaDB that needed fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked 🚧 Resolution is blocked by some other issue or external factor type: chore 🧤 Not related to production code (build tasks, dependencies etc)
Projects
None yet
Development

No branches or pull requests

1 participant