Exemplo n.º 1
0
import shutil
import subprocess
import sys

here = os.path.dirname(os.path.abspath(__file__))
venv_path = os.path.join(here, 'tests_venv')


# Create the test environment and activate it
# TODO remove once we make use of the mozharness script
import environment
command = ['python', os.path.join(here, 'firefox-ui-tests', 'create_venv.py'),
           '--strict', '--with-optional', venv_path]
print('Run command to create virtual environment for Firefox UI Tests: %s' % command)
subprocess.check_call(command)
environment.activate(venv_path)

# Can only be imported after the environment has been activated
import firefox_ui_tests
import firefox_puppeteer

from mozdownload import FactoryScraper

from config import config
from jenkins import JenkinsDefaultValueAction


class Runner(object):

    def run_tests(self, args):
        settings = config['test_types'][args.type]
Exemplo n.º 2
0
                              help='The update channel to use for the update test')
    update_group.add_argument('--update-number',
                              action=JenkinsDefaultValueAction,
                              help='The number of the partial update: today - N days')

    return vars(parser.parse_args())


if __name__ == '__main__':
    logger.info('Run as: {}'.format(sys.argv))
    kwargs = parse_args()

    # Activate the environment, and create if necessary
    import environment
    if environment.exists(kwargs['venv_path']):
        environment.activate(kwargs['venv_path'])
    else:
        environment.create(kwargs['venv_path'], os.path.join(here, 'requirements.txt'))

    # Can only be imported after the environment has been activated
    import mozinfo
    import requests

    from s3 import S3Bucket
    from thclient import TreeherderClient, TreeherderJob, TreeherderJobCollection

    settings = config['test_types'][kwargs['test_type']]
    th = Submission(kwargs['repository'], kwargs['revision'][:12],
                    treeherder_url=kwargs['treeherder_url'],
                    treeherder_client_id=kwargs['treeherder_client_id'],
                    treeherder_secret=kwargs['treeherder_secret'],
Exemplo n.º 3
0
import uuid

from urlparse import urljoin

import environment

from buildbot import BuildExitCode
from config import config
from jenkins import JenkinsDefaultValueAction

here = os.path.dirname(os.path.abspath(__file__))

# Activate the environment, and create if necessary
venv_path = 'treeherder_venv'
if environment.exists(venv_path):
    environment.activate(venv_path)
else:
    environment.create(venv_path, os.path.join(here, 'requirements.txt'))

# Can only be imported after the environment has been activated
import mozinfo

from redo import retriable
from s3 import S3Bucket
from thclient import TreeherderClient, TreeherderJob, TreeherderJobCollection

JOB_FRAGMENT = '/#/jobs?repo={repository}&revision={revision}'

BUILD_STATES = ['running', 'completed']

logging.basicConfig(format='%(asctime)s %(levelname)s | %(message)s',