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

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

Issue 70143003: Add more test coverage to push-to-trunk script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 7 years, 1 month 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/push_to_trunk.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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 "Y", # Increment build number. 280 "Y", # Increment build number.
281 ] 281 ]
282 282
283 self.MakeStep(IncrementVersion).Run() 283 self.MakeStep(IncrementVersion).Run()
284 284
285 self.assertEquals("3", self.MakeStep().Restore("new_major")) 285 self.assertEquals("3", self.MakeStep().Restore("new_major"))
286 self.assertEquals("22", self.MakeStep().Restore("new_minor")) 286 self.assertEquals("22", self.MakeStep().Restore("new_minor"))
287 self.assertEquals("6", self.MakeStep().Restore("new_build")) 287 self.assertEquals("6", self.MakeStep().Restore("new_build"))
288 self.assertEquals("0", self.MakeStep().Restore("new_patch")) 288 self.assertEquals("0", self.MakeStep().Restore("new_patch"))
289 289
290 def testLastChangeLogEntries(self):
291 TEST_CONFIG[CHANGELOG_FILE] = self.MakeEmptyTempFile()
292 l = """
293 Fixed something.
294 (issue 1234)\n"""
295 for _ in xrange(10): l = l + l
296
297 cl_chunk = """2013-11-12: Version 3.23.2\n%s
298 Performance and stability improvements on all platforms.\n\n\n""" % l
299
300 cl_chunk_full = cl_chunk + cl_chunk + cl_chunk
301 TextToFile(cl_chunk_full, TEST_CONFIG[CHANGELOG_FILE])
302
303 cl = GetLastChangeLogEntries(TEST_CONFIG[CHANGELOG_FILE])
304 self.assertEquals(cl_chunk, cl)
305
290 def testSquashCommits(self): 306 def testSquashCommits(self):
291 TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile() 307 TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile()
292 with open(TEST_CONFIG[CHANGELOG_ENTRY_FILE], "w") as f: 308 with open(TEST_CONFIG[CHANGELOG_ENTRY_FILE], "w") as f:
293 f.write("1999-11-11: Version 3.22.5\n") 309 f.write("1999-11-11: Version 3.22.5\n")
294 f.write("\n") 310 f.write("\n")
295 f.write(" Log text 1.\n") 311 f.write(" Log text 1.\n")
296 f.write(" Chromium issue 12345\n") 312 f.write(" Chromium issue 12345\n")
297 f.write("\n") 313 f.write("\n")
298 f.write(" Performance and stability improvements on all " 314 f.write(" Performance and stability improvements on all "
299 "platforms.\n") 315 "platforms.\n")
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 ["log 1234..HEAD --format=%H", "rev1\n"], 377 ["log 1234..HEAD --format=%H", "rev1\n"],
362 ["log -1 rev1 --format=\"%w(80,8,8)%s\"", " Log text 1.\n"], 378 ["log -1 rev1 --format=\"%w(80,8,8)%s\"", " Log text 1.\n"],
363 ["log -1 rev1 --format=\"%B\"", "Text\nBUG=v8:321\nText\n"], 379 ["log -1 rev1 --format=\"%B\"", "Text\nBUG=v8:321\nText\n"],
364 ["log -1 rev1 --format=\"%w(80,8,8)(%an)\"", 380 ["log -1 rev1 --format=\"%w(80,8,8)(%an)\"",
365 " author1@chromium.org\n"], 381 " author1@chromium.org\n"],
366 [("commit -a -m \"Prepare push to trunk. " 382 [("commit -a -m \"Prepare push to trunk. "
367 "Now working on version 3.22.6.\""), 383 "Now working on version 3.22.6.\""),
368 " 2 files changed\n", 384 " 2 files changed\n",
369 CheckPreparePush], 385 CheckPreparePush],
370 ["cl upload -r \"reviewer@chromium.org\" --send-mail", "done\n"], 386 ["cl upload -r \"reviewer@chromium.org\" --send-mail", "done\n"],
371 ["cl dcommit", "Closing issue\n"], 387 ["cl dcommit -v", "Closing issue\n"],
372 ["svn fetch", "fetch result\n"], 388 ["svn fetch", "fetch result\n"],
373 ["checkout svn/bleeding_edge", ""], 389 ["checkout svn/bleeding_edge", ""],
374 [("log -1 --format=%H --grep=\"Prepare push to trunk. " 390 [("log -1 --format=%H --grep=\"Prepare push to trunk. "
375 "Now working on version 3.22.6.\""), 391 "Now working on version 3.22.6.\""),
376 "hash1\n"], 392 "hash1\n"],
377 ["diff svn/trunk hash1", "patch content\n"], 393 ["diff svn/trunk hash1", "patch content\n"],
378 ["checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], ""], 394 ["checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], ""],
379 ["apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""], 395 ["apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""],
380 ["add \"%s\"" % TEST_CONFIG[VERSION_FILE], ""], 396 ["add \"%s\"" % TEST_CONFIG[VERSION_FILE], ""],
381 ["commit -F \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "", CheckSVNCommit], 397 ["commit -F \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "", CheckSVNCommit],
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 435
420 cl = FileToText(TEST_CONFIG[CHANGELOG_FILE]) 436 cl = FileToText(TEST_CONFIG[CHANGELOG_FILE])
421 self.assertTrue(re.search(r"\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl)) 437 self.assertTrue(re.search(r"\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl))
422 self.assertTrue(re.search(r" Log text 1", cl)) 438 self.assertTrue(re.search(r" Log text 1", cl))
423 self.assertTrue(re.search(r" \(issue 321\)", cl)) 439 self.assertTrue(re.search(r" \(issue 321\)", cl))
424 self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl)) 440 self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl))
425 441
426 # Note: The version file is on build number 5 again in the end of this test 442 # Note: The version file is on build number 5 again in the end of this test
427 # since the git command that merges to the bleeding edge branch is mocked 443 # since the git command that merges to the bleeding edge branch is mocked
428 # out. 444 # out.
OLDNEW
« no previous file with comments | « tools/push-to-trunk/push_to_trunk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698