@@ -1195,7 +1195,8 @@ def create_instance(compute, project, zone, test, reportURL) -> Dict:
11951195 metadata_items = [
11961196 {'key' : 'startup-script' , 'value' : startup_script },
11971197 {'key' : 'reportURL' , 'value' : reportURL },
1198- {'key' : 'bucket' , 'value' : config .get ('GCS_BUCKET_NAME' , '' )}
1198+ {'key' : 'bucket' , 'value' : config .get ('GCS_BUCKET_NAME' , '' )},
1199+ {'key' : 'testID' , 'value' : str (test .id )}
11991200 ]
12001201 elif test .platform == TestPlatform .windows :
12011202 image_response = compute .images ().getFromFamily (project = config .get ('WINDOWS_INSTANCE_PROJECT_NAME' , '' ),
@@ -1217,7 +1218,8 @@ def create_instance(compute, project, zone, test, reportURL) -> Dict:
12171218 {'key' : 'service_account' , 'value' : service_account },
12181219 {'key' : 'rclone_conf' , 'value' : rclone_conf },
12191220 {'key' : 'reportURL' , 'value' : reportURL },
1220- {'key' : 'bucket' , 'value' : config .get ('GCS_BUCKET_NAME' , '' )}
1221+ {'key' : 'bucket' , 'value' : config .get ('GCS_BUCKET_NAME' , '' )},
1222+ {'key' : 'testID' , 'value' : str (test .id )}
12211223 ]
12221224 source_disk_image = image_response ['selfLink' ]
12231225
@@ -2635,7 +2637,7 @@ def upload_log_type_request(log, test_id, repo_folder, test, request) -> bool:
26352637 uploaded_file .save (temp_path )
26362638 final_path = os .path .join (repo_folder , 'LogFiles' , f"{ test .id } .txt" )
26372639
2638- os .rename (temp_path , final_path )
2640+ os .replace (temp_path , final_path )
26392641 log .debug ("Stored log file" )
26402642 return True
26412643
@@ -2681,7 +2683,7 @@ def upload_type_request(log, test_id, repo_folder, test, request) -> bool:
26812683 results_dir = os .path .join (repo_folder , 'TestResults' )
26822684 os .makedirs (results_dir , exist_ok = True )
26832685 final_path = os .path .join (results_dir , f'{ file_hash } { file_extension } ' )
2684- os .rename (temp_path , final_path )
2686+ os .replace (temp_path , final_path )
26852687 rto = RegressionTestOutput .query .filter (
26862688 RegressionTestOutput .id == request .form ['test_file_id' ]).first ()
26872689 result_file = TestResultFile (test .id , request .form ['test_id' ], rto .id , rto .correct , file_hash )
0 commit comments