Exemplo n.º 1
0
 def test_determine_full_version(self):
     """Test checking that a valid full version is returned."""
     full_version = packages.determine_full_version()
     pattern = r'^R(\d+)-(\d+.\d+.\d+(-rc\d+)*)'
     m = re.match(pattern, full_version)
     self.assertTrue(m)
     milestone_version = m.group(1)
     self.assertGreaterEqual(int(milestone_version), 1)
Exemplo n.º 2
0
 def test_versions_based_on_mock(self):
   # Create a test version_info object, and than mock VersionInfo.from_repo
   # return it.
   test_platform_version = '12575.0.0'
   test_chrome_branch = '75'
   version_info_mock = manifest_version.VersionInfo(test_platform_version)
   version_info_mock.chrome_branch = test_chrome_branch
   self.PatchObject(manifest_version.VersionInfo, 'from_repo',
                    return_value=version_info_mock)
   test_full_version = 'R' + test_chrome_branch + '-' + test_platform_version
   platform_version = packages.determine_platform_version()
   milestone_version = packages.determine_milestone_version()
   full_version = packages.determine_full_version()
   self.assertEqual(platform_version, test_platform_version)
   self.assertEqual(milestone_version, test_chrome_branch)
   self.assertEqual(full_version, test_full_version)
Exemplo n.º 3
0
def GetTargetVersions(input_proto, output_proto, _config):
  """Returns the target versions."""
  build_target = controller_util.ParseBuildTarget(input_proto.build_target)
  android_version = packages.determine_android_version([build_target])
  if android_version:
    output_proto.android_version = android_version
  android_branch_version = packages.determine_android_branch(build_target)
  if android_branch_version:
    output_proto.android_branch_version = android_branch_version
  android_target_version = packages.determine_android_target(build_target)
  if android_target_version:
    output_proto.android_target_version = android_target_version
  # TODO(crbug/1019770): Investigate cases where builds_chrome is true but
  # chrome_version is None.
  builds_chrome = packages.builds(constants.CHROME_CP, build_target)
  if builds_chrome:
    chrome_version = packages.determine_chrome_version(build_target)
    if chrome_version:
      output_proto.chrome_version = chrome_version
  output_proto.platform_version = packages.determine_platform_version()
  output_proto.milestone_version = packages.determine_milestone_version()
  output_proto.full_version = packages.determine_full_version()