Skip to content

Commit

Permalink
[diff] Fix a CLI remote-remote bug where we checked the detection status
Browse files Browse the repository at this point in the history
Ideally, when we use CodeChecker cmd diff, we should return exactly what
the server API calls return. We obviously can't do that when either the
baseline or the newline result contains a local directory, since they
are not on the server. In that case, we need to parse the results, check
for review status rules on the server, etc.

However, when both operands _are_ on the server, there is no need to do
additional filtering, lets just trust that the server returns correct
results. If not, we should fix it the server.
  • Loading branch information
Szelethus committed Sep 20, 2023
1 parent ffd6567 commit 0b20fc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
7 changes: 0 additions & 7 deletions web/client/codechecker_client/cmd_line_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,13 +991,6 @@ def get_diff_remote_runs(
cmp_data.runIds = new_ids
cmp_data.runTag = new_run_tags

# Do not show resolved bugs in compare mode new.
if cmp_data.diffType == ttypes.DiffType.NEW:
report_filter.detectionStatus = [
ttypes.DetectionStatus.NEW,
ttypes.DetectionStatus.UNRESOLVED,
ttypes.DetectionStatus.REOPENED]

sort_mode = [(ttypes.SortMode(
ttypes.SortType.FILENAME,
ttypes.Order.ASC))]
Expand Down
11 changes: 3 additions & 8 deletions web/tests/functional/diff_cmdline/test_diff_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,7 @@ def get_run_diff_count(diff_type: DiffType):
return len(reports)

self.assertEqual(get_run_diff_count(DiffType.NEW), 1)
# FIXME: The division by zero disappeared from tag1 to tag2, so the
# RESOLVED set should have a report.
self.assertEqual(get_run_diff_count(DiffType.RESOLVED), 0)
self.assertEqual(get_run_diff_count(DiffType.RESOLVED), 1)
self.assertEqual(get_run_diff_count(DiffType.UNRESOLVED), 0)

def get_run_diff_count_reverse(diff_type: DiffType):
Expand All @@ -656,9 +654,7 @@ def get_run_diff_count_reverse(diff_type: DiffType):
["run1:tag2"], ["run1:tag1"])
return len(reports)

# FIXME: The division by zero disappeared from tag1 to tag2, so the
# NEW set should have a report when we reverse the diff.
self.assertEqual(get_run_diff_count_reverse(DiffType.NEW), 0)
self.assertEqual(get_run_diff_count_reverse(DiffType.NEW), 1)
self.assertEqual(get_run_diff_count_reverse(DiffType.RESOLVED), 1)
self.assertEqual(get_run_diff_count_reverse(DiffType.UNRESOLVED), 0)

Expand Down Expand Up @@ -866,7 +862,6 @@ def get_run_diff_count(diff_type: DiffType):
# tag1 and tag2 shouldn't change.
self.__analyze_and_store(dir1, "run1", src_no_warnings, "tag3")

# FIXME: This report should not have disappeared!
self.assertEqual(get_run_diff_count(DiffType.NEW), 0)
self.assertEqual(get_run_diff_count(DiffType.NEW), 1)
self.assertEqual(get_run_diff_count(DiffType.RESOLVED), 0)
self.assertEqual(get_run_diff_count(DiffType.UNRESOLVED), 0)

0 comments on commit 0b20fc3

Please sign in to comment.