New issue
Advanced search Search tips

Issue 914928 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

No-Op src/presubmit.py Change Triggers a Presubmit Error

Project Member Reported by robliao@chromium.org, Dec 13

Issue description

Make a no-op change to src/PRESUBMIT.py like the following:
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 65b0e438d0a6..d99fdf4cb205 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -8,6 +8,8 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
 for more details about the presubmit API built into depot_tools.
 """

+#
+





And then run git cl presubmit. It will fail with the following:
** Presubmit ERRORS **
OWNERS check failed: this CL has no Gerrit change number, so we can't check it for approvals.

Issue wasn't uploaded. Please upload first.

D:\src\PRESUBMIT_test.py (3.40s) failed
.........................................................................FFFF.............
======================================================================
FAIL: testNoScreenshots (__main__.TranslationScreenshotsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\src\PRESUBMIT_test.py", line 2001, in testNoScreenshots
    warnings[0].items)
AssertionError: Lists differ: ['test_grd/IDS_TEST1.png.sha1'... != [u'test_grd\\IDS_TEST1.png.sha...

First differing element 0:
test_grd/IDS_TEST1.png.sha1
test_grd\IDS_TEST1.png.sha1

- ['test_grd/IDS_TEST1.png.sha1', 'test_grd/IDS_TEST2.png.sha1']
?           ^                              ^

+ [u'test_grd\\IDS_TEST1.png.sha1', u'test_grd\\IDS_TEST2.png.sha1']
?  +         ^^                     +         ^^


======================================================================
FAIL: testScreenshotsRemovedWithSha1 (__main__.TranslationScreenshotsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\src\PRESUBMIT_test.py", line 2067, in testScreenshotsRemovedWithSha1
    'test_grd/IDS_TEST2.png.sha1'], warnings[0].items)
AssertionError: Lists differ: ['test_grd/IDS_TEST1.png.sha1'... != [u'test_grd\\IDS_TEST1.png.sha...

First differing element 0:
test_grd/IDS_TEST1.png.sha1
test_grd\IDS_TEST1.png.sha1

- ['test_grd/IDS_TEST1.png.sha1', 'test_grd/IDS_TEST2.png.sha1']
?           ^                              ^

+ [u'test_grd\\IDS_TEST1.png.sha1', u'test_grd\\IDS_TEST2.png.sha1']
?  +         ^^                     +         ^^


======================================================================
FAIL: testScreenshotsWithSha1 (__main__.TranslationScreenshotsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\src\PRESUBMIT_test.py", line 2052, in testScreenshotsWithSha1
    self.assertEqual([], warnings)
AssertionError: Lists differ: [] != [You are adding or modifying U...

Second list contains 1 additional elements.
First extra element 0:
You are adding or modifying UI strings.
To ensure the best translations, take screenshots of the relevant UI (https://g.co/chrome/translation) and add these files to your changelist:

- []
+ [You are adding or modifying UI strings.
+ To ensure the best translations, take screenshots of the relevant UI (https://g.co/chrome/translation) and add these files to your changelist:]

======================================================================
FAIL: testUnnecessaryScreenshots (__main__.TranslationScreenshotsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\src\PRESUBMIT_test.py", line 2025, in testUnnecessaryScreenshots
    self.assertEqual(['test_grd/IDS_TEST1.png.sha1'], warnings[1].items)
AssertionError: Lists differ: ['test_grd/IDS_TEST1.png.sha1'... != [u'test_grd\\IDS_TEST1.png.sha...

First differing element 0:
test_grd/IDS_TEST1.png.sha1
test_grd\IDS_TEST1.png.sha1

- ['test_grd/IDS_TEST1.png.sha1']
?           ^

+ [u'test_grd\\IDS_TEST1.png.sha1']
?  +         ^^


----------------------------------------------------------------------
Ran 90 tests in 2.091s

FAILED (failures=4)


 
Cc: -aga...@chromium.org
Components: -Infra>SDK Build
You're running the tests on windows? I wouldn't be surprised if we hit os-specific issues there.
Cc: -mea...@chromium.org
Owner: mea...@chromium.org
Status: Assigned (was: Untriaged)
Indeed looks like a path separator issue to me. I can take a look.
Using os.sep or os.path.join might do the trick.
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ea3e57a755759163bc5cd5283d360a6faea2ed17

commit ea3e57a755759163bc5cd5283d360a6faea2ed17
Author: Mustafa Emre Acer <meacer@chromium.org>
Date: Mon Dec 17 23:51:01 2018

Fix path separators in PRESUBMIT tests on Windows

Bug:  914928 
Change-Id: I4215c91ff83d04634b7bf19f6d8cfd0fe3c3e618
Reviewed-on: https://chromium-review.googlesource.com/c/1381238
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617293}
[modify] https://crrev.com/ea3e57a755759163bc5cd5283d360a6faea2ed17/PRESUBMIT_test.py

Status: Fixed (was: Assigned)

Sign in to add a comment