예제 #1
0
def test_statuslogger_run():
    """validates we don't get a bad exit code"""
    parser = argparse.ArgumentParser(prog="mine", description="entry point")
    subparsers = parser.add_subparsers()
    statuslogger.build(subparsers)
    test_dir_1 = os.path.join(current_dir(__file__), '..', 'testdata', 'diag',
                              'statuslogger')
    args = parser.parse_args(
        ["statuslogger", "-d", test_dir_1, "-r", "histogram"])
    statuslogger.run(args)
예제 #2
0
def test_args():
    """verify schema args are wired up correctly"""
    parser = argparse.ArgumentParser(prog="mine", description="entry point")
    subparsers = parser.add_subparsers()
    statuslogger.build(subparsers)
    args = parser.parse_args([
        "statuslogger", "-f", "foo", "-d", "diag", "-s", "stages", "-r",
        "report"
    ])
    assert hasattr(args, "files")
    assert hasattr(args, "diag_dir")
    assert hasattr(args, "stages")
    assert hasattr(args, "reporter")
예제 #3
0
파일: __init__.py 프로젝트: phanirajl/sperf
def build(subparsers):
    """build up subcommands"""
    help_text = 'Cassandra and DSE Core specific sub-commands'
    cass_parser = subparsers.add_parser('core', help=help_text)

    def run(args):
        if env.DEBUG:
            print(args)
        cass_parser.print_help()

    cass_parser.set_defaults(func=run)
    cass_sub = cass_parser.add_subparsers(title='DSE Core/Cassandra Commands')
    bgrep.build(cass_sub)
    diag.build(cass_sub)
    gc.build(cass_sub)
    jarcheck.build(cass_sub)
    schema.build(cass_sub)
    slowquery.build(cass_sub)
    statuslogger.build(cass_sub)