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
This commit is contained in:
Ilya Shakhat 2017-11-24 17:34:10 +01:00 committed by Andrey Kurilin
parent 66f0b11e59
commit 03c58ca604

View File

@ -16,8 +16,10 @@ TASK_FILE=$1
PLUGIN_PATHS=rally-jobs/plugins PLUGIN_PATHS=rally-jobs/plugins
if [ -n "$ZUUL_PROJECT" ]; then if [ -n "$ZUUL_PROJECT" ]; then
HTML_REPORT=testr_results.html HTML_REPORT=testr_results.html
JSON_REPORT=testr_results.json
else else
HTML_REPORT=rally_self_results.html HTML_REPORT=rally_self_results.html
JSON_REPORT=rally_self_results.json
fi fi
RND=$(head /dev/urandom | tr -dc a-z0-9 | head -c 5) RND=$(head /dev/urandom | tr -dc a-z0-9 | head -c 5)
TMP_RALLY_CONF="/tmp/self-rally-$RND.conf" TMP_RALLY_CONF="/tmp/self-rally-$RND.conf"
@ -36,9 +38,11 @@ $RALLY -d deployment create --name=self
# Run task # Run task
$RALLY -d --plugin-paths=$PLUGIN_PATHS task start $TASK_FILE $RALLY -d --plugin-paths=$PLUGIN_PATHS task start $TASK_FILE
$RALLY task report --html-static --out $HTML_REPORT $RALLY task report --html-static --out $HTML_REPORT
$RALLY task report --json --out $JSON_REPORT
if [ -n "$ZUUL_PROJECT" ]; then if [ -n "$ZUUL_PROJECT" ]; then
gzip -9 -f $HTML_REPORT gzip -9 -f $HTML_REPORT
gzip -9 -f $JSON_REPORT
fi fi
# Check sla (this may fail the job) # Check sla (this may fail the job)