#NEWLINE# def _pre_upgrade_2822a408bdd0( self , engine ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# runs = get_table ( engine , 'runs' ) #NEWLINE# run = { #NEWLINE# #INDENT# 'id' : six . text_type ( uuid . uuid4 ( ) ) , #NEWLINE# 'skips' : 0 , #NEWLINE# 'fails' : 0 , #NEWLINE# 'passes' : 1 , #NEWLINE# 'run_time' : 1.0 , #NEWLINE# 'artifacts' : 'https://am_i_really_a_fake_url' , #NEWLINE# 'run_at' : datetime . datetime . utcnow ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# runs . insert ( ) . values ( run ) . execute ( ) #NEWLINE# data [ 'run' ] = run #NEWLINE# run_metadatas = get_table ( engine , 'run_metadata' ) #NEWLINE# run_metadata = { #NEWLINE# #INDENT# 'id' : six . text_type ( uuid . uuid4 ( ) ) , #NEWLINE# 'run_id' : run [ 'id' ] , #NEWLINE# 'key' : 'attrs' , #NEWLINE# 'value' : 'an_attr' , #NEWLINE# #UNINDENT# } #NEWLINE# run_metadatas . insert ( ) . values ( run_metadata ) . execute ( ) #NEWLINE# data [ 'run_metadata' ] = run_metadata #NEWLINE# tests = get_table ( engine , 'tests' ) #NEWLINE# test = { #NEWLINE# #INDENT# 'id' : six . text_type ( uuid . uuid4 ( ) ) , #NEWLINE# 'test_id' : 'I_am_a_real_test!' , #NEWLINE# 'success' : 1 , #NEWLINE# 'failure' : 0 , #NEWLINE# #UNINDENT# } #NEWLINE# tests . insert ( ) . values ( test ) . execute ( ) #NEWLINE# data [ 'test' ] = test #NEWLINE# test_metadatas = get_table ( engine , 'test_metadata' ) #NEWLINE# test_metadata = { #NEWLINE# #INDENT# 'id' : six . text_type ( uuid . uuid4 ( ) ) , #NEWLINE# 'test_id' : test [ 'id' ] , #NEWLINE# 'key' : 'a_real_key' , #NEWLINE# 'value' : 'an_attr' , #NEWLINE# #UNINDENT# } #NEWLINE# test_metadatas . insert ( ) . values ( test_metadata ) . execute ( ) #NEWLINE# data [ 'test_metadata' ] = test_metadata #NEWLINE# now = datetime . datetime . now ( ) #NEWLINE# future_now = ( now + datetime . timedelta ( 0 , 4 ) ) #NEWLINE# test_runs = get_table ( engine , 'test_runs' ) #NEWLINE# test_run = { #NEWLINE# #INDENT# 'id' : six . text_type ( uuid . uuid4 ( ) ) , #NEWLINE# 'test_id' : test [ 'id' ] , #NEWLINE# 'run_id' : run [ 'id' ] , #NEWLINE# 'start_time' : now , #NEWLINE# 'status' : 'success' , #NEWLINE# 'stop_time' : future_now , #NEWLINE# #UNINDENT# } #NEWLINE# test_runs . insert ( ) . values ( test_run ) . execute ( ) #NEWLINE# data [ 'test_run' ] = test_run #NEWLINE# test_run_metadatas = get_table ( engine , 'test_run_metadata' ) #NEWLINE# test_run_metadata = { #NEWLINE# #INDENT# 'id' : six . text_type ( uuid . uuid4 ( ) ) , #NEWLINE# 'test_run_id' : test_run [ 'id' ] , #NEWLINE# 'key' : 'attrs' , #NEWLINE# 'value' : 'an_attr' , #NEWLINE# #UNINDENT# } #NEWLINE# test_run_metadatas . insert ( ) . values ( test_run_metadata ) . execute ( ) #NEWLINE# data [ 'test_run_metadata' ] = test_run_metadata #NEWLINE# attachments = get_table ( engine , 'attachments' ) #NEWLINE# attachment = { #NEWLINE# #INDENT# 'id' : six . text_type ( uuid . uuid4 ( ) ) , #NEWLINE# 'test_run_id' : test_run_metadata [ 'id' ] , #NEWLINE# 'label' : 'an_attachment' , #NEWLINE# 'attachment' : b'something' , #NEWLINE# #UNINDENT# } #NEWLINE# attachments . insert ( ) . values ( attachment ) . execute ( ) #NEWLINE# data [ 'attachment' ] = attachment #NEWLINE# return data