|
28 | 28 |
|
29 | 29 | from _pytest.doctest import DoctestItem |
30 | 30 | from py.path import local |
31 | | -from pytest import Class, Function, Item, Module, Package, PytestWarning, Session |
| 31 | +from pytest import Class, Function, Item, Module, Package, Session |
32 | 32 | from reportportal_client.aio import Task |
33 | 33 | from reportportal_client.core.rp_issues import ExternalIssue, Issue |
34 | 34 | from reportportal_client.helpers import markdown_helpers, timestamp |
|
80 | 80 | LOGGER = logging.getLogger(__name__) |
81 | 81 |
|
82 | 82 | KNOWN_LOG_LEVELS = ("TRACE", "DEBUG", "INFO", "WARN", "ERROR") |
83 | | -MAX_ITEM_NAME_LENGTH: int = 1024 |
84 | | -TRUNCATION_STR: str = "..." |
85 | 83 | ROOT_DIR: str = str(os.path.abspath(curdir)) |
86 | 84 | PYTEST_MARKS_IGNORE: set[str] = {"parametrize", "usefixtures", "filterwarnings"} |
87 | 85 | NOT_ISSUE: Issue = Issue("NOT_ISSUE") |
@@ -497,21 +495,6 @@ def collect_tests(self, session: Session) -> None: |
497 | 495 | self._merge_code(test_tree) |
498 | 496 | self._build_item_paths(test_tree, []) |
499 | 497 |
|
500 | | - def _truncate_item_name(self, name: str) -> str: |
501 | | - """Get name of item. |
502 | | -
|
503 | | - :param name: Test Item name |
504 | | - :return: truncated to maximum length name if needed |
505 | | - """ |
506 | | - if len(name) > MAX_ITEM_NAME_LENGTH: |
507 | | - name = name[: MAX_ITEM_NAME_LENGTH - len(TRUNCATION_STR)] + TRUNCATION_STR |
508 | | - LOGGER.warning( |
509 | | - PytestWarning( |
510 | | - f'Test leaf ID was truncated to "{name}" because of name size constrains on Report Portal' |
511 | | - ) |
512 | | - ) |
513 | | - return name |
514 | | - |
515 | 498 | def _get_item_description(self, test_item: Any) -> Optional[str]: |
516 | 499 | """Get description of item. |
517 | 500 |
|
@@ -580,7 +563,7 @@ def _build_start_suite_rq(self, leaf: dict[str, Any]) -> dict[str, Any]: |
580 | 563 | parent_item_id = self._lock(leaf["parent"], lambda p: p.get("item_id")) if "parent" in leaf else None |
581 | 564 | item = leaf["item"] |
582 | 565 | payload = { |
583 | | - "name": self._truncate_item_name(leaf["name"]), |
| 566 | + "name": leaf["name"], |
584 | 567 | "description": self._get_item_description(item), |
585 | 568 | "start_time": timestamp(), |
586 | 569 | "item_type": "SUITE", |
@@ -882,7 +865,7 @@ def _process_metadata_item_finish(self, leaf: dict[str, Any]) -> None: |
882 | 865 | def _build_start_step_rq(self, leaf: dict[str, Any]) -> dict[str, Any]: |
883 | 866 | payload = { |
884 | 867 | "attributes": leaf.get("attributes", None), |
885 | | - "name": self._truncate_item_name(leaf["name"]), |
| 868 | + "name": leaf["name"], |
886 | 869 | "description": leaf["description"], |
887 | 870 | "start_time": timestamp(), |
888 | 871 | "item_type": "STEP", |
@@ -1351,7 +1334,7 @@ def start_bdd_step(self, feature: Feature, scenario: Scenario, step: Step) -> No |
1351 | 1334 | if feature.background: |
1352 | 1335 | background_leaf = scenario_leaf["children"][feature.background] |
1353 | 1336 | self._finish_bdd_step(background_leaf, "PASSED") |
1354 | | - item_id = reporter.start_nested_step(self._truncate_item_name(f"{step.keyword} {step.name}"), timestamp()) |
| 1337 | + item_id = reporter.start_nested_step(f"{step.keyword} {step.name}", timestamp()) |
1355 | 1338 | step_leaf["item_id"] = item_id |
1356 | 1339 | step_leaf["exec"] = ExecStatus.IN_PROGRESS |
1357 | 1340 |
|
|
0 commit comments