How to use the stestr.output.ReturnCodeToSubunit function in stestr

To help you get started, we’ve selected a few stestr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mtreinish / stestr / stestr / commands / run.py View on Github external
def run_tests():
            run_proc = [('subunit', output.ReturnCodeToSubunit(
                subprocess.Popen(run_cmd, shell=True,
                                 stdout=subprocess.PIPE)))]
            return load.load(in_streams=run_proc,
                             subunit_out=subunit_out,
                             repo_type=repo_type,
                             repo_url=repo_url, run_id=combine_id,
                             pretty_out=pretty_out,
                             color=color, stdout=stdout, abbreviate=abbreviate,
                             suppress_attachments=suppress_attachments,
                             all_attachments=all_attachments)
github mtreinish / stestr / stestr / commands / run.py View on Github external
def run_tests():
            if not dynamic or cmd.concurrency == 1:
                run_procs = [('subunit',
                              output.ReturnCodeToSubunit(
                                  proc,
                                  dynamic=False)) for proc in cmd.run_tests()]
            else:
                run_procs = [('subunit',
                              output.ReturnCodeToSubunit(
                                  os.fdopen(proc['stream']),
                                  proc['proc'])) for proc in cmd.run_tests()]
            if not run_procs:
                stdout.write("The specified regex doesn't match with anything")
                return 1
            return load.load((None, None), in_streams=run_procs,
                             subunit_out=subunit_out,
                             repo_type=repo_type,
                             repo_url=repo_url, run_id=combine_id,
                             pretty_out=pretty_out, color=color, stdout=stdout,
                             abbreviate=abbreviate,
                             suppress_attachments=suppress_attachments,
                             all_attachments=all_attachments)
github mtreinish / stestr / stestr / commands / run.py View on Github external
def run_tests():
            if not dynamic or cmd.concurrency == 1:
                run_procs = [('subunit',
                              output.ReturnCodeToSubunit(
                                  proc,
                                  dynamic=False)) for proc in cmd.run_tests()]
            else:
                run_procs = [('subunit',
                              output.ReturnCodeToSubunit(
                                  os.fdopen(proc['stream']),
                                  proc['proc'])) for proc in cmd.run_tests()]
            if not run_procs:
                stdout.write("The specified regex doesn't match with anything")
                return 1
            return load.load((None, None), in_streams=run_procs,
                             subunit_out=subunit_out,
                             repo_type=repo_type,
                             repo_url=repo_url, run_id=combine_id,
                             pretty_out=pretty_out, color=color, stdout=stdout,
                             abbreviate=abbreviate,
github mtreinish / stestr / stestr / utils.py View on Github external
def _iter_internal_streams(input_streams, stream_type):
    streams = []
    for in_stream in input_streams:
        if in_stream[0] == stream_type:
            streams.append(in_stream[1])
    for stream_value in streams:
        if isinstance(stream_value, output.ReturnCodeToSubunit):
            if getattr(stream_value.source, 'detach', None):
                yield stream_value.source.detach()
            else:
                yield stream_value.source
        elif getattr(stream_value, 'read', None):
            yield stream_value
        else:
            yield io.BytesIO(stream_value)