Skip to content

Commit

Permalink
Merge pull request #3944 from Szelethus/fix_local_local_diff_src_code…
Browse files Browse the repository at this point in the history
…_suppression

Fix local local diff src code suppression
  • Loading branch information
bruntib authored Jul 7, 2023
2 parents 310311e + 0cb679e commit 78f6863
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 6 additions & 3 deletions web/client/codechecker_client/cmd_line_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,13 +1025,16 @@ def get_diff_local_dirs(
filtered_report_hashes = []

context = webserver_context.get_context()
statuses_str = [ttypes.ReviewStatus._VALUES_TO_NAMES[x].lower()
for x in report_filter.reviewStatus]

base_results = get_report_dir_results(
report_dirs, report_filter, context.checker_labels)
base_results = [res for res in base_results
if res.check_source_code_comments(statuses_str)]

new_results = get_report_dir_results(
new_report_dirs, report_filter, context.checker_labels)

statuses_str = [ttypes.ReviewStatus._VALUES_TO_NAMES[x].lower()
for x in report_filter.reviewStatus]
new_results = [res for res in new_results
if res.check_source_code_comments(statuses_str)]

Expand Down
12 changes: 2 additions & 10 deletions web/tests/functional/diff_cmdline/test_diff_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,9 @@ def get_run_diff_count(diff_type: DiffType):
report_filter, diff_type, [dir1], [], [dir2], [])
return len(reports)

# FIXME: The report turned from source code suppressed to no longer
# suppressed, so it should be in this set.
self.assertEqual(get_run_diff_count(DiffType.NEW), 0)

# No reports disappeared.
self.assertEqual(get_run_diff_count(DiffType.NEW), 1)
self.assertEqual(get_run_diff_count(DiffType.RESOLVED), 0)

# FIXME: The report should not appear here.
self.assertEqual(get_run_diff_count(DiffType.UNRESOLVED), 1)
self.assertEqual(get_run_diff_count(DiffType.UNRESOLVED), 0)

def get_run_diff_count_reverse(diff_type: DiffType):
report_filter = ReportFilter()
Expand All @@ -295,9 +289,7 @@ def get_run_diff_count_reverse(diff_type: DiffType):
return len(reports)

self.assertEqual(get_run_diff_count_reverse(DiffType.NEW), 0)

self.assertEqual(get_run_diff_count_reverse(DiffType.RESOLVED), 1)

self.assertEqual(get_run_diff_count_reverse(DiffType.UNRESOLVED), 0)

# ===-----------------------------------------------------------------=== #
Expand Down

0 comments on commit 78f6863

Please sign in to comment.