Chromium Code Reviews| Index: chrome/test/chromedriver/run_buildbot_steps.py |
| diff --git a/chrome/test/chromedriver/run_buildbot_steps.py b/chrome/test/chromedriver/run_buildbot_steps.py |
| index 3ce5bea5a5537c8e0e99af9f7dadbcab8815ac28..2e2ef055cdbf78e010570c6654d5aefe09cf3a05 100755 |
| --- a/chrome/test/chromedriver/run_buildbot_steps.py |
| +++ b/chrome/test/chromedriver/run_buildbot_steps.py |
| @@ -96,7 +96,7 @@ def _GetTestResultsLog(platform): |
| platform: The platform that the test results log is for. |
| Returns: |
| - A dictionary where the keys are SVN revisions and the values are booleans |
| + A dictionary where the keys are commit positions and the values are booleans |
| indicating whether the tests passed. |
| """ |
| temp_log = tempfile.mkstemp()[1] |
| @@ -127,10 +127,12 @@ def _UpdateTestResultsLog(platform, revision, passed): |
| Args: |
| platform: The platform name. |
| - revision: The SVN revision number. |
| + revision: The commit position number. |
| passed: Boolean indicating whether the tests passed at this revision. |
| """ |
| - assert isinstance(revision, int), 'The revision must be an integer' |
| + |
| + assert revision.isdigit(), 'The commit position must be a number' |
| + revision = int(revision) |
| log = _GetTestResultsLog(platform) |
| if len(log) > 500: |
| del log[min(log.keys())] |
| @@ -164,7 +166,7 @@ def _GetSupportedChromeVersions(): |
| def _RevisionState(test_results_log, revision): |
| - """Check the state of tests at a given SVN revision. |
| + """Check the state of tests at a given commit position. |
| Considers tests as having passed at a revision if they passed at revisons both |
| before and after. |
| @@ -403,7 +405,7 @@ def _GetCommitPositionFromGitHash(snapshot_hashcode): |
| result = search_pattern.search(message[len(message)-1]) |
| if result: |
| return result.group(1) |
| - util.PrintAndFlush('Failed to get svn revision number for %s' % |
| + util.PrintAndFlush('Failed to get commit position number for %s' % |
| snapshot_hashcode) |
| return None |
| @@ -427,15 +429,8 @@ def _GetGitHashFromCommitPosition(commit_position): |
| def _WaitForLatestSnapshot(revision): |
| util.MarkBuildStepStart('wait_for_snapshot') |
| - def _IsRevisionNumber(revision): |
| - if isinstance(revision, int): |
| - return True |
| - else: |
| - return revision.isdigit() |
| while True: |
| snapshot_revision = archive.GetLatestSnapshotVersion() |
|
stgao
2014/09/30 17:47:11
Is this one always the commit position now?
Last t
samuong
2014/09/30 18:07:07
Looks like a commit position to me:
http://build.
|
| - if not _IsRevisionNumber(snapshot_revision): |
| - snapshot_revision = _GetCommitPositionFromGitHash(snapshot_revision) |
| if revision is not None and snapshot_revision is not None: |
| if int(snapshot_revision) >= int(revision): |
| break |
| @@ -481,7 +476,7 @@ def main(): |
| help=('Comma separated list of application package names, ' |
| 'if running tests on Android.')) |
| parser.add_option( |
| - '-r', '--revision', help='Chromium revision') |
| + '-r', '--revision', help='Chromium git revision hash') |
| parser.add_option( |
| '', '--update-log', action='store_true', |
| help='Update the test results log (only applicable to Android)') |
| @@ -498,8 +493,6 @@ def main(): |
| if not options.revision: |
| commit_position = None |
| - elif options.revision.isdigit(): |
| - commit_position = options.revision |
| else: |
| commit_position = _GetCommitPositionFromGitHash(options.revision) |