diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 209d65434..285077d9b 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -804,7 +804,7 @@ def CheckOwners(input_api, output_api, source_file_filter=None, if missing_files: output_list = [ output('Missing %s for these files:\n %s' % - (needed, '\n '.join(missing_files)))] + (needed, '\n '.join(sorted(missing_files))))] if not input_api.is_committing: suggested_owners = owners_db.reviewers_for(affected_files, owner_email) output_list.append(output('Suggested OWNERS:\n %s' % diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 243c9070f..9051e6d50 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -2419,9 +2419,11 @@ class CannedChecksUnittest(PresubmitTestsBase): 'brett@example.com']), reviewers=set(['john@example.com', 'ben@example.com']), - uncovered_files=set(['foo/xyz.cc']), + uncovered_files=set(['foo/xyz.cc', 'foo/bar.cc']), expected_output='Missing LGTM from an OWNER ' - 'for these files:\n foo/xyz.cc\n', + 'for these files:\n' + ' foo/bar.cc\n' + ' foo/xyz.cc\n', author_counts_as_owner=False) def testCannedCheckOwners_TBR(self):