@@ -48,7 +48,18 @@ class Variables:
4848 _pabot_pool_id : Optional [int ]
4949 _pabot_used : Optional [str ]
5050 project : Optional [str ]
51+
52+ # API key auth parameter
5153 api_key : Optional [str ]
54+
55+ # OAuth 2.0 parameters
56+ oauth_uri : Optional [str ]
57+ oauth_username : Optional [str ]
58+ oauth_password : Optional [str ]
59+ oauth_client_id : Optional [str ]
60+ oauth_client_secret : Optional [str ]
61+ oauth_scope : Optional [str ]
62+
5263 attach_log : bool
5364 attach_report : bool
5465 attach_xunit : bool
@@ -62,7 +73,7 @@ class Variables:
6273 rerun_of : Optional [str ]
6374 test_attributes : List [str ]
6475 skipped_issue : bool
65- log_batch_payload_size : int
76+ log_batch_payload_limit : int
6677 launch_uuid_print : bool
6778 launch_uuid_print_output : Optional [OutputType ]
6879 client_type : ClientType
@@ -92,9 +103,25 @@ def __init__(self) -> None:
92103 self .rerun_of = get_variable ("RP_RERUN_OF" , default = None )
93104 self .skipped_issue = to_bool (get_variable ("RP_SKIPPED_ISSUE" , default = "True" ))
94105 self .test_attributes = get_variable ("RP_TEST_ATTRIBUTES" , default = "" ).split ()
95- self .log_batch_payload_size = int (
96- get_variable ("RP_LOG_BATCH_PAYLOAD_SIZE" , default = str (MAX_LOG_BATCH_PAYLOAD_SIZE ))
97- )
106+
107+ batch_payload_size_limit = get_variable ("RP_LOG_BATCH_PAYLOAD_LIMIT" , default = None )
108+ batch_payload_size = get_variable ("RP_LOG_BATCH_PAYLOAD_SIZE" , default = None )
109+ if batch_payload_size :
110+ warn (
111+ "Parameter `RP_LOG_BATCH_PAYLOAD_SIZE` is deprecated since 5.6.5 "
112+ "and will be subject for removing in the next major version. Use `RP_LOG_BATCH_PAYLOAD_LIMIT` argument"
113+ " instead." ,
114+ DeprecationWarning ,
115+ 2 ,
116+ )
117+ if not batch_payload_size_limit :
118+ batch_payload_size_limit = batch_payload_size
119+
120+ if batch_payload_size_limit :
121+ self .log_batch_payload_limit = int (batch_payload_size_limit )
122+ else :
123+ self .log_batch_payload_limit = MAX_LOG_BATCH_PAYLOAD_SIZE
124+
98125 self .launch_uuid_print = to_bool (get_variable ("RP_LAUNCH_UUID_PRINT" , default = "False" ))
99126 output_type = get_variable ("RP_LAUNCH_UUID_PRINT_OUTPUT" )
100127 self .launch_uuid_print_output = OutputType [output_type .upper ()] if output_type else None
@@ -116,29 +143,20 @@ def __init__(self) -> None:
116143 self .remove_keywords = to_bool (get_variable ("RP_REMOVE_KEYWORDS" , default = "False" ))
117144 self .flatten_keywords = to_bool (get_variable ("RP_FLATTEN_KEYWORDS" , default = "False" ))
118145
146+ # API key auth parameter
119147 self .api_key = get_variable ("RP_API_KEY" )
120- if not self .api_key :
121- token = get_variable ("RP_UUID" )
122- if token :
123- warn (
124- message = "Argument `RP_UUID` is deprecated since version 5.3.3 and will be subject for "
125- "removing in the next major version. Use `RP_API_KEY` argument instead." ,
126- category = DeprecationWarning ,
127- stacklevel = 2 ,
128- )
129- self .api_key = token
130- else :
131- warn (
132- message = "Argument `RP_API_KEY` is `None` or empty string, that's not supposed to happen "
133- "because ReportPortal is usually requires an authorization key. Please check your"
134- " configuration." ,
135- category = RuntimeWarning ,
136- stacklevel = 2 ,
137- )
148+
149+ # OAuth 2.0 parameters
150+ self .oauth_uri = get_variable ("RP_OAUTH_URI" )
151+ self .oauth_username = get_variable ("RP_OAUTH_USERNAME" )
152+ self .oauth_password = get_variable ("RP_OAUTH_PASSWORD" )
153+ self .oauth_client_id = get_variable ("RP_OAUTH_CLIENT_ID" )
154+ self .oauth_client_secret = get_variable ("RP_OAUTH_CLIENT_SECRET" )
155+ self .oauth_scope = get_variable ("RP_OAUTH_SCOPE" )
138156
139157 self .debug_mode = to_bool (get_variable ("RP_DEBUG_MODE" , default = "False" ))
140158
141- cond = (self .endpoint , self .launch_name , self .project , self . api_key )
159+ cond = (self .endpoint , self .launch_name , self .project )
142160 self .enabled = all (cond )
143161 if not self .enabled :
144162 warn (
0 commit comments