Exclude affecting of DB schema changes on the Fuel CI jobs for fuel-stats

Bug #1556876 reported by Alexander Kislitsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Bulat Gaifullin

Bug Description

When we have changed DB schema other patchsets failed due to Alembic can't upgrade/downgrade DB.
We need to have fallback mechanism in the DbTest setUp for cleanup all indexes/sequences/tables by hands if Alembic doesn't able to downrade DB schema.

Steps for reproduce:

- Clone fuel-stats:
git clone https://github.com/openstack/fuel-stats.git

- Configure development env: https://review.openstack.org/#/c/294673/2/README.rst (How to configure development environment)

- Create branch:
git branch test_branch

- Apply latest DB migration:
./manage_collector.py --mode test db upgrade -d collector/api/db/migrations/

- Create DB migration:
./manage_collector.py --mode test db migrate -d collector/api/db/migrations/

- Apply migration:
./manage_collector.py --mode test db upgrade -d collector/api/db/migrations/

- Remove created migration file from the collector/api/db/migrations/

- Switch back to master:
git checkout master

- Try to run test:
tox -epy27

We had an error: CommandError: No such revision '3c3a4fa3a39f'

Maciej Relewicz (rlu)
Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Alexander Kislitsky (akislitsky)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-stats (master)

Fix proposed to branch: master
Review: https://review.openstack.org/292437

Changed in fuel:
status: Confirmed → In Progress
description: updated
description: updated
Changed in fuel:
assignee: Alexander Kislitsky (akislitsky) → Bulat Gaifullin (bgaifullin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-stats (master)

Reviewed: https://review.openstack.org/292437
Committed: https://git.openstack.org/cgit/openstack/fuel-stats/commit/?id=ea6263af70495797d82e77f86ca821f4d04c9c28
Submitter: Jenkins
Branch: master

commit ea6263af70495797d82e77f86ca821f4d04c9c28
Author: Alexander Kislitsky <email address hidden>
Date: Mon Mar 14 17:29:06 2016 +0300

    Cleaning test DB without Alembic migrations

    On the Fuel CI we have no rights to drop and create DB.
    In the tests we are downgrading and upgrading DB schema by Alembic
    migrations. In case of adding migrations in one review we had
    all other reviews broken due to Alembic failures on attempt to
    downgrade DB schema.
    As fix we are fallback to the cleaning DB without migrations
    in case of Alembic error on the schema downgrade.

    Change-Id: I65faf43c28427594495c67696ca190e7fe29f083
    Closes-Bug: #1556876

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.