Example #1
0
def list_tests(context, id):
    j = base.get(context, RESOURCE, id=id).json()['job']
    result = {'tests': []}
    result['tests'] += jobdefinition.get_tests(
        context, j['jobdefinition_id']).json()['tests']
    result['tests'] += remoteci.get_tests(
        context, j['remoteci_id']).json()['tests']
    return result
Example #2
0
def get_full_data(context, id):
    # Get the job with embed on test and remoteci
    embed = 'jobdefinition,remoteci'
    job = base.get(context, RESOURCE, id=id, embed=embed).json()['job']
    # Get the components of the job
    job_components = get_components(context, id).json()['components']

    # Aggregate the data of each resource
    full_data = {'remoteci': job['remoteci'],
                 'jobdefinition': job['jobdefinition'],
                 'tests': [],
                 'components': []}

    for component in job_components:
        full_data['components'].append(component)

    return full_data
Example #3
0
def get(context, id, **kwargs):
    return base.get(context, RESOURCE, id=id, **kwargs)
Example #4
0
def get(context, id, where=None, embed=None):
    return base.get(context, RESOURCE, id=id, where=where, embed=embed)
Example #5
0
def list_tests(context, id, **kwargs):
    j = base.get(context, RESOURCE, id=id, **kwargs).json()["job"]
    result = {"tests": []}
    result["tests"] += topic.list_tests(context, j["topic_id"]).json()["tests"]
    result["tests"] += remoteci.list_tests(context, j["remoteci_id"]).json()["tests"]
    return result
Example #6
0
def list(context):
    return base.get(context, RESOURCE)