File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import socket
21import sys
32from pathlib import Path
43
@@ -92,12 +91,9 @@ def trigger_auto_tests(
9291@click .option ("--tc-password" , required = True , help = "TeamCity Password" )
9392def new_trigger_builds (tc_user : str , tc_password : str ):
9493 tc = TeamCity ("http://tc" , auth = (tc_user , tc_password )) # noqa
95- import rpdb
96-
97- ip = socket .gethostbyname (socket .gethostname ())
98- click .echo (f"IP: { ip } " )
99- rpdb .set_trace ("0.0.0.0" )
100- new_main (tc_user , tc_password )
94+ is_success = new_main (tc_user , tc_password )
95+ if not is_success :
96+ sys .exit (1 )
10197
10298
10399@cli .command (
Original file line number Diff line number Diff line change @@ -37,10 +37,19 @@ def main(tc_user: str, tc_password: str):
3737 while triggered_builds :
3838 time .sleep (BUILDS_CHECK_DELAY )
3939 for shell_name , build_id in triggered_builds .copy ().items ():
40- build = tc .builds .get (f"id:{ build_id } " )
41- if is_build_finished (build ):
42- builds_statuses [shell_name ] = is_build_success (build )
43- triggered_builds .pop (shell_name )
40+ try :
41+ build = tc .builds .get (f"id:{ build_id } " )
42+ if is_build_finished (build ):
43+ click .echo (
44+ f"{ shell_name } Automation tests is finished "
45+ f"with status { build .status } "
46+ )
47+ builds_statuses [shell_name ] = is_build_success (build )
48+ triggered_builds .pop (shell_name )
49+ except Exception as e :
50+ errors .append (e )
51+ click .echo (e , err = True )
4452
4553 if errors :
4654 raise Exception ("There were errors running automation tests." )
55+ return all (builds_statuses .values ())
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def trigger_auto_tests_build2(
8888 ModelProperty ("conf.triggered_by_project.commit_id" , tests_info .commit_id ),
8989 ]
9090 )
91- new_build = Build (build_type_id = bt .id , branch_name = "master" , properties = properties )
91+ new_build = Build (build_type_id = bt .id , properties = properties )
9292 update_tc_csrf (tc )
9393 build = tc .build_queues .queue_new_build (body = new_build , move_to_top = True )
9494 return build .id
You can’t perform that action at this time.
0 commit comments