Merge "Add task command rally task import
"
This commit is contained in:
commit
1b384fe940
@ -32,6 +32,7 @@ _rally()
|
|||||||
OPTS["task_delete"]="--force --uuid"
|
OPTS["task_delete"]="--force --uuid"
|
||||||
OPTS["task_detailed"]="--uuid --iterations-data"
|
OPTS["task_detailed"]="--uuid --iterations-data"
|
||||||
OPTS["task_export"]="--uuid --connection"
|
OPTS["task_export"]="--uuid --connection"
|
||||||
|
OPTS["task_import"]="--file --deployment --tag"
|
||||||
OPTS["task_list"]="--deployment --all-deployments --status --uuids-only"
|
OPTS["task_list"]="--deployment --all-deployments --status --uuids-only"
|
||||||
OPTS["task_report"]="--tasks --out --open --html --html-static --junit"
|
OPTS["task_report"]="--tasks --out --open --html --html-static --junit"
|
||||||
OPTS["task_results"]="--uuid"
|
OPTS["task_results"]="--uuid"
|
||||||
|
@ -123,6 +123,7 @@ function run () {
|
|||||||
cp $TASK rally-plot/task.txt
|
cp $TASK rally-plot/task.txt
|
||||||
tar -czf rally-plot/plugins.tar.gz -C $RALLY_PLUGINS_DIR .
|
tar -czf rally-plot/plugins.tar.gz -C $RALLY_PLUGINS_DIR .
|
||||||
rally task results | python -m json.tool > rally-plot/results.json
|
rally task results | python -m json.tool > rally-plot/results.json
|
||||||
|
rally task import --file rally-plot/results.json
|
||||||
gzip -9 rally-plot/results.json
|
gzip -9 rally-plot/results.json
|
||||||
rally task detailed > rally-plot/detailed.txt
|
rally task detailed > rally-plot/detailed.txt
|
||||||
gzip -9 rally-plot/detailed.txt
|
gzip -9 rally-plot/detailed.txt
|
||||||
|
@ -171,6 +171,20 @@ class TaskTestCase(unittest.TestCase):
|
|||||||
self.assertRaises(utils.RallyCliError,
|
self.assertRaises(utils.RallyCliError,
|
||||||
rally, "task results --uuid %s" % FAKE_TASK_UUID)
|
rally, "task results --uuid %s" % FAKE_TASK_UUID)
|
||||||
|
|
||||||
|
def test_import_results(self):
|
||||||
|
rally = utils.Rally()
|
||||||
|
cfg = self._get_sample_task_config()
|
||||||
|
config = utils.TaskConfig(cfg)
|
||||||
|
rally("task start --task %s" % config.filename)
|
||||||
|
json_report = rally.gen_report_path(extension="json")
|
||||||
|
with open(json_report, "w+") as f:
|
||||||
|
f.write(rally("task results"))
|
||||||
|
import_print = rally("task import --file %s" % json_report)
|
||||||
|
self.assertIn("successfully", import_print)
|
||||||
|
task_uuid = re.search("UUID:\s([a-z0-9\-]+)", import_print).group(1)
|
||||||
|
self.assertIn("Dummy.dummy_random_fail_in_atomic",
|
||||||
|
rally("task results --uuid %s" % task_uuid))
|
||||||
|
|
||||||
def test_abort_with_wrong_task_id(self):
|
def test_abort_with_wrong_task_id(self):
|
||||||
rally = utils.Rally()
|
rally = utils.Rally()
|
||||||
self.assertRaises(utils.RallyCliError,
|
self.assertRaises(utils.RallyCliError,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user