← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1869674] [NEW] Unit Test test_no_migrations_have_downgrade failing execution

 

Public bug reported:

Description
===========
Nova_api newly added a table, but when performing unit tests' tox - epy27 'methods' test_no_migrations_have_downgrade' error.

instance_usb.py

# def downgrade(migrate_engine):
#     meta = MetaData(migrate_engine)
#     meta.reflect(migrate_engine)
# 
#     table_names = ['instance_usb']
#     for t in table_names:
#         table = Table(t, meta)
#         table.drop(checkfirst=True)


def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine

    instance_usb = Table('instance_usb', meta,
                            Column('instance_uuid',
                                   String(length=36),
                                   nullable=False),
                            Column('vendor_id',
                                   String(length=255)),
                            Column('product_id',
                                   String(length=255)),
                            Column('id',
                                   Integer,
                                   primary_key=True,
                                   autoincrement=True),
                            Column('created_at',
                                   DateTime),
                            Column('updated_at',
                                   DateTime),
                            Column('deleted_at',
                                   DateTime),
                            Column('deleted',
                                   Boolean),
                            PrimaryKeyConstraint(
                                   'id',
                                   name="uniq_instance_usb0id"),
                            mysql_engine='InnoDB',
                            mysql_charset='utf8')
    instance_usb.create(checkfirst=True)

Environment
===========
openstack-Rocky

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1869674

Title:
  Unit Test  test_no_migrations_have_downgrade failing execution

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  Nova_api newly added a table, but when performing unit tests' tox - epy27 'methods' test_no_migrations_have_downgrade' error.

  instance_usb.py

  # def downgrade(migrate_engine):
  #     meta = MetaData(migrate_engine)
  #     meta.reflect(migrate_engine)
  # 
  #     table_names = ['instance_usb']
  #     for t in table_names:
  #         table = Table(t, meta)
  #         table.drop(checkfirst=True)

  
  def upgrade(migrate_engine):
      meta = MetaData()
      meta.bind = migrate_engine

      instance_usb = Table('instance_usb', meta,
                              Column('instance_uuid',
                                     String(length=36),
                                     nullable=False),
                              Column('vendor_id',
                                     String(length=255)),
                              Column('product_id',
                                     String(length=255)),
                              Column('id',
                                     Integer,
                                     primary_key=True,
                                     autoincrement=True),
                              Column('created_at',
                                     DateTime),
                              Column('updated_at',
                                     DateTime),
                              Column('deleted_at',
                                     DateTime),
                              Column('deleted',
                                     Boolean),
                              PrimaryKeyConstraint(
                                     'id',
                                     name="uniq_instance_usb0id"),
                              mysql_engine='InnoDB',
                              mysql_charset='utf8')
      instance_usb.create(checkfirst=True)

  Environment
  ===========
  openstack-Rocky

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1869674/+subscriptions


Follow ups