Skip to content

Commit

Permalink
Merge pull request #3129 from bruntib/empty_base_diff
Browse files Browse the repository at this point in the history
[client] Diff "resolved" reports of remote to local
  • Loading branch information
csordasmarton authored Jan 12, 2021
2 parents dd19490 + e08ac58 commit 64ccd97
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/client/codechecker_client/cmd_line_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,9 @@ def get_diff_remote_run_local_dir(client, remote_run_names, report_dirs):
diff_type,
None)

if not remote_hashes:
return filtered_reports, run_names

if diff_type in [ttypes.DiffType.NEW, ttypes.DiffType.UNRESOLVED]:
# Shows reports from the report dir which are not present in
# the baseline (NEW reports) or appear in both side (UNRESOLVED
Expand Down
16 changes: 16 additions & 0 deletions web/tests/functional/diff_local_remote/test_diff_local_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ def setUp(self):

self._local_test_project = \
self._test_cfg['test_project']['project_path_local']
self._remote_test_project = \
self._test_cfg['test_project']['project_path_remote']

self._local_reports = os.path.join(self._local_test_project,
'reports')
self._remote_reports = os.path.join(self._remote_test_project,
'reports')

self._url = env.parts_to_url(self._test_cfg['codechecker_cfg'])

Expand Down Expand Up @@ -599,3 +603,15 @@ def test_diff_multiple_output(self):
self.assertTrue(os.path.exists(index_html))

shutil.rmtree(export_dir)

def test_diff_remote_local_resolved_same(self):
""" Test for resolved reports on same list remotely and locally. """
diff_cmd = [self._codechecker_cmd, "cmd", "diff",
"--resolved",
"--url", self._url,
"-b", self._run_names[0],
"-n", self._remote_reports,
"-o", "json"]

out = self.run_cmd(diff_cmd)
self.assertEqual(json.loads(out), [])

0 comments on commit 64ccd97

Please sign in to comment.