1- import sys
2- from pathlib import Path
3-
41import click
5- from dohq_teamcity import TeamCity
62
73from scripts .pr_check .pr_check import verify_user_can_trigger_build
8- from scripts .trigger_auto_tests .main import main as new_main
9- from scripts .trigger_auto_tests .main_old import main
10- from scripts .trigger_auto_tests .utils .cli_helpers import PathPath
4+ from scripts .trigger_auto_tests .main import main
115
126
137@click .group ()
@@ -19,79 +13,10 @@ def cli():
1913 "trigger-auto-tests" ,
2014 help = "Trigger Automated Tests on TeamCity for specified Shells and changed package" ,
2115)
22- @click .option (
23- "--supported-shells" ,
24- required = True ,
25- help = 'Specify as Shell names divided by ";"' ,
26- )
27- @click .option (
28- "--automation-project-id" ,
29- required = True ,
30- help = "Project id for the Automated tests" ,
31- )
32- @click .option ("--package-name" , required = True , help = "Updated package name" )
33- @click .option (
34- "--package-path" ,
35- required = True ,
36- type = PathPath (exists = True , file_okay = False ),
37- help = "Path to the updated package" ,
38- )
39- @click .option (
40- "--package-vcs-url" ,
41- required = True ,
42- help = "URL of the updated package VCS" ,
43- )
44- @click .option (
45- "--package-commit-id" ,
46- required = True ,
47- help = "Commit id of the updated package that would be used" ,
48- )
49- @click .option ("--tc-url" , required = True , help = "TeamCity URL" )
50- @click .option ("--tc-user" , required = True , help = "TeamCity User" )
51- @click .option ("--tc-password" , required = True , help = "TeamCity Password" )
52- @click .option (
53- "--re-run" ,
54- required = True ,
55- default = False ,
56- show_default = True ,
57- type = bool ,
58- help = "Re run a last failed automated tests" ,
59- )
60- def trigger_auto_tests (
61- supported_shells : str ,
62- automation_project_id : str ,
63- package_name : str ,
64- package_path : Path ,
65- package_vcs_url : str ,
66- package_commit_id : str ,
67- tc_url : str ,
68- tc_user : str ,
69- tc_password : str ,
70- re_run : bool ,
71- ) -> bool :
72- supported_shells = list (filter (bool , map (str .strip , supported_shells .split (";" ))))
73- is_success = main (
74- supported_shells = supported_shells ,
75- automation_project_id = automation_project_id ,
76- package_name = package_name ,
77- package_path = package_path ,
78- package_vcs_url = package_vcs_url ,
79- package_commit_id = package_commit_id ,
80- tc_url = tc_url ,
81- tc_user = tc_user ,
82- tc_password = tc_password ,
83- )
84- if not is_success :
85- sys .exit (1 )
86- return is_success
87-
88-
89- @cli .command ("new-trigger-builds" )
9016@click .option ("--tc-user" , required = True , help = "TeamCity User" )
9117@click .option ("--tc-password" , required = True , help = "TeamCity Password" )
92- def new_trigger_builds (tc_user : str , tc_password : str ):
93- tc = TeamCity ("http://tc" , auth = (tc_user , tc_password )) # noqa
94- new_main (tc_user , tc_password )
18+ def trigger_auto_tests (tc_user : str , tc_password : str ):
19+ main (tc_user , tc_password )
9520
9621
9722@cli .command (
0 commit comments