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

FixtureRollback vs @magentoDbIsolation #29

Open
bartoszkubicki opened this issue Oct 3, 2019 · 1 comment
Open

FixtureRollback vs @magentoDbIsolation #29

bartoszkubicki opened this issue Oct 3, 2019 · 1 comment

Comments

@bartoszkubicki
Copy link
Contributor

First of all many thank for this awesome library - today I was able to setup scenario for reordering single order item within 15 minutes, while using your library for the first time!

I have a question though, about FixtureRollback classes and mentioned annotation. Is it necessary to use rollback, if we mark test with db isolation? Isn't it all performed in db transaction?

@schmengler
Copy link
Collaborator

Thank you, good to hear!

It's true, if you run your test in db isolation, rollback is not necessary, and using db isolation is generally a safe practice.

Sometimes there are reasons not to, though. For example, if indexing happens during tests, it doesn't work because temporary tables cannot be created inside a transaction. In Magento 2.2 the transaction would be silently committed, in 2.3 there's an exception.

You can see how I handle this for product fixtures here: c67e0fd

I'll leave this issue open as request for documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants