Exemple #1
0
 def test_find_builds(self):
     """Basic test just to ensure that we can find any builds at all, with
     no errors."""
     bc = builds.BuildCache(self.cache_dir)
     now = datetime.datetime.now()
     yesterday = now - datetime.timedelta(days=2)
     buildlist = bc.find_builds(yesterday, now, 'nightly')
     for l in buildlist:
         logging.info(l)
     self.assertTrue(buildlist)
     buildlist = bc.find_builds(yesterday, now, 'tinderbox')
     for l in buildlist:
         logging.info(l)
     self.assertTrue(buildlist)
Exemple #2
0
                                                            backupCount=7)
    fileformatstring = ('%(asctime)s|%(process)d|%(threadName)s|%(name)s|'
                        'trigger_runs|%(levelname)s|%(message)s')
    fileformatter = logging.Formatter(fileformatstring)
    filehandler.setFormatter(fileformatter)
    logger.addHandler(filehandler)

    logger.info('Looking for builds...')
    product = 'fennec'
    build_platforms = [
        'android', 'android-api-9', 'android-api-10', 'android-api-11',
        'android-api-15', 'android-x86'
    ]
    buildfile_ext = '.apk'

    cache = builds.BuildCache(options.repos, options.buildtypes, product,
                              build_platforms, buildfile_ext)

    matching_builds = []
    if options.build_url:
        logger.debug('cache.find_builds_by_directory(%s)', options.build_url)
        matching_builds = cache.find_builds_by_directory(options.build_url)
    elif not args:
        logger.debug('cache.find_builds_by_revision(%s, %s, %s)',
                     options.first_revision, options.last_revision,
                     options.build_location)
        matching_builds = cache.find_builds_by_revision(
            options.first_revision, options.last_revision,
            options.build_location)
    elif args[0] == 'latest':
        logger.debug('cache.find_latest_builds(%s)', options.build_location)
        matching_builds = cache.find_latest_builds(options.build_location)
                                                          backupCount=7)
    fileformatstring = ('%(asctime)s|%(levelname)s' '|builds|%(message)s')
    fileformatter = logging.Formatter(fileformatstring)
    filehandler.setFormatter(fileformatter)
    logger.addHandler(filehandler)

    logger.info('Looking for builds...')
    product = 'fennec'
    build_platforms = ['android', 'android-armv6', 'android-x86']
    buildfile_ext = '.apk'

    build_urls = []
    if not args:
        build_urls = builds.BuildCache(options.repos, options.buildtypes,
                                       product, build_platforms,
                                       buildfile_ext).find_builds_by_revision(
                                           options.first_revision,
                                           options.last_revision,
                                           options.build_location)
    elif args[0] == 'latest':
        build_urls = builds.BuildCache(
            options.repos, options.buildtypes, product, build_platforms,
            buildfile_ext).find_latest_builds(options.build_location)
    else:
        if re.match('\d{14}', args[0]):
            # build id
            build_time = datetime.datetime.strptime(args[0], '%Y%m%d%H%M%S')
            start_time = build_time
            end_time = build_time
        else:
            start_time = from_iso_date_or_datetime(args[0])
            if len(args) > 1: