Code review comment for lp:~jml/launchpad/db-revision-bug-487628

Revision history for this message
Jonathan Lange (jml) wrote :

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 InvalidDatabaseRevision 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?
<adiroiban> i got this error canonical.database.revision.InvalidDatabaseRevision: patch-2207-10-0.sql has not been applied to the database
<ajmitch> I think that requires 'make schema', doesn't it?

That's it. I look forward to your review.

jml

« Back to merge proposal