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))
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))
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))
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))
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))
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))
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))
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))
def get_all_matching_configurations(): """Query for and find configurations (like Environments).""" return JsonResponse(queryFor(Configuration))
def get_projects(): """Query for available projects in slick""" return JsonResponse(queryFor(Project))
def get_testrungroups(): """Query for testrungroups.""" return JsonResponse(queryFor(TestrunGroup))
def get_users(): """Query for user accounts.""" return JsonResponse(queryFor(UserAccount))
def get_result_counts(): """Get the number of results for a query.""" return JsonResponse(queryFor(Result).count())
def get_events(): """Query for slick log events.""" return JsonResponse(queryFor(SlickLogEvent))