Пример #1
0
def get_testcases():
    """Query for testcases."""
    args = request.args
    if args.has_key('projectid'):
        args = args.to_dict()
        args['project.id'] = request.args['projectid']
        del args['projectid']
    return JsonResponse(queryFor(Testcase, args))
Пример #2
0
def get_testplans():
    """Query for existing testplans."""
    # for backwards compatibility
    args = request.args
    if args.has_key('projectid'):
        args = args.to_dict()
        args['project.id'] = request.args['projectid']
        del args['projectid']
    return JsonResponse(queryFor(TestPlan, args))
Пример #3
0
def get_pipelines():
    """Query for pipelines."""
    args = request.args.to_dict()
    if 'releaseid' in args:
        args['release.releaseId'] = args['releaseid']
        del args['releaseid']
    if 'testplanid' in args:
        args['testplanId'] = args['testplanid']
        del args['testplanid']

    return JsonResponse(queryFor(Pipeline, args))
Пример #4
0
def get_testruns():
    """Query for testruns."""
    args = request.args.to_dict()
    if 'releaseid' in args:
        args['release.releaseId'] = args['releaseid']
        del args['releaseid']
    if 'testplanid' in args:
        args['testplanId'] = args['testplanid']
        del args['testplanid']

    return JsonResponse(queryFor(Testrun, args))
Пример #5
0
def get_dashboards():
    """Query for a list of dashboards."""
    args = request.args
    type = BaseDashboard
    if args.has_key('config-type'):
        args = args.to_dict()
        if args['config-type'] in DashboardTypes:
            type = DashboardTypes[args['config-type']]
        else:
            args['configurationType'] = args['config-type']
        del args['config-type']
    return JsonResponse(queryFor(type, args))
Пример #6
0
def get_system_configurations():
    """Find various system configuration types."""
    args = request.args
    type = BaseSystemConfiguration
    if args.has_key('config-type'):
        args = args.to_dict()
        if args['config-type'] in SystemConfigurationTypes:
            type = SystemConfigurationTypes[args['config-type']]
        else:
            args['configurationType'] = args['config-type']
        del args['config-type']
    return JsonResponse(queryFor(type, args))
Пример #7
0
def get_results():
    """Query for results."""
    args = request.args.to_dict()
    if 'testrunid' in args:
        args['testrun.testrunId'] = request.args['testrunid']
        del args['testrunid']
    if 'excludestatus' in args:
        args['q'] = "ne(status,\"{}\")".format(args['excludestatus'])
        del args['excludestatus']
    if 'allfields' in args:
        del args['allfields']
    if "orderby" not in args:
        args["orderby"] = '-recorded'

    return JsonResponse(queryFor(Result, args))
Пример #8
0
def get_projects():
    """Query for available projects in slick"""
    if 'dashboard' in request.args:
        conn = connection.get_connection()
        result = conn[app.config['MONGODB_DBNAME']]['projects'].aggregate([
            {
                '$project': {
                    'name': '$name',
                    'releases': '$releases',
                    'count': {'$size': "$releases.builds"}
                }
            }
        ])
        return JsonResponse(list(result))
    else:
        return JsonResponse(queryFor(Project))
Пример #9
0
def get_all_matching_configurations():
    """Query for and find configurations (like Environments)."""
    return JsonResponse(queryFor(Configuration))
Пример #10
0
def get_projects():
    """Query for available projects in slick"""
    return JsonResponse(queryFor(Project))
Пример #11
0
def get_testrungroups():
    """Query for testrungroups."""
    return JsonResponse(queryFor(TestrunGroup))
Пример #12
0
def get_users():
    """Query for user accounts."""
    return JsonResponse(queryFor(UserAccount))
Пример #13
0
def get_result_counts():
    """Get the number of results for a query."""
    return JsonResponse(queryFor(Result).count())
Пример #14
0
def get_events():
    """Query for slick log events."""
    return JsonResponse(queryFor(SlickLogEvent))