summaryrefslogtreecommitdiffstats
path: root/qtip/cli
diff options
context:
space:
mode:
Diffstat (limited to 'qtip/cli')
-rw-r--r--qtip/cli/commands/cmd_metric.py (renamed from qtip/cli/helper.py)25
-rw-r--r--qtip/cli/commands/cmd_perftest.py58
-rw-r--r--qtip/cli/commands/cmd_plan.py3
3 files changed, 24 insertions, 62 deletions
diff --git a/qtip/cli/helper.py b/qtip/cli/commands/cmd_metric.py
index acfecf8d..7f5c18d3 100644
--- a/qtip/cli/helper.py
+++ b/qtip/cli/commands/cmd_metric.py
@@ -7,8 +7,27 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import os
+import click
+from qtip.cli.entry import Context
-def fetch_root():
- return os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'benchmarks/')
+pass_context = click.make_pass_decorator(Context, ensure=False)
+
+
+@click.group()
+@pass_context
+def cli(ctx):
+ ''' Performance Metrics Group '''
+ pass
+
+
+@cli.command('list', help='List all the Metric Groups')
+@pass_context
+def cmd_list(ctx):
+ pass
+
+
+@cli.command('run', help='Run tests to collect Performance Metrics')
+@pass_context
+def cmd_run(ctx):
+ pass
diff --git a/qtip/cli/commands/cmd_perftest.py b/qtip/cli/commands/cmd_perftest.py
deleted file mode 100644
index 129ee2d9..00000000
--- a/qtip/cli/commands/cmd_perftest.py
+++ /dev/null
@@ -1,58 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-from prettytable import PrettyTable
-import yaml
-import click
-import os
-from qtip.cli import helper
-
-
-class PerfTest:
-
- def __init__(self):
- self.path = os.path.join(helper.fetch_root(), 'perftest/summary')
-
- def list(self):
- table = PrettyTable(["Name", "Description"])
- table.align = 'l'
- with open(self.path) as tests:
- line = tests.read()
- data = yaml.safe_load(line)['test_cases']
- for i in range(0, len(data)):
- points = data[i]
- table.add_row([points['name'], points['description']])
- click.echo(table)
-
- def run(self):
- click.echo("Run a perftest")
-
-
-@click.group()
-def cli():
- pass
-
-
-@cli.group()
-@click.pass_context
-def perftest(ctx):
- pass
-
-
-_perftest = PerfTest()
-
-
-@perftest.command("list", help="Lists all perftest benchmarks.")
-def list():
- _perftest.list()
-
-
-@perftest.command("run", help="Executes a single perftest benchmark.")
-def execute():
- _perftest.run()
diff --git a/qtip/cli/commands/cmd_plan.py b/qtip/cli/commands/cmd_plan.py
index 01bf8251..6f622e5a 100644
--- a/qtip/cli/commands/cmd_plan.py
+++ b/qtip/cli/commands/cmd_plan.py
@@ -9,7 +9,8 @@
import click
from prettytable import PrettyTable
-from qtip.runner.plan import Plan
+
+from qtip.loader.plan import Plan
@click.group()