DB migrations are not tested with data

Bug #1539735 reported by Henry Gessau
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Unassigned

Bug Description

Currently the DB migration tests check only the schema. In several cases migration changes should be checked with data records to fully verify that they work.

We need a framework for writing migration tests with data. We should leverage from or contribute to oslo.db appropriately for this.

Using the framework, develop test cases.

Henry Gessau (gessau)
Changed in neutron:
importance: Undecided → Medium
tags: added: db functional-tests
Changed in neutron:
assignee: nobody → Manjeet Singh Bhatia (manjeet-s-bhatia)
Changed in neutron:
status: New → In Progress
Revision history for this message
Manjeet Singh Bhatia (manjeet-s-bhatia) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/294183

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/124946
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=6029f9961f1c3332abd222e2dcadedb553c30d3c
Submitter: Jenkins
Branch: master

commit 6029f9961f1c3332abd222e2dcadedb553c30d3c
Author: Matthew Treinish <email address hidden>
Date: Mon Sep 29 23:38:00 2014 -0400

    Add db migrations test framework with data

    This patch adds migration testing framework for pymysql and postgresql.
    In this basic libraries for testing migrations using data (revision
    ids) are added.

    Change-Id: I6e330f9e5a0fdbd5fd46a9b090b109b99d194bb0
    Co-Authored-By: Manjeet Singh Bhatia <email address hidden>
    Co-Authored-By: Ilya Pekelny <email address hidden>
    Partial-Bug: #1539735

Changed in neutron:
assignee: Manjeet Singh Bhatia (manjeet-s-bhatia) → John Perkins (john-d-perkins)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/294183
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in neutron:
status: In Progress → Confirmed
milestone: none → newton-3
Changed in neutron:
milestone: newton-3 → newton-rc1
Revision history for this message
Henry Gessau (gessau) wrote :

I would say this is complete. The framework to write tests is in place. Some tests [1] have been written, with more [2] in review.

Implementing tests for all existing migrations is a lot of work for no benefit. Migrations that do not move data also have little benefit from migration tests. Going forward we will require tests for migrations that move data. We may attempt to develop a hacking rule for compliance.

[1] https://github.com/openstack/neutron/tree/9.0.0.0b3/neutron/tests/functional/db/migrations
[2] https://review.openstack.org/364278

Changed in neutron:
milestone: newton-rc1 → ocata-1
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

Agreed with Henry. Let's retarget it back to Newton, and close.

Changed in neutron:
status: Confirmed → Fix Committed
milestone: ocata-1 → newton-rc1
Changed in neutron:
milestone: newton-rc1 → ocata-1
milestone: ocata-1 → mitaka-3
milestone: mitaka-3 → none
status: Fix Committed → Fix Released
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.