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

Side by Side Diff: tools/push-to-trunk/test_scripts.py

Issue 400693002: Add automatic tag script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/push-to-trunk/git_recipes.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright 2013 the V8 project authors. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following 10 # copyright notice, this list of conditions and the following
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 import chromium_roll 45 import chromium_roll
46 from chromium_roll import CHROMIUM 46 from chromium_roll import CHROMIUM
47 from chromium_roll import DEPS_FILE 47 from chromium_roll import DEPS_FILE
48 from chromium_roll import ChromiumRoll 48 from chromium_roll import ChromiumRoll
49 import releases 49 import releases
50 from releases import Releases 50 from releases import Releases
51 import bump_up_version 51 import bump_up_version
52 from bump_up_version import BumpUpVersion 52 from bump_up_version import BumpUpVersion
53 from bump_up_version import LastChangeBailout 53 from bump_up_version import LastChangeBailout
54 from bump_up_version import LKGRVersionUpToDateBailout 54 from bump_up_version import LKGRVersionUpToDateBailout
55 from auto_tag import AutoTag
55 56
56 57
57 TEST_CONFIG = { 58 TEST_CONFIG = {
58 BRANCHNAME: "test-prepare-push", 59 BRANCHNAME: "test-prepare-push",
59 TRUNKBRANCH: "test-trunk-push", 60 TRUNKBRANCH: "test-trunk-push",
60 PERSISTFILE_BASENAME: "/tmp/test-v8-push-to-trunk-tempfile", 61 PERSISTFILE_BASENAME: "/tmp/test-v8-push-to-trunk-tempfile",
61 DOT_GIT_LOCATION: None, 62 DOT_GIT_LOCATION: None,
62 VERSION_FILE: None, 63 VERSION_FILE: None,
63 CHANGELOG_FILE: None, 64 CHANGELOG_FILE: None,
64 CHANGELOG_ENTRY_FILE: "/tmp/test-v8-push-to-trunk-tempfile-changelog-entry", 65 CHANGELOG_ENTRY_FILE: "/tmp/test-v8-push-to-trunk-tempfile-changelog-entry",
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 # TODO(machenbach): Use a mock for this and add a test that stops rolling 395 # TODO(machenbach): Use a mock for this and add a test that stops rolling
395 # due to clustefuzz results. 396 # due to clustefuzz results.
396 return [] 397 return []
397 398
398 def Sleep(self, seconds): 399 def Sleep(self, seconds):
399 pass 400 pass
400 401
401 def GetDate(self): 402 def GetDate(self):
402 return "1999-07-31" 403 return "1999-07-31"
403 404
405 def GetUTCStamp(self):
406 return "100000"
407
404 def ExpectGit(self, *args): 408 def ExpectGit(self, *args):
405 """Convenience wrapper.""" 409 """Convenience wrapper."""
406 self._git_mock.Expect(*args) 410 self._git_mock.Expect(*args)
407 411
408 def ExpectReadline(self, *args): 412 def ExpectReadline(self, *args):
409 """Convenience wrapper.""" 413 """Convenience wrapper."""
410 self._rl_mock.Expect(*args) 414 self._rl_mock.Expect(*args)
411 415
412 def ExpectReadURL(self, *args): 416 def ExpectReadURL(self, *args):
413 """Convenience wrapper.""" 417 """Convenience wrapper."""
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 ]) 1320 ])
1317 1321
1318 self.ExpectReadURL([ 1322 self.ExpectReadURL([
1319 URL("https://v8-status.appspot.com/lkgr", "12345"), 1323 URL("https://v8-status.appspot.com/lkgr", "12345"),
1320 URL("https://v8-status.appspot.com/current?format=json", 1324 URL("https://v8-status.appspot.com/current?format=json",
1321 "{\"message\": \"Tree is open\"}"), 1325 "{\"message\": \"Tree is open\"}"),
1322 ]) 1326 ])
1323 1327
1324 BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"]) 1328 BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"])
1325 1329
1330 def testAutoTag(self):
1331 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile()
1332 self.WriteFakeVersionFile()
1333
1334 def ResetVersion(minor, build, patch=0):
1335 return lambda: self.WriteFakeVersionFile(minor=minor,
1336 build=build,
1337 patch=patch)
1338
1339 self.ExpectGit([
1340 Git("status -s -uno", ""),
1341 Git("status -s -b -uno", "## some_branch\n"),
1342 Git("svn fetch", ""),
1343 Git("branch", " branch1\n* branch2\n"),
1344 Git("checkout -f master", ""),
1345 Git("svn rebase", ""),
1346 Git("checkout -b %s" % TEST_CONFIG[BRANCHNAME], "",
1347 cb=ResetVersion(4, 5)),
1348 Git("branch -r", "svn/tags/3.4.2\nsvn/tags/3.2.1.0\nsvn/branches/3.4"),
1349 Git("log --format=%H --grep=\"\\[Auto\\-roll\\] Bump up version to\"",
1350 "hash125\nhash118\nhash111\nhash101"),
1351 Git("checkout -f hash125 -- %s" % TEST_CONFIG[VERSION_FILE], "",
1352 cb=ResetVersion(4, 4)),
1353 Git("checkout -f HEAD -- %s" % TEST_CONFIG[VERSION_FILE], "",
1354 cb=ResetVersion(4, 5)),
1355 Git("checkout -f hash118 -- %s" % TEST_CONFIG[VERSION_FILE], "",
1356 cb=ResetVersion(4, 3)),
1357 Git("checkout -f HEAD -- %s" % TEST_CONFIG[VERSION_FILE], "",
1358 cb=ResetVersion(4, 5)),
1359 Git("checkout -f hash111 -- %s" % TEST_CONFIG[VERSION_FILE], "",
1360 cb=ResetVersion(4, 2)),
1361 Git("checkout -f HEAD -- %s" % TEST_CONFIG[VERSION_FILE], "",
1362 cb=ResetVersion(4, 5)),
1363 Git("svn find-rev hash118", "118"),
1364 Git("svn find-rev hash125", "125"),
1365 Git("svn find-rev r123", "hash123"),
1366 Git("log -1 --format=%at hash123", "1"),
1367 Git("reset --hard hash123", ""),
1368 Git("svn tag 3.4.3 -m \"Tagging version 3.4.3\"", ""),
1369 Git("checkout -f some_branch", ""),
1370 Git("branch -D %s" % TEST_CONFIG[BRANCHNAME], ""),
1371 ])
1372
1373 self.ExpectReadURL([
1374 URL("https://v8-status.appspot.com/revisions?format=json",
1375 "[{\"revision\": \"123\", \"status\": true},"
1376 "{\"revision\": \"112\", \"status\": true}]"),
1377 ])
1378
1379 AutoTag(TEST_CONFIG, self).Run(["-a", "author@chromium.org"])
1380
1326 # Test that we bail out if the last change was a version change. 1381 # Test that we bail out if the last change was a version change.
1327 def testBumpUpVersionBailout1(self): 1382 def testBumpUpVersionBailout1(self):
1328 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile() 1383 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile()
1329 self._state["latest"] = "latest_hash" 1384 self._state["latest"] = "latest_hash"
1330 1385
1331 self.ExpectGit([ 1386 self.ExpectGit([
1332 Git("diff --name-only latest_hash latest_hash^", 1387 Git("diff --name-only latest_hash latest_hash^",
1333 TEST_CONFIG[VERSION_FILE]), 1388 TEST_CONFIG[VERSION_FILE]),
1334 ]) 1389 ])
1335 1390
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 1433
1379 Review URL: https://codereview.chromium.org/83173002 1434 Review URL: https://codereview.chromium.org/83173002
1380 1435
1381 ------------------------------------------------------------------------""") 1436 ------------------------------------------------------------------------""")
1382 self.assertEquals( 1437 self.assertEquals(
1383 """Prepare push to trunk. Now working on version 3.23.11. 1438 """Prepare push to trunk. Now working on version 3.23.11.
1384 1439
1385 R=danno@chromium.org 1440 R=danno@chromium.org
1386 1441
1387 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1442 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« no previous file with comments | « tools/push-to-trunk/git_recipes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698