Export to JSON fails if scenario has hooks

Bug #1734336 reported by Ilya Shakhat on 2017-11-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rally
High
Xiaofei.Wang

Bug Description

Export to JSON fails if scenario contains any hooks. The trace is following:
2017-11-24 13:44:58.608 9671 CRITICAL rally [-] Unhandled error: KeyError: 'action'
2017-11-24 13:44:58.608 9671 ERROR rally Traceback (most recent call last):
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/.tox/self/bin/rally", line 10, in <module>
2017-11-24 13:44:58.608 9671 ERROR rally sys.exit(main())
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/cli/main.py", line 40, in main
2017-11-24 13:44:58.608 9671 ERROR rally return cliutils.run(sys.argv, categories)
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/cli/cliutils.py", line 657, in run
2017-11-24 13:44:58.608 9671 ERROR rally ret = fn(*fn_args, **fn_kwargs)
2017-11-24 13:44:58.608 9671 ERROR rally File "<decorator-gen-35>", line 2, in report
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/cli/envutils.py", line 67, in default_from_global
2017-11-24 13:44:58.608 9671 ERROR rally return f(*args, **kwargs)
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/cli/commands/task.py", line 863, in report
2017-11-24 13:44:58.608 9671 ERROR rally open_it=open_it)
2017-11-24 13:44:58.608 9671 ERROR rally File "<decorator-gen-40>", line 2, in export
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/cli/envutils.py", line 67, in default_from_global
2017-11-24 13:44:58.608 9671 ERROR rally return f(*args, **kwargs)
2017-11-24 13:44:58.608 9671 ERROR rally File "<decorator-gen-39>", line 2, in export
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/plugins/__init__.py", line 55, in ensure_plugins_are_loaded
2017-11-24 13:44:58.608 9671 ERROR rally return f(*args, **kwargs)
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/cli/commands/task.py", line 1037, in export
2017-11-24 13:44:58.608 9671 ERROR rally output_dest=output_dest)
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/api.py", line 629, in export
2017-11-24 13:44:58.608 9671 ERROR rally api=self.api)
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/task/exporter.py", line 122, in make
2017-11-24 13:44:58.608 9671 ERROR rally api).generate()
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/plugins/common/exporters/json_exporter.py", line 101, in generate
2017-11-24 13:44:58.608 9671 ERROR rally "tasks": self._generate_tasks()}
2017-11-24 13:44:58.608 9671 ERROR rally File "/home/ishakhat/Work/rally/rally/plugins/common/exporters/json_exporter.py", line 46, in _generate_tasks
2017-11-24 13:44:58.608 9671 ERROR rally for h in workload["hooks"]]),
2017-11-24 13:44:58.608 9671 ERROR rally KeyError: 'action'

Steps to reproduce in dev environment:
 * Add the following line into rally/tests/ci/rally_self_job.sh:

   $RALLY task report --json --out self_test_report.json

 * Run self tests:

   tox -e self

The issue is reproducible on 0.10.0 and current master (8e610c4f).

Changed in rally:
importance: Undecided → High
Xiaofei.Wang (wangxf-s) on 2017-11-25
Changed in rally:
assignee: nobody → Xiaofei.Wang (wangxf-s)
status: New → In Progress
Xiaofei.Wang (wangxf-s) wrote :

There was some errors blocks the tests, the information like this:
Load duration: 0.656499
Full duration: 0.723518

HINTS:
* To plot HTML graphics with this data, run:
 rally task report dc6306b8-aadc-485a-8cf9-d7b2729bd126 --out output.html

* To generate a JUnit report, run:
 rally task export dc6306b8-aadc-485a-8cf9-d7b2729bd126 --type junit --to output.xml

* To get raw JSON output of task results, run:
 rally task report dc6306b8-aadc-485a-8cf9-d7b2729bd126 --json --out output.json

At least one workload did not pass SLA criteria.

ERROR: InvocationError: '/home/wangxf/rally/tests/ci/rally_self_job.sh /home/wangxf/rally/rally-jobs/self-rally.yaml'
_____________________________summary_______________________________________
ERROR: self: commands failed

Reviewed: https://review.openstack.org/524550
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=a6dfe34b97e272f03b0d90e2b11c67be103a946e
Submitter: Zuul
Branch: stable/0.10

commit a6dfe34b97e272f03b0d90e2b11c67be103a946e
Author: Ilya Shakhat <email address hidden>
Date: Fri Nov 24 17:34:10 2017 +0100

    Fix JSON generation when scenario has hooks

    Patch the code according to hooks' internal structure. Generate
    JSON report in `self` verification job.

    Change-Id: Ia431460439473ab93fc2384054ede91bd02713e3
    Closes-Bug: #1734336

Reviewed: https://review.openstack.org/522866
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=2c881858f9a62d6260ab128c3ceb8c55fd0cd597
Submitter: Zuul
Branch: master

commit 2c881858f9a62d6260ab128c3ceb8c55fd0cd597
Author: Ilya Shakhat <email address hidden>
Date: Fri Nov 24 17:34:10 2017 +0100

    Fix JSON generation when scenario has hooks

    Patch the code according to hooks' internal structure. Generate
    JSON report in `self` verification job.

    Change-Id: Ia431460439473ab93fc2384054ede91bd02713e3
    Closes-Bug: #1734336

Changed in rally:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments