Skip to content

Incorrect deep merge of suites with has_children = false #194

@mrbinwin

Description

@mrbinwin

Hello!

service-api v. 5.4.0

There is a bug in merge_launch() function that leads to incorrect deep merge of suites (from different launches) that have the same name but one of them have no children (test_item.has_children = false).

test_item 1:

item_id unique_id name path has_children parent_id launch_id
5253296 auto:85f69a4c071c3d073d354f31bc82e6a4 Root User Story 5253296 false 261773

test_item 2:

item_id unique_id name path has_children parent_id launch_id
23471137 auto:85f69a4c071c3d073d354f31bc82e6a4 Root User Story 23471137 true 599388

We run a deep merge of their launches: 261773 and 599388

Actual result:

test_item after merge:

item_id unique_id name path has_children parent_id launch_id
31452655 auto:26204e06d9f9326dd60f05075c3fc258 Root User Story 31452655 false 638339

1

The result test_item.has_children = false
Also rows related to new launch and this test_item have not been inserted to statistics table.
So users are unable to see test results of this launch on UI.

It happens because this condition is false: https://github.com/reportportal/migrations/blob/develop/migrations/25_deep_merge_nested_steps_path_fix.up.sql#L70

Expected result:
If one of merging test_items has children test_items and has_children=true,
the result test_item also must have has_children=true and related statistics (total, passed, failed...) must be inserted into statistics table

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions