]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Clean up DB migrations when running unit tests
authorZane Bitter <zbitter@redhat.com>
Wed, 29 May 2013 07:25:30 +0000 (09:25 +0200)
committerZane Bitter <zbitter@redhat.com>
Wed, 29 May 2013 07:25:35 +0000 (09:25 +0200)
When doing development work, all kinds of issue can result when moving
between versions of the code that have added/removed DB migration scripts
if the compiled .pyc files are left behind. To save the need to do this
manually, remove all of the .pyc files when the unit tests are run.

Change-Id: Ia4bc889edeeed499e5fc2172d5f7c1b4e693a27b

run_tests.sh

index d6b09e1f213cd00fa954c3f07fbd901ffc7520ab..63b306e9ec48b89be7741654ffdbd68e96f06490 100755 (executable)
@@ -40,6 +40,8 @@ wrapper=""
 
 function run_tests {
     echo 'Running tests'
+    # Remove any extraneous DB migrations
+    find heat/db/sqlalchemy/migrate_repo/versions/ -name '*.pyc' -delete
     # Just run the test suites in current environment
     if [ -n "$args" ] ; then
         args="-t $args"