-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve the functional tests #445
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
Comments
At now neither test change the DB status, because just we check the response content/status for now, but I'm sure we need that since there is uncovered actions that change the DB status, for example:
So my vote 👍 |
I propose this PR (#459) that uses my bundle https://github.com/dmaicher/doctrine-test-bundle to have very simple database isolation for all tests 😊 I'm using this bundle in several private and professional projects with mysql, sqlite and postgres - works very nicely. I changed the tests slightly so first Post 1 is deleted and in the next test its edited. Just to show that all tests are running within database level transactions now that are rolled back at the end of the test. What do you think? |
…on (dmaicher, javiereguiluz) This PR was merged into the master branch. Discussion ---------- Use dama/doctrine-test-bundle for proper test DB isolation This fixes #445 by using https://github.com/dmaicher/doctrine-test-bundle to have proper test isolation. Commits ------- 3a94540 Fixed a typo 172ce3d Tweaks 0fa427c add some comments about the usage of the bundle fc1b7c3 remove file path from listener config d968017 Use dama/doctrine-test-bundle for proper test DB isolation
@yceruto deleting an existing post successfully changes the DB (at least I hope it does) |
@stof sure, but before #459 it didn't happen: #444 (comment) so the post was never successfully removed. |
…on (dmaicher, javiereguiluz) This PR was merged into the master branch. Discussion ---------- Use dama/doctrine-test-bundle for proper test DB isolation This fixes symfony/demo#445 by using https://github.com/dmaicher/doctrine-test-bundle to have proper test isolation. Commits ------- 3a94540 Fixed a typo 172ce3d Tweaks 0fa427c add some comments about the usage of the bundle fc1b7c3 remove file path from listener config d968017 Use dama/doctrine-test-bundle for proper test DB isolation
…on (dmaicher, javiereguiluz) This PR was merged into the master branch. Discussion ---------- Use dama/doctrine-test-bundle for proper test DB isolation This fixes symfony/demo#445 by using https://github.com/dmaicher/doctrine-test-bundle to have proper test isolation. Commits ------- 3a94540 Fixed a typo 172ce3d Tweaks 0fa427c add some comments about the usage of the bundle fc1b7c3 remove file path from listener config d968017 Use dama/doctrine-test-bundle for proper test DB isolation
As pointed by @stof, in this comment at least one of our tests modifies the state of the testing database.
We should improve this by automatically resetting the testing database before each test. In our case this can't be very complex to do because the database is just a file called
var/data/blog_test.sqlite
The text was updated successfully, but these errors were encountered: