Skip to content

rp_hierarchy_dirs=True has no effect when rp_hierarchy_code=False #409

Description

@droish

Description:

Setting rp_hierarchy_dirs=True and rp_hierarchy_test_file=True does not produce a hierarchical suite structure in ReportPortal when rp_hierarchy_code
is left at its default value of False. All test items are reported as flat STEPs with no parent suites. The three hierarchy flags do not work
independently — rp_hierarchy_code=False overrides the other two.

Steps to Reproduce:

  1. Create a test project with nested directories:
    tests/system/
    ├── subfolder/
    │ ├── deep/
    │ │ └── test_level3.py
    │ └── test_integration.py
    ├── test_api_validation.py
    └── test_user_management.py
  2. Run with hierarchy dirs and test file enabled (but rp_hierarchy_code at default False):
    pytest tests/system --reportportal \
    -o rp_hierarchy_dirs=True \
    -o rp_hierarchy_test_file=True
  3. Check the launch in ReportPortal.

Expected behavior

Tests should be organized in a folder/file tree with suites for directories and files:
tests (SUITE) → system (SUITE) → subfolder (SUITE) → test_integration.py (SUITE) → test items

Actual behavior

Zero suites are created. All items are flat STEPs with :: concatenated names:
tests::system::subfolder::deep::test_level3.py::TestConfigurationValidation::test_name

Adding -o rp_hierarchy_code=True fixes it and produces the expected hierarchy, but this should not be required.

Package versions

  • pytest-reportportal: 5.6.0
  • reportportal-client: (bundled with above)
  • pytest: 9.0.2
  • Python: 3.13

Additional context

The workaround is to set all three flags: rp_hierarchy_dirs=True, rp_hierarchy_test_file=True, and rp_hierarchy_code=True.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions