Skip to content

Commit ba9e92a

Browse files
fix: only filter by invocations_rank_index when no invocation_id is specified (#2143)
When using 'edr report --select invocation_id:XXXX', the report showed 0 tests for non-latest invocations because the invocations_rank_index == 1 filter ran unconditionally after the invocation_id filter, removing all results where the selected invocation wasn't the most recent one. This mirrors the existing correct pattern in get_test_results_summary(). Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Itamar Hartstein <haritamar@gmail.com>
1 parent 035653a commit ba9e92a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

elementary/monitor/api/tests/tests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ def get_test_results(
168168
for test_result in filtered_test_results_db_rows
169169
if test_result.invocation_id == invocation_id
170170
]
171-
172-
filtered_test_results_db_rows = [
173-
test_result
174-
for test_result in filtered_test_results_db_rows
175-
if test_result.invocations_rank_index == 1
176-
]
171+
else:
172+
filtered_test_results_db_rows = [
173+
test_result
174+
for test_result in filtered_test_results_db_rows
175+
if test_result.invocations_rank_index == 1
176+
]
177177

178178
tests_results: DefaultDict[str, List[TestResultSchema]] = defaultdict(list)
179179
for test_result_db_row in filtered_test_results_db_rows:

0 commit comments

Comments
 (0)