Skip to content

Commit e00960b

Browse files
author
Nivedit Jain
authored
[LOADTESTSERVICE] Resolved issue with double functions (Azure#28417)
1 parent 1d396a0 commit e00960b

File tree

8 files changed

+83
-94
lines changed

8 files changed

+83
-94
lines changed

sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,37 @@
33
## 1.0.0b3 (2023-01-01)
44

55
### Features Added
6-
- Method added `azure.developer.loadtesting.LoadTestRunClient.list_metric_namespaces`
7-
- Method added `azure.developer.loadtesting.LoadTestRunClient.list_metric_definitions`
8-
- Method added `azure.developer.loadtesting.LoadTestRunClient.list_metrics`
9-
- Method added `azure.developer.loadtesting.LoadTestRunClient.create_or_update_app_components`
10-
- Method added `azure.developer.loadtesting.LoadTestRunClient.get_app_components`
11-
- Method added `azure.developer.loadtesting.LoadTestRunClient.create_or_update_server_metrics_config`
12-
- Method added `azure.developer.loadtesting.LoadTestRunClient.get_server_metrics_config`
13-
- Method added `azure.developer.loadtesting.LoadTestAdministration.begin_upload_test_file`
14-
- Method added `azure.developer.loadtesting.LoadTestRunClient.begin_test_run`
15-
- Method added `azure.developer.loadtesting.LoadTestRunClient.begin_test_run_status`
16-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.list_metric_namespaces`
17-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.list_metric_definitions`
18-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.list_metrics`
19-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.create_or_update_app_components`
20-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.get_app_components`
21-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.create_or_update_server_metrics_config`
22-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.get_server_metrics_config`
23-
- Method added `azure.developer.loadtesting.aio.LoadTestAdministration.begin_upload_test_file`
24-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.begin_test_run_status`
25-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.get_metric_dimension_values`
26-
- Method added `azure.developer.loadtesting.aio.LoadTestRunClient.begin_test_run`
6+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.list_metric_namespaces`
7+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.list_metric_definitions`
8+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.list_metrics`
9+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.create_or_update_app_components`
10+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.get_app_components`
11+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.create_or_update_server_metrics_config`
12+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.get_server_metrics_config`
13+
- Method added `azure.developer.loadtesting.LoadTestingClient.administration.begin_upload_test_file`
14+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.begin_test_run`
15+
- Method added `azure.developer.loadtesting.LoadTestingClient.test_run.begin_test_run_status`
16+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.list_metric_namespaces`
17+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.list_metric_definitions`
18+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.list_metrics`
19+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.create_or_update_app_components`
20+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.get_app_components`
21+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.create_or_update_server_metrics_config`
22+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.get_server_metrics_config`
23+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.administration.begin_upload_test_file`
24+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.begin_test_run_status`
25+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.get_metric_dimension_values`
26+
- Method added `azure.developer.loadtesting.aio.LoadTestingClient.test_run.begin_test_run`
2727

2828

2929
### Breaking Changes
3030
- Changed subclients `load_test_runs` and `load_test_adminsitration` to `test_run` and `adminsitrative` respectively
31+
- Removed `continuation_token` as a parameter for method `azure.developer.loadtesting.aio.LoadTestingClient.test_run.list_test_runs`
32+
- Removed `continuation_token` as a parameter for method `azure.developer.loadtesting.LoadTestingClient.test_run.list_test_runs`,
33+
- Removed `continuation_token` as a parameter for method `azure.developer.loadtesting.aio.LoadTestingClient.administration.list_test_files`
34+
- Removed `continuation_token` as a parameter for method `azure.developer.loadtesting.LoadTestingClient.administration.list_test_files`
35+
- Removed `continuation_token` as a parameter for method `azure.developer.loadtesting.aio.LoadTestingClient.administration.list_tests`
36+
- Removed `continuation_token` as a parameter for method `azure.developer.loadtesting.LoadTestingClient.administration.list_tests`
3137

3238
### Other Changes
3339
- Updated README

sdk/loadtestservice/azure-developer-loadtesting/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ These two clients also have there asynchronous counterparts, which are
6767

6868
### Load Test Administration Client
6969

70-
The `LoadTestAdministrationClient` clients is used to administer and configure the load tests, app components and metrics.
70+
The `LoadTestingClient.administration` is used to administer and configure the load tests, app components and metrics.
7171

7272
#### Test
7373

sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/operations/_operations.py

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from azure.core.utils import case_insensitive_dict
2929

3030
from ...operations._operations import (
31+
build_administration_begin_upload_test_file_request,
3132
build_administration_create_or_update_app_components_request,
3233
build_administration_create_or_update_server_metrics_config_request,
3334
build_administration_create_or_update_test_request,
@@ -39,10 +40,9 @@
3940
build_administration_get_test_request,
4041
build_administration_list_test_files_request,
4142
build_administration_list_tests_request,
42-
build_administration_upload_test_file_request,
43+
build_test_run_begin_test_run_request,
4344
build_test_run_create_or_update_app_components_request,
4445
build_test_run_create_or_update_server_metrics_config_request,
45-
build_test_run_create_or_update_test_run_request,
4646
build_test_run_delete_test_run_request,
4747
build_test_run_get_app_components_request,
4848
build_test_run_get_server_metrics_config_request,
@@ -1162,7 +1162,6 @@ def list_tests(
11621162
search: Optional[str] = None,
11631163
last_modified_start_time: Optional[datetime.datetime] = None,
11641164
last_modified_end_time: Optional[datetime.datetime] = None,
1165-
continuation_token_parameter: Optional[str] = None,
11661165
**kwargs: Any
11671166
) -> AsyncIterable[JSON]:
11681167
"""Get all load tests by the fully qualified resource Id e.g
@@ -1184,9 +1183,6 @@ def list_tests(
11841183
:keyword last_modified_end_time: End DateTime(ISO 8601 literal format) of the last updated time
11851184
range to filter tests. Default value is None.
11861185
:paramtype last_modified_end_time: ~datetime.datetime
1187-
:keyword continuation_token_parameter: Continuation token to get the next page of response.
1188-
Default value is None.
1189-
:paramtype continuation_token_parameter: str
11901186
:return: An iterator like instance of JSON object
11911187
:rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
11921188
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1381,7 +1377,6 @@ def prepare_request(next_link=None):
13811377
search=search,
13821378
last_modified_start_time=last_modified_start_time,
13831379
last_modified_end_time=last_modified_end_time,
1384-
continuation_token_parameter=continuation_token_parameter,
13851380
api_version=self._config.api_version,
13861381
headers=_headers,
13871382
params=_params,
@@ -1439,7 +1434,7 @@ async def get_next(next_link=None):
14391434
return AsyncItemPaged(get_next, extract_data)
14401435

14411436
@distributed_trace_async
1442-
async def upload_test_file(
1437+
async def begin_upload_test_file(
14431438
self, test_id: str, file_name: str, body: IO, *, file_type: Optional[str] = None, **kwargs: Any
14441439
) -> JSON:
14451440
"""Upload input file for a given test name. File size can't be more than 50 MB. Existing file with
@@ -1498,7 +1493,7 @@ async def upload_test_file(
14981493

14991494
_content = body
15001495

1501-
request = build_administration_upload_test_file_request(
1496+
request = build_administration_begin_upload_test_file_request(
15021497
test_id=test_id,
15031498
file_name=file_name,
15041499
file_type=file_type,
@@ -1667,19 +1662,14 @@ async def delete_test_file( # pylint: disable=inconsistent-return-statements
16671662
return cls(pipeline_response, None, {})
16681663

16691664
@distributed_trace
1670-
def list_test_files(
1671-
self, test_id: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any
1672-
) -> AsyncIterable[JSON]:
1665+
def list_test_files(self, test_id: str, **kwargs: Any) -> AsyncIterable[JSON]:
16731666
"""Get all test files.
16741667
16751668
Get all test files.
16761669
16771670
:param test_id: Unique name for the load test, must contain only lower-case alphabetic,
16781671
numeric, underscore or hyphen characters. Required.
16791672
:type test_id: str
1680-
:keyword continuation_token_parameter: Continuation token to get the next page of response.
1681-
Default value is None.
1682-
:paramtype continuation_token_parameter: str
16831673
:return: An iterator like instance of JSON object
16841674
:rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
16851675
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1720,7 +1710,6 @@ def prepare_request(next_link=None):
17201710

17211711
request = build_administration_list_test_files_request(
17221712
test_id=test_id,
1723-
continuation_token_parameter=continuation_token_parameter,
17241713
api_version=self._config.api_version,
17251714
headers=_headers,
17261715
params=_params,
@@ -2445,7 +2434,7 @@ def __init__(self, *args, **kwargs) -> None:
24452434
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
24462435

24472436
@overload
2448-
async def create_or_update_test_run(
2437+
async def begin_test_run(
24492438
self,
24502439
test_run_id: str,
24512440
body: JSON,
@@ -2968,7 +2957,7 @@ async def create_or_update_test_run(
29682957
"""
29692958

29702959
@overload
2971-
async def create_or_update_test_run(
2960+
async def begin_test_run(
29722961
self,
29732962
test_run_id: str,
29742963
body: IO,
@@ -3247,7 +3236,7 @@ async def create_or_update_test_run(
32473236
"""
32483237

32493238
@distributed_trace_async
3250-
async def create_or_update_test_run(
3239+
async def begin_test_run(
32513240
self, test_run_id: str, body: Union[JSON, IO], *, old_test_run_id: Optional[str] = None, **kwargs: Any
32523241
) -> JSON:
32533242
"""Create and start a new test run with the given name.
@@ -3540,7 +3529,7 @@ async def create_or_update_test_run(
35403529
else:
35413530
_json = body
35423531

3543-
request = build_test_run_create_or_update_test_run_request(
3532+
request = build_test_run_begin_test_run_request(
35443533
test_run_id=test_run_id,
35453534
old_test_run_id=old_test_run_id,
35463535
content_type=content_type,
@@ -4021,7 +4010,6 @@ def list_test_runs(
40214010
self,
40224011
*,
40234012
orderby: Optional[str] = None,
4024-
continuation_token_parameter: Optional[str] = None,
40254013
search: Optional[str] = None,
40264014
test_id: Optional[str] = None,
40274015
execution_from: Optional[datetime.datetime] = None,
@@ -4036,9 +4024,6 @@ def list_test_runs(
40364024
:keyword orderby: Sort on the supported fields in (field asc/desc) format. eg: executedDateTime
40374025
asc. Supported fields - executedDateTime. Default value is None.
40384026
:paramtype orderby: str
4039-
:keyword continuation_token_parameter: Continuation token to get the next page of response.
4040-
Default value is None.
4041-
:paramtype continuation_token_parameter: str
40424027
:keyword search: Prefix based, case sensitive search on searchable fields - description,
40434028
executedUser. For example, to search for a test run, with description 500 VUs, the search
40444029
parameter can be 500. Default value is None.
@@ -4322,7 +4307,6 @@ def prepare_request(next_link=None):
43224307

43234308
request = build_test_run_list_test_runs_request(
43244309
orderby=orderby,
4325-
continuation_token_parameter=continuation_token_parameter,
43264310
search=search,
43274311
test_id=test_id,
43284312
execution_from=execution_from,

sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/operations/_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ async def begin_upload_test_file(
159159
polling_interval = kwargs.pop("_polling_interval", None)
160160
if polling_interval is None:
161161
polling_interval = 5
162-
upload_test_file_operation = await self.upload_test_file(
162+
upload_test_file_operation = await super().begin_upload_test_file(
163163
test_id=test_id, file_name=file_name, body=body, file_type=file_type, **kwargs
164164
)
165165

@@ -220,7 +220,7 @@ async def begin_test_run(
220220
polling_interval = kwargs.pop("_polling_interval", None)
221221
if polling_interval is None:
222222
polling_interval = 5
223-
create_or_update_test_run_operation = await self.create_or_update_test_run(
223+
create_or_update_test_run_operation = await super().begin_test_run(
224224
test_run_id, body, old_test_run_id=old_test_run_id, **kwargs
225225
)
226226

0 commit comments

Comments
 (0)