Add task command rally task import
This command could be used to import json results of a test into rally database. example: rally task import --file <json_file> [--deployment <uuid>] [--tag <tag>] Change-Id: Ie2db6ef19d73ca49e0bf0a4e888f65c07cec3a6c
This commit is contained in:
parent
63b39e9df1
commit
4e047bff7c
@ -32,6 +32,7 @@ _rally()
|
||||
OPTS["task_delete"]="--force --uuid"
|
||||
OPTS["task_detailed"]="--uuid --iterations-data"
|
||||
OPTS["task_export"]="--uuid --connection"
|
||||
OPTS["task_import"]="--file --deployment --tag"
|
||||
OPTS["task_list"]="--deployment --all-deployments --status --uuids-only"
|
||||
OPTS["task_report"]="--tasks --out --open --html --html-static --junit"
|
||||
OPTS["task_results"]="--uuid"
|
||||
|
@ -123,6 +123,7 @@ function run () {
|
||||
cp $TASK rally-plot/task.txt
|
||||
tar -czf rally-plot/plugins.tar.gz -C $RALLY_PLUGINS_DIR .
|
||||
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
|
||||
rally task detailed > rally-plot/detailed.txt
|
||||
gzip -9 rally-plot/detailed.txt
|
||||
|
@ -171,6 +171,20 @@ class TaskTestCase(unittest.TestCase):
|
||||
self.assertRaises(utils.RallyCliError,
|
||||
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):
|
||||
rally = utils.Rally()
|
||||
self.assertRaises(utils.RallyCliError,
|
||||
|
Loading…
x
Reference in New Issue
Block a user