diff --git a/cobalt/build/build_info.py b/cobalt/build/build_info.py index aed264665937..52f44940406c 100755 --- a/cobalt/build/build_info.py +++ b/cobalt/build/build_info.py @@ -57,7 +57,7 @@ def get_build_id_from_commit_count(cwd): output = subprocess.check_output(['git', 'rev-list', '--count', 'HEAD'], cwd=cwd) build_id = int(output.strip().decode()) + COMMIT_COUNT_BUILD_ID_OFFSET - return build_id + return str(build_id) def _get_last_commit_with_format(placeholder, cwd): diff --git a/cobalt/build/get_build_id_test.py b/cobalt/build/get_build_id_test.py index 562179ff1a3c..26e7b2b58b28 100644 --- a/cobalt/build/get_build_id_test.py +++ b/cobalt/build/get_build_id_test.py @@ -87,8 +87,9 @@ def testGetBuildNumberFromCommitCountSunnyDay(self): self.make_commit() build_number = build_info.get_build_id_from_commit_count( cwd=self.test_dir.name) - self.assertEqual(build_number, - num_commits + build_info.COMMIT_COUNT_BUILD_ID_OFFSET) + self.assertEqual( + int(build_number), + num_commits + build_info.COMMIT_COUNT_BUILD_ID_OFFSET) def testCommitsOutrankCommitCount(self): self.make_commit() @@ -102,8 +103,9 @@ def testFallbackToCommitCount(self): for _ in range(num_commits): self.make_commit() build_number = get_build_id.main(cwd=self.test_dir.name) - self.assertEqual(build_number, - num_commits + build_info.COMMIT_COUNT_BUILD_ID_OFFSET) + self.assertEqual( + int(build_number), + num_commits + build_info.COMMIT_COUNT_BUILD_ID_OFFSET) if __name__ == '__main__':