|
54 | 54 |
|
55 | 55 | # noinspection PyProtectedMember |
56 | 56 | from reportportal_client._internal.static.abstract import AbstractBaseClass, abstractmethod |
| 57 | +from reportportal_client._internal.static.defines import DEFAULT_LOG_LEVEL |
57 | 58 |
|
58 | 59 | # noinspection PyProtectedMember |
59 | 60 | from reportportal_client.aio.tasks import Task |
@@ -375,8 +376,6 @@ async def start_launch( |
375 | 376 | truncate_attributes_enabled=self.truncate_attributes, |
376 | 377 | truncate_fields_enabled=self.truncate_fields, |
377 | 378 | replace_binary_characters=self.replace_binary_chars, |
378 | | - launch_name_length_limit=self.launch_name_length_limit, |
379 | | - launch_description_length_limit=self.launch_description_length_limit, |
380 | 379 | description=description, |
381 | 380 | mode=self.mode, |
382 | 381 | rerun=rerun, |
@@ -445,16 +444,14 @@ async def start_test_item( |
445 | 444 | else: |
446 | 445 | url = root_uri_join(self.base_url_v2, "item") |
447 | 446 | request_payload = AsyncItemStartRequest( |
448 | | - name, |
449 | | - start_time, |
450 | | - item_type, |
451 | | - launch_uuid, |
| 447 | + name=name, |
| 448 | + start_time=start_time, |
| 449 | + type_=item_type, |
| 450 | + launch_uuid=launch_uuid, |
452 | 451 | attributes=attributes, |
453 | 452 | truncate_attributes_enabled=self.truncate_attributes, |
454 | 453 | truncate_fields_enabled=self.truncate_fields, |
455 | 454 | replace_binary_characters=self.replace_binary_chars, |
456 | | - item_name_length_limit=self.item_name_length_limit, |
457 | | - item_description_length_limit=self.item_description_length_limit, |
458 | 455 | code_ref=code_ref, |
459 | 456 | description=description, |
460 | 457 | has_stats=has_stats, |
@@ -511,14 +508,13 @@ async def finish_test_item( |
511 | 508 | """ |
512 | 509 | url = self.__get_item_url(item_id) |
513 | 510 | request_payload = AsyncItemFinishRequest( |
514 | | - end_time, |
515 | | - launch_uuid, |
516 | | - status, |
| 511 | + end_time=end_time, |
| 512 | + launch_uuid=launch_uuid, |
| 513 | + status=status, |
517 | 514 | attributes=attributes, |
518 | 515 | truncate_attributes_enabled=self.truncate_attributes, |
519 | 516 | truncate_fields_enabled=self.truncate_fields, |
520 | 517 | replace_binary_characters=self.replace_binary_chars, |
521 | | - item_description_length_limit=self.item_description_length_limit, |
522 | 518 | description=description, |
523 | 519 | test_case_id=test_case_id, |
524 | 520 | is_skipped_an_issue=self.is_skipped_an_issue, |
@@ -556,13 +552,12 @@ async def finish_launch( |
556 | 552 | """ |
557 | 553 | url = self.__get_launch_url(launch_uuid) |
558 | 554 | request_payload = LaunchFinishRequest( |
559 | | - end_time, |
| 555 | + end_time=end_time, |
560 | 556 | status=status, |
561 | 557 | attributes=attributes, |
562 | 558 | truncate_attributes_enabled=self.truncate_attributes, |
563 | 559 | truncate_fields_enabled=self.truncate_fields, |
564 | 560 | replace_binary_characters=self.replace_binary_chars, |
565 | | - launch_description_length_limit=self.launch_description_length_limit, |
566 | 561 | description=kwargs.get("description"), |
567 | 562 | ).payload |
568 | 563 | response = await AsyncHttpRequest( |
@@ -593,7 +588,6 @@ async def update_test_item( |
593 | 588 | truncate_attributes_enabled=self.truncate_attributes, |
594 | 589 | truncate_fields_enabled=self.truncate_fields, |
595 | 590 | replace_binary_characters=self.replace_binary_chars, |
596 | | - item_description_length_limit=self.item_description_length_limit, |
597 | 591 | ).payload |
598 | 592 | item_id = await self.get_item_id_by_uuid(item_uuid) |
599 | 593 | url = root_uri_join(self.base_url_v1, "item", item_id, "update") |
@@ -699,7 +693,15 @@ async def log_batch(self, log_batch: Optional[list[AsyncRPRequestLog]]) -> Optio |
699 | 693 |
|
700 | 694 | url = root_uri_join(self.base_url_v2, "log") |
701 | 695 | response = await ErrorPrintingAsyncHttpRequest( |
702 | | - (await self.session()).post, url=url, data=AsyncRPLogBatch(log_batch).payload, name="log" |
| 696 | + (await self.session()).post, |
| 697 | + url=url, |
| 698 | + data=AsyncRPLogBatch( |
| 699 | + truncate_attributes_enabled=None, |
| 700 | + truncate_fields_enabled=None, |
| 701 | + replace_binary_characters=None, |
| 702 | + log_reqs=log_batch, |
| 703 | + ).payload, |
| 704 | + name="log", |
703 | 705 | ).make() |
704 | 706 | return await response.messages if response else None |
705 | 707 |
|
@@ -1126,8 +1128,19 @@ async def log( |
1126 | 1128 | :param item_id: UUID of the ReportPortal Item the message belongs to. |
1127 | 1129 | :return: Response message Tuple if Log message batch was sent or None. |
1128 | 1130 | """ |
| 1131 | + rp_level = str(level) if level else DEFAULT_LOG_LEVEL |
1129 | 1132 | rp_file = RPFile(**attachment) if attachment else None |
1130 | | - rp_log = AsyncRPRequestLog(self.__launch_uuid, time, rp_file, item_id, level, message) |
| 1133 | + rp_log = AsyncRPRequestLog( |
| 1134 | + truncate_attributes_enabled=None, |
| 1135 | + truncate_fields_enabled=None, |
| 1136 | + replace_binary_characters=None, |
| 1137 | + launch_uuid=self.__launch_uuid, |
| 1138 | + time=time, |
| 1139 | + file=rp_file, |
| 1140 | + item_uuid=item_id, |
| 1141 | + level=rp_level, |
| 1142 | + message=message, |
| 1143 | + ) |
1131 | 1144 | return await self.__client.log_batch(await self._log_batcher.append_async(rp_log)) |
1132 | 1145 |
|
1133 | 1146 | def clone(self) -> "AsyncRPClient": |
@@ -1577,8 +1590,19 @@ def log( |
1577 | 1590 | :param item_id: UUID of the ReportPortal Item the message belongs to. |
1578 | 1591 | :return: Response message Tuple if Log message batch was sent or None. |
1579 | 1592 | """ |
| 1593 | + rp_level = str(level) if level else DEFAULT_LOG_LEVEL |
1580 | 1594 | rp_file = RPFile(**attachment) if attachment else None |
1581 | | - rp_log = AsyncRPRequestLog(self.launch_uuid, time, rp_file, item_id, level, message) |
| 1595 | + rp_log = AsyncRPRequestLog( |
| 1596 | + truncate_attributes_enabled=None, |
| 1597 | + truncate_fields_enabled=None, |
| 1598 | + replace_binary_characters=None, |
| 1599 | + launch_uuid=self.launch_uuid, |
| 1600 | + time=time, |
| 1601 | + file=rp_file, |
| 1602 | + item_uuid=item_id, |
| 1603 | + level=rp_level, |
| 1604 | + message=message, |
| 1605 | + ) |
1582 | 1606 | return self.create_task(self._log(rp_log)) |
1583 | 1607 |
|
1584 | 1608 | def close(self) -> None: |
|
0 commit comments