Merge lp:~jml/launchpad/db-revision-bug-487628 into lp:launchpad
Proposed by
Jonathan Lange
Status: | Merged |
---|---|
Approved by: | Henning Eggers |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~jml/launchpad/db-revision-bug-487628 |
Merge into: | lp:launchpad |
Diff against target: |
53 lines (+11/-7) 2 files modified
lib/canonical/database/revision.py (+5/-6) lib/canonical/testing/layers.py (+6/-1) |
To merge this branch: | bzr merge lp:~jml/launchpad/db-revision-bug-487628 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Henning Eggers (community) | code | Approve | |
Review via email: mp+15805@code.launchpad.net |
Commit message
Raise an informative error when we cannot start the appserver due to unapplied database patches. Make the error itself more useful by recommending running make schema.
To post a comment you must log in.
Hello Reviewer!
This branch fixes a bug and a glitch. It fixes bug 487628, reported by Danilo, where the test suite would raise confusing errors when running appserver tests when the database wasn't properly patched.
The problem is that the AppServer layer starts the app server in its 'setUp' phase. The FunctionLayer only checks the database patch is correct in the 'testSetUp' phase, which is only run after all of the 'setUp' layers are finished.
The solution is to do the same check that the functional layer does in the code that starts up the app server, so the server is only started if the database is correctly patched.
The glitch is that when you actually get the InvalidDatabase Revision error, it's not clear what you need to do to fix the problem. I've changed the exception text to suggest running make schema.
<adiroiban> after running rocketfuel-get do I need to manualy merge the db changes? database. revision. InvalidDatabase Revision: patch-2207-10-0.sql has not been applied to the database
<adiroiban> i got this error canonical.
<ajmitch> I think that requires 'make schema', doesn't it?
That's it. I look forward to your review.
jml