Skip to content

Commit

Permalink
Merge pull request #161 from reportportal/EPMRPP-88972-fix
Browse files Browse the repository at this point in the history
EPMRPP-88972 || Fix query when prev launch isn't provided
  • Loading branch information
pbortnik authored Jan 9, 2024
2 parents 49bea14 + 11cdf32 commit 8a566f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions app/service/analyzer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ def add_constraints_for_launches_into_query(self, query: dict, launch) -> dict:
must.append({'term': {'launch_id': launch_id}})
elif analyzer_mode == 'PREVIOUS_LAUNCH':
# Just previous launch
if previous_launch_id:
must = self.create_path(query, ('query', 'bool', 'must'), [])
must.append({'term': {'launch_id': previous_launch_id}})
must = self.create_path(query, ('query', 'bool', 'must'), [])
must.append({'term': {'launch_id': previous_launch_id}})
elif analyzer_mode == 'ALL':
# All previous launches
must_not = self.create_path(query, ('query', 'bool', 'must_not'), [])
Expand Down
2 changes: 1 addition & 1 deletion test/unit/service/test_unit_analyzer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
(2, 'CURRENT_AND_THE_SAME_NAME', DEFAULT_LAUNCH_NAME_SEARCH),
(2, 'CURRENT_LAUNCH', {'must': [{'term': {'launch_id': DEFAULT_LAUNCH_ID}}]}),
(2, 'PREVIOUS_LAUNCH', {'must': [{'term': {'launch_id': 2}}]}),
(None, 'PREVIOUS_LAUNCH', {}),
(None, 'PREVIOUS_LAUNCH', {'must': [{'term': {'launch_id': 0}}]}),
('3', 'PREVIOUS_LAUNCH', {'must': [{'term': {'launch_id': 3}}]}),
(2, None, DEFAULT_LAUNCH_BOOST),
(2, 'ALL', {'must_not': [{'term': {'launch_id': DEFAULT_LAUNCH_ID}}]})
Expand Down

0 comments on commit 8a566f0

Please sign in to comment.