Beispiel #1
0
def setup_app(command, conf, vars):
    """Place any commands to setup SAUCE here"""
    load_environment(conf.global_conf, conf.local_conf)

    setup_schema(command, conf, vars)

    loader = YamlLoader(model)

    for filename in sorted(os.listdir(os.path.dirname(__file__) + '/data')):
        if filename.endswith('.yaml'):
            name = filename.lstrip('01234567890').replace('.yaml', '')
            log.info('Inserting %s data...', name)
            loader.loadf(model.DBSession, '%s/data/%s' % (os.path.dirname(__file__), filename))
    transaction.commit()

    run_tests = asbool(conf.get('websetup.run_tests', True))

    if run_tests:  # pragma: no cover
        log.info('Running test cases for half the submissions...')
        q = model.DBSession.query(model.Submission)
        for submission in sample(q.all(), q.count() / 2):
            submission.run_tests()
        transaction.commit()
Beispiel #2
0
def setup_app(command, conf, vars):
    """Place any commands to setup SAUCE here"""
    load_environment(conf.global_conf, conf.local_conf)

    setup_schema(command, conf, vars)

    loader = YamlLoader(model)

    for filename in sorted(os.listdir(os.path.dirname(__file__) + '/data')):
        if filename.endswith('.yaml'):
            name = filename.lstrip('01234567890').replace('.yaml', '')
            log.info('Inserting %s data...', name)
            loader.loadf(model.DBSession,
                         '%s/data/%s' % (os.path.dirname(__file__), filename))
    transaction.commit()

    run_tests = asbool(conf.get('websetup.run_tests', True))

    if run_tests:  # pragma: no cover
        log.info('Running test cases for half the submissions...')
        q = model.DBSession.query(model.Submission)
        for submission in sample(q.all(), q.count() / 2):
            submission.run_tests()
        transaction.commit()
Beispiel #3
0
def load_config(filename):
    conf = appconfig('config:' + os.path.abspath(filename))
    load_environment(conf.global_conf, conf.local_conf)
Beispiel #4
0
def load_config(filename):
    conf = appconfig('config:' + os.path.abspath(filename))
    load_environment(conf.global_conf, conf.local_conf)