Add support for populating test data during migration testing

This change ensures that the tables in the database during migration have at least one row of "real" data, which should help catch issues in the future where we forget to set column defaults and other such schema oversights that can only be truly tested with non-empty tables

Fixes https://jira.coreos.com/browse/QUAY-913
This commit is contained in:
Joseph Schorr 2018-05-07 16:45:57 +03:00
parent c92c0ca5e1
commit f6ff0d6ca0
41 changed files with 653 additions and 86 deletions

View file

@ -19,8 +19,11 @@ def cleanup_old_robots(page_size=50):
for robot in list(User.select().where(User.robot == True).paginate(page_number, page_size)):
found_bots = True
logger.info("Checking robot %s (page %s)", robot.username, page_number)
namespace, _ = parse_robot_username(robot.username)
parsed = parse_robot_username(robot.username)
if parsed is None:
continue
namespace, _ = parsed
if namespace in encountered_namespaces:
if not encountered_namespaces[namespace]:
logger.info('Marking %s to be deleted', robot.username)