예제 #1
0
def get_bugs_s(request, run_id, case_id, build_id, environment_id = 0):
    """
    Description: Get the list of bugs that are associated with this test case.

    Params:      $case_id - Integer: An integer representing the ID of the test case in the database.
                 $run_id - Integer: An integer representing the ID of the test run in the database.
                 $build_id - Integer: An integer representing the ID of the test build in the database.
                 $environment_id - Optional Integer: An integer representing the ID of the environment in the database.

    Returns:     Array: An array of bug object hashes.

    Example:
    >>> TestCaseRun.get_bugs_s(3113, 565, 72, 90)
    """
    from nitrate.apps.testcases.models import TestCaseBug
    try:
        tcr = gcr.pre_process_tcr_s(
            run_id = run_id,
            case_id = case_id,
            build_id = build_id,
            environment_id = environment_id,
        )
    except:
        raise

    query = {'case_run__case_run_id': tcr.case_run_id}
    return TestCaseBug.to_xmlrpc(query)
예제 #2
0
def get_bugs(request, run_ids):
    """
    *** FIXME: BUGGY IN SERIALISER - List can not be serialize. ***
    Description: Get the list of bugs attached to this run.

    Params:      $run_ids - Integer/Array/String: An integer representing the ID in the database
                                                  an array of integers or a comma separated list of integers.

    Returns:     Array: An array of bug object hashes.

    Example:
    # Get bugs belong to ID 12345
    >>> TestRun.get_bugs(12345)
    # Get bug belong to run ids list [12456, 23456]
    >>> TestRun.get_bugs([12456, 23456])
    # Get bug belong to run ids list 12456 and 23456 with string
    >>> TestRun.get_bugs('12456, 23456')
    """
    from nitrate.apps.testcases.models import TestCaseBug
    trs = TestRun.objects.filter(
        run_id__in = pre_process_ids(value = run_ids)
    )
    tcrs = TestCaseRun.objects.filter(
        run__run_id__in = trs.values_list('run_id', flat = True)
    )

    query = {'case_run__case_run_id__in': tcrs.values_list('case_run_id', flat = True)}
    return TestCaseBug.to_xmlrpc(query)
예제 #3
0
def get_bugs(request, case_run_id):
    """
    Description: Get the list of bugs that are associated with this test case.

    Params:      $case_run_ids - Integer: An integer representing the ID in
                               the database for this case-run.

    Returns:     Array: An array of bug object hashes.

    Example:
    >>> TestCase.get_bugs(12345)
    """
    from nitrate.apps.testcases.models import TestCaseBug
    try:
        tcr = gcr.pre_process_tcr(case_run_id = case_run_id)
    except:
        raise

    query = {'case_run__case_run_id': tcr.case_run_id}
    return TestCaseBug.to_xmlrpc(query)
예제 #4
0
def get_bugs(request, case_ids):
    """
    Description: Get the list of bugs that are associated with this test case.

    Params:      $case_ids - Integer/String: An integer representing the ID in the database

    Returns:     Array: An array of bug object hashes.

    Example:
    # Get bugs belong to ID 12345
    >>> TestCase.get_bugs(12345)
    # Get bug belong to case ids list [12456, 23456]
    >>> TestCase.get_bugs([12456, 23456])
    # Get bug belong to case ids list 12456 and 23456 with string
    >>> TestCase.get_bugs('12456, 23456')
    """
    from nitrate.apps.testcases.models import TestCaseBug

    tcs = TestCase.objects.filter(
        case_id__in = pre_process_ids(value = case_ids)
    )

    query = {'case__case_id__in': tcs.values_list('case_id', flat=True)}
    return TestCaseBug.to_xmlrpc(query)