-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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: Set up testing for all supported databases #207
Comments
@michaelbromley thank you, really appreciate it. In the meantime, is there anything i can do on my side to get rid of this error? #206 |
@rrubio I'll release a patch (v0.6.1) today that includes the fix for that. |
@michaelbromley you rock! thank you man! |
https://github.com/vendure-ecommerce/vendure/blob/master/CHANGELOG.md#061-2019-11-18 Boom! Whaddya call that for service?!? 😇😆 |
AWESOME!!!! thank you so much! |
Relates to #207. This change decouples the TestServer from the underlying database, allowing custom TestDbInitializers to be created for other TypeORM-supported DBs. BREAKING CHANGE: The `@vendure/testing` package now requires you to explicitly register initializers for the databases you with to test against. This change enables e2e tests to be run against any database supported by TypeORM. The `dataDir` option has been removed from the call to the `TestServer.init()` method, as it is specific to the SqljsInitializer: before: ```TypeScript import { createTestEnvironment, testConfig } from '@vendure/testing'; describe('my e2e test suite', () => { const { server, adminClient } = createTestEnvironment(testConfig); beforeAll(() => { await server.init({ dataDir: path.join(__dirname, '__data__'), initialData, productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'), customerCount: 1, }); }); //... }); ``` after: ```TypeScript import { createTestEnvironment, registerInitializer, SqljsInitializer, testConfig } from '@vendure/testing'; registerInitializer('sqljs', new SqljsInitializer(path.join(__dirname, '__data__'))); describe('my e2e test suite', () => { const { server, adminClient } = createTestEnvironment(testConfig); beforeAll(() => { await server.init({ initialData, productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'), customerCount: 1, }); }); //... }); ```
Currently in CI we run e2e tests against sql.js (SQLite). Generally, due to the use of the TypeORM layer, this means that things should work fine in the other supported database, namely mysql & postgres.
However, there is some DB-specific code (e.g. in the DefaultSearchPlugin) which has caused a couple of issues by being untested (e.g. #206).
It would be better to run all e2e tests against each database. This would require some re-working on the
@vendure/testing
package to allow other DBs to be used.The text was updated successfully, but these errors were encountered: