Skip to content

Commit

Permalink
Merge pull request #378 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Oct 22, 2024
2 parents 044b992 + c5678f5 commit 6dfe010
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## [Unreleased]
### Fixed
- Issue [#375](https://github.com/reportportal/agent-python-pytest/issues/375): Fix max Item name length, by @HardNorth

## [5.4.3]
### Added
- Issue [#332](https://github.com/reportportal/agent-python-pytest/issues/332): Support for fixture reporting, by @HardNorth

Expand Down
17 changes: 17 additions & 0 deletions examples/test_max_item_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 EPAM Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

def test_thi_is_simple_example_test_with_the_name_longer_than_maximum_allowed_lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit_sed_do_eiusmod_tempor_incididunt_ut_labore_et_dolore_magna_aliqua_ut_enim_ad_minim_veniam_quis_nostrud_exercitation_ullamco_laboris_nisi_ut_aliquip_ex_ea_commodo_consequat_duis_aute_irure_dolor_in_reprehenderit_in_voluptate_velit_esse_cillum_dolore_eu_fugiat_nulla_pariatur_excepteur_sint_occaecat_cupidatat_non_proident_sunt_in_culpa_qui_officia_deserunt_mollit_anim_id_est_laborum_sed_ut_perspiciatis_unde_omnis_iste_natus_error_sit_voluptatem_accusantium_doloremque_laudantium_totam_rem_aperiam_eaque_ipsa_quae_ab_illo_inventore_veritatis_et_quasi_architecto_beatae_vitae_dicta_sunt_explicabo_nemo_enim_ipsam_voluptatem_quia_voluptas_sit_aspernatur_aut_odit_aut_fugit_sed_quia_consequuntur_magni_dolores_eos_qui_ratione_voluptatem_sequi_nesciunt_neque_porro_quisquam_est_qui_dolorem_ipsum_quia_dolor_sit_amet_consectetur_adipisci_velit_sed_quia_non_numquam_eius_modi_tempora_incidunt_ut_labore_et_dolore_magnam_aliquam_quaerat_voluptatem(): # noqa: E501
"""Simple example test with the name longer than maximum allowed."""
assert True
2 changes: 1 addition & 1 deletion pytest_reportportal/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

log = logging.getLogger(__name__)

MAX_ITEM_NAME_LENGTH: int = 256
MAX_ITEM_NAME_LENGTH: int = 1024
TRUNCATION_STR: str = '...'
ROOT_DIR: str = str(os.path.abspath(curdir))
PYTEST_MARKS_IGNORE: Set[str] = {'parametrize', 'usefixtures', 'filterwarnings'}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from setuptools import setup


__version__ = '5.4.3'
__version__ = '5.4.4'


def read_file(fname):
Expand Down
33 changes: 33 additions & 0 deletions tests/integration/test_max_name_length.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2024 EPAM Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from unittest import mock

from tests import REPORT_PORTAL_SERVICE
from tests.helpers import utils


@mock.patch(REPORT_PORTAL_SERVICE)
def test_custom_attribute_report(mock_client_init):
result = utils.run_pytest_tests(tests=['examples/test_max_item_name.py'], variables=utils.DEFAULT_VARIABLES)
assert int(result) == 0, 'Exit code should be 0 (no errors)'

mock_client = mock_client_init.return_value
start_count = mock_client.start_test_item.call_count
finish_count = mock_client.finish_test_item.call_count
assert start_count == finish_count == 1, 'Incorrect number of "start_test_item" or "finish_test_item" calls'

call_args = mock_client.start_test_item.call_args_list
step_call_args = call_args[0][1]
assert len(step_call_args['name']) == 1024, 'Incorrect item name length'

0 comments on commit 6dfe010

Please sign in to comment.