def testAutoPush(self): TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() TEST_CONFIG[SETTINGS_LOCATION] = "~/.doesnotexist" self.ExpectReadURL([ URL("https://v8-status.appspot.com/current?format=json", "{\"message\": \"Tree is throttled\"}"), URL("https://v8-status.appspot.com/lkgr", Exception("Network problem")), URL("https://v8-status.appspot.com/lkgr", "100"), ]) self.ExpectGit([ Git("status -s -uno", ""), Git("status -s -b -uno", "## some_branch\n"), Git("svn fetch", ""), Git(("log -1 --format=%H --grep=\"" "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\"" " svn/trunk"), "push_hash\n"), Git("log -1 --format=%s push_hash", "Version 3.4.5 (based on bleeding_edge revision r79)\n"), ]) auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"]) state = json.loads(FileToText("%s-state.json" % TEST_CONFIG[PERSISTFILE_BASENAME])) self.assertEquals("100", state["lkgr"])
def testAutoPush(self): self.Expect([ Cmd("git fetch", ""), Cmd("git fetch origin +refs/heads/lkgr:refs/heads/lkgr", ""), Cmd("git show-ref -s refs/heads/lkgr", "abc123\n"), Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), Cmd("git tag", self.TAGS), Cmd("git log -1 --format=%H 3.22.4", "release_hash\n"), Cmd("git log -1 --format=%s release_hash", "Version 3.22.4 (based on abc3)\n"), Cmd("git log --format=%H abc3..abc123", "some_stuff\n"), ]) auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"]) state = json.loads(FileToText("%s-state.json" % TEST_CONFIG["PERSISTFILE_BASENAME"])) self.assertEquals("abc123", state["candidate"])
def RunAutoPush(): auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS)