Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: tests/presubmit_unittest.py

Issue 1929653002: Remove manual check using Rietveld for dry run. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@P200
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/presubmit_unittest.py
diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py
index ed57ffa05237d086c7a60d86ab6adbd983c3530f..d0c9c10ede0838864ed4325c231c143e3f349d1d 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -2563,7 +2563,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
def AssertOwnersWorks(self, tbr=False, issue='1', approvers=None,
reviewers=None, is_committing=True, rietveld_response=None,
uncovered_files=None, expected_output='',
- manually_specified_reviewers=None, cq_dry_run=False):
+ manually_specified_reviewers=None, dry_run=None):
if approvers is None:
# The set of people who lgtm'ed a change.
approvers = set()
@@ -2589,9 +2589,10 @@ class CannedChecksUnittest(PresubmitTestsBase):
input_api.owners_db = fake_db
input_api.is_committing = is_committing
input_api.tbr = tbr
+ input_api.dry_run = dry_run
if not is_committing or (not tbr and issue):
- if not cq_dry_run:
+ if not dry_run:
affected_file.LocalPath().AndReturn('foo/xyz.cc')
change.AffectedFiles(file_filter=None).AndReturn([affected_file])
if issue and not rietveld_response:
@@ -2606,14 +2607,10 @@ class CannedChecksUnittest(PresubmitTestsBase):
if is_committing:
people = approvers
- if issue:
- input_api.rietveld.get_issue_properties(
- issue=int(input_api.change.issue), messages=None).AndReturn(
- rietveld_response)
else:
people = reviewers
- if not cq_dry_run:
+ if not dry_run:
if issue:
input_api.rietveld.get_issue_properties(
issue=int(input_api.change.issue), messages=True).AndReturn(
@@ -2637,11 +2634,10 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testCannedCheckOwners_DryRun(self):
response = {
"owner_email": "john@example.com",
- "cq_dry_run": True,
"reviewers": ["ben@example.com"],
}
self.AssertOwnersWorks(approvers=set(),
- cq_dry_run=True,
+ dry_run=True,
rietveld_response=response,
reviewers=set(["ben@example.com"]),
expected_output='This is a dry run, skipping OWNERS check\n')
« no previous file with comments | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698