45 Commits

Author SHA1 Message Date
Alexander Maretskiy
1d7637611e [Tests] Fix functional test_time_hook
Hook results order can differ depending on which hook has
finished first, so functional test can fail sometimes.
This is fixed by sorting results.

Change-Id: Ie6dc1d85e6107dddaa464019b53465c287d0f345
2016-10-18 15:33:33 +03:00
Alexander Maretskiy
7c9705d670 [Hooks][Reports] Show Hooks output in HTML report
This adds support of hooks output (both "additive"
and "complete") to HTML report.

Tab "Hooks" with output charts appears in case if
hook has saved some output.

Change-Id: I9f14cec23da51ff1603d04338b8f95e6ae2a6801
2016-10-06 15:25:01 +03:00
Andrey Kurilin
c39123f4ae Refactor hook stuff
- Triggers should care about triggering(launching) hooks, not only about
  checking when hooks should be launched. This logic is moved from
  HookExecutor to Triggers
- Remove "n/a" status of Hooks. There is no possible situation when such
  status can be configured. Also, "success" status is used now as default
  status.
- `sys.call` saves output for success call too.
- `get_configured_event_type` method of Trigger is renamed to
  `get_listening_event`.
- Task Engine should not launch hook executor and timers if hooks section
  is not configured
- HookExecutor doesn't create and start timer thread if "time" unit is not
  configured in any hook.
- Results of Hooks relate to each particular trigger, so they are stored in
  trigger object and HookExecutor obtains results from there.

Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>

Change-Id: I2ce6132e101790af75ed0899bc4d5e3ddb00d0d7
2016-10-01 20:07:11 +03:00
Anton Studenov
7aac24de75 Use hook executer inside task engine
Added code that uses HookExecuter to run hooks.
Added functional tests.

implements spec: hook_section

Change-Id: I7b9a8bfd766c3044d6d824f8b4f2cbc4665c12bf
2016-09-22 17:12:59 +03:00
Béla Vancsics
85b392f46c Use more specific asserts in tests
Instead of assertTrue and assertFalse use more specific asserts.
They are compatible with Python 2.7[1] and 3.4[2]

[1]: https://docs.python.org/2.7/library/unittest.html
[2]: https://docs.python.org/3.4/library/unittest.html

Change-Id: Id839997ff21c2b1fcf6701f4bc47babe61623817
2016-08-22 13:46:50 +02:00
Anton Studenov
9d0ed2cc7d Add performance degradation SLA plugin
This adds SLA plugin that finds minimum and maximum duration of
iterations completed without errors during Rally task execution.
Assuming that minimum duration is 100%, it calculates
performance degradation against maximum duration.

Example config:
  sla:
    performance_degradation:
      max_degradation: 75

Spec: sla_pd_plugin
Change-Id: Ieedba7be72364f5599a3c0cf79f5f494a7391ea0
2016-07-26 12:47:53 +03:00
Alexander Maretskiy
f03fcccc69 [Reports][CLI] Introduce Trends report
New HTML report for statistics trends for given tasks
which is generated by cli command "rally task trends".

Blueprint: trends-report
Change-Id: I0805058e8bd225796b02516fad094d73037d5495
2016-05-20 18:25:20 +03:00
Roman Vasilets
e02d83ca41 Fix random fail on rally-ci cli tests
To see what we will get randomly on any patch please go to
http://r-ci.tk/logs/zXqaxKhryL/rally-dsvm-pg-py34-cli/console.log

Change-Id: If03cc65770e4aaddb04210a35ae8f17c825657fb
2016-05-11 17:35:25 +03:00
Chris St. Pierre
2f780080cc Fix empty config error message
Broken by bc819cb, which merged shortly before 8c2b6c1.

Change-Id: I5b95993ee69a2082b3290aafe93643855ff7f56a
2016-04-19 11:21:21 -05:00
Roman Vasilets
2d97ff3cbe Add functional tests to task detailed with errors
Add functional test for cli testcase `rally task detailed`
with errors

Change-Id: I81c872c5c6c6df6f3ac255927c78d976a6b9314d
2016-04-09 00:21:35 +03:00
Roman Vasilets
e37a78443b Add task exporter to the file system
This is the first task exporter plugin. It used to export rally task
results to the file in json format.

Change-Id: I25117933ac0881453a001d96600d4c95e6064fff
2016-03-28 17:00:52 +03:00
Illia Khudoshyn
b11e8aa30d Add Workload object
The patch introduces Workload model
instead of regular dict that was used to describe
scenario configuration in TaskEngine.
As a side effect it allows to fix subtask representaion
in generated reports and other rally outputs.

Change-Id: I62148707c89f575f83da11e34d0d193e716e8249
2015-12-04 13:58:02 +00:00
Alexander Maretskiy
081daa9cff [Reports] Add an option for embedding JS/CSS libs into report
This change allows running command `report' with `--html-static'
option so all required JS/CSS will be embedded to HTML file.
Having all required CSS/JS loaded directly from HTML makes
report working without access to the Internet.

Added third-party libraries files:
    rally/ui/templates/libs/nv.d3.1.1.15-beta.min.css
    rally/ui/templates/libs/angular.1.3.3.min.js
    rally/ui/templates/libs/nv.d3.1.1.15-beta.min.js
    rally/ui/templates/libs/d3.3.4.13.min.js

Notes about licenses compatibility:
    https://angularjs.org/
    https://github.com/angular/angular.js/blob/master/LICENSE
    The MIT License
    compatible with Apache License Version 2.0
    according to http://www.apache.org/legal/resolved.html

    http://d3js.org/
    https://github.com/mbostock/d3/blob/master/LICENSE
    BSD 3-clause License
    compatible with Apache License Version 2.0
    according to http://www.apache.org/legal/resolved.html

    http://nvd3.org/
    https://github.com/novus/nvd3/blob/master/LICENSE.md
    Apache License Version 2.0

Change-Id: I8913ecc585ee17affb1d8a0b29bb475c1e07427f
Closes-Bug: #1505533
2015-11-24 11:33:25 +02:00
Chris St. Pierre
d025cb8e68 Implement new random name generator for keystone scenarios
This switches keystone scenarios to using the new consistent random
name generator.

Implements blueprint: consistent-resource-names
Change-Id: Ie753b6c6b570ce40bd17df545df4a2cde2c4bc50
2015-10-16 08:00:21 -05:00
Illia Khudoshyn
3018ab3472 Add task format converter
Task and SubTask classes are introduced that
incapsulate differences in formats of task
configuration and perform corresponding conversion.

Change-Id: I93ccdcd51296ace64c1fb99059080d47e1853d93
2015-10-12 14:31:57 +03:00
Andrey Kurilin
272179a7ee Implementation of 'rally task abort' command
When run with the --soft key, the 'rally task abort' command should
wait until the currently running benchmark is finished, otherwise
the command interrupts benchmarking immediately after running
scenario iterations are finished.

Add Task get_status(uuid) method to db sqlalchemy api.

NOTE: db schema is updated with new Task statuses. You should execute
`rally-manage db recreate` to fix existing databases.

Co-Authored-By: Mikhail Dubov <mdubov@mirantis.com>
Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
Co-Authored-By: Roman Vasilets <rvasilets@mirantis.com>

Change-Id: Ia07d165037eb98a9542ffdc91b7279ef3c3d496f
2015-09-23 15:19:23 +03:00
Andrey Kurilin
0f96f9cce7 Don't change global environment in functionaltests
Change-Id: Ifab9260fd8d195a61e6b22ce54e9fe2f3015d523
2015-06-18 18:26:12 +03:00
Jenkins
0c267c8168 Merge "Add functional test for --plugin-paths parameter" 2015-06-05 23:44:13 +00:00
Roman Vasilets
d9be20e86b Add functional test for --plugin-paths parameter
Change-Id: I3a847ae490657be47b11cc178692658d8304556e
2015-06-05 01:21:26 +03:00
Cyril Roelandt
ca17f8a8c2 task report: generate a JUnit report
This allows users to feed reports to tools such as Jenkins.

Change-Id: I55f5fa282af8a8130be5c07bcdf8030fc591f6b7
Implements: blueprint task-report-junit
2015-05-29 12:11:19 +02:00
Sergey Skripnick
54350da689 Rename rally.cmd to rally.cli
There is module 'cmd' in standard library, and unittest's discover
does modify sys.path when running tests. This cause errors when running
unit tests in some environments (E.g. pycharm)

Change-Id: I4fd2d271da1b7fd300fbbeb6107aa958e716fd2b
Closes-Bug: 1457162
2015-05-21 18:14:19 +03:00
Jenkins
fd2e77a00d Merge "Data structs declared with constructor replaced with literal" 2015-04-15 02:35:30 +00:00
Hugh Ma
6a3f210375 Data structs declared with constructor replaced with literal
Changes:
  - list() declarations replaced with []
  - dict() declarations replaced with {}
  - Added N351 to hacking for literal rule along with checks, test hacking, and to readme
  - Minor fix to incorrect path in hacking guidelines pointing to test_hacking.py

Change-Id: Ie7b9201d61b6f2024217b6f4117605eb52fa916a
Closes-Bug: #1437515
2015-04-14 10:49:17 -07:00
Andrey Kurilin
c0082aa15e Add aborted and broken flags to sla checker
"aborted" flag will be used for saving information about situation when
task was stopped due to "abort-on-sla" option.

"broken" flag will be used for saving information about situtaion when
something gone wrong in context or runner.

Also, this patch removes two unstable scenarios.

Change-Id: I9e0c16c48af3643b15c8f5a241535bfb4540332c
2015-04-14 13:24:27 +03:00
Andrew McDermott
6b027669db Add a --uuids-only option to rally task list
This option prints the list of UUIDs only.

The motivation for this option is scripting, for example:

   for x in $(rally task list --status passed --uuids-only); \
   do \
       rally task report --tasks $x --out $x.html; \
   done

Change-Id: Ia967071bc3e4454116adbc59a790ab684efff15c
Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
2015-03-31 15:56:21 +00:00
Jenkins
6b4da5dae1 Merge "Add Python 3.4 as supported interpreters" 2015-03-10 19:57:05 +00:00
Andrey Kurilin
b048519485 Add Python 3.4 as supported interpreters
Rally code is python 3.4 compatible(required several small fixes, see a list
below for more details), so we can mention this great information in
setup.cfg file.

Fixed py34 incompatibe issues:
 - usage of OrderedDict for storing task results. Order of such results as
AtomicActions is important.
 - printed sla results are sorted by criterea name, so the results are equal
in all envs

Change-Id: I5f031170218ef4c2daf0ce0c2c391822218643dd
2015-03-10 14:43:01 +02:00
Boris Pavlovic
ec6131381d Unify RPS and constant runners and tune constant runner
The reason why we need to refactor constant runner are as follows:

1) using processes to genereate load is to expensive

The optimal way to do thing is to create N processes
(where N is amount of cpu) and use threads.

2) using multiprocessing.Pool() doesn't allow us to
make proper timeouts

3) using multprocessing.Pool() doesn't allow us to
stop imidiatelly load (when we run runner.abort())

What has also been done in this patch:

1) Unification of common part between rps and new constant
   runner

2) Using RAMInt for iterations counting in the RPS runner as well

3) Added a "sleep" parameter in Dummy.dummy_exception. This will allow us
   a better functional testing for the "--abort-on-sla-failure" feature.

4) Minor fix in SLA

ToDo in next patches:

* Implement timeouts
* Work on the constant for duration runner

Co-Authored-By: Boris Pavlovic <boris@pavlovic.me>
Co-Authored-By: Mikhail Dubov <mdubov@mirantis.com>

Change-Id: I49bcc8694e10b3bbb8dcf5c9fe52e29e48a985f3
2015-03-07 01:05:23 +03:00
Jenkins
32c02ab658 Merge "Add aliases "rally task|deployment|verify use"" 2015-02-19 13:37:42 +00:00
Jenkins
9d6f497f79 Merge "Fix rally task detailed --iterations-data" 2015-02-16 11:06:30 +00:00
Mikhail Dubov
e188a81a5f Abort scenario execution on SLA failure
* Change the api of the SLA classes:
  - add_iteration() - processes a single iteration result from the queue
  - result() - return the SLAResult based on the data processed so far.
    It now also returns a successful result in case there was no iterations
    data.

* Add a new SLAChecker class:
  - add_iteration() - processes a single iteration result with different SLAs
  - results() - return cumulative SLA results for all SLAs

* Change the benchmark engine so that it supports scenario runner aborts
  on SLA failure

* Support the "abort on SLA failure" feature in the CLI:
    rally task start ... --abort-on-sla-failure

* Modify the SLA detailed messages (cleaner text and less decimal places)

* Update unit and functional tests correspondingly. Also remove the usage of the
  deprecated "max_failure_percent" SLA from the functional tests.

Change-Id: I91894a81649815428fd1ac7afcfce9cf47160fc9
2015-02-13 14:29:32 +03:00
Mikhail Dubov
dc59e3e981 Fix rally task detailed --iterations-data
In case an input scenario had no atomic actions, the "--iterations-data"
table contained "n/a" values. Here we fix this and enhance the corresponding
functional tests.

Change-Id: Ic4d3809f64bcfcbce804023de7ce0c2d1f6e965f
Closes-Bug: 1420703
2015-02-12 03:01:26 +03:00
Oleh Anufriiev
89bd4aa865 Publishing functional tests reports
Change-Id: I4b7543e7244ecc776e6d0955c0428423cca3ad3c
2015-02-10 06:49:46 +02:00
jacobliberman
1298d86398 Replace ' with " in tests/unit/[aas,cmd]
Partial bug: 1405884

Change-Id: I820e5c60b14f323a7d71f175eefe4560552c6f46
2015-02-04 10:41:00 -06:00
Olga Kopylova
92ef11be17 Add aliases "rally task|deployment|verify use"
Add alias "rally task use" for "rally use task",
"rally deployment use" for "rally use deployment"
and "rally verify use" for "rally use verification"

Change-Id: I6e63f4b60e1faf794f050f98be127744fe8011a4
2015-02-02 12:20:47 +02:00
Boris Pavlovic
254c0d68e8 Input task templates and task cmd cleanup
Implement task templates based on jinja2.

This allow us to pass as a task jinja2 template
and it's argument via arguments --task-args and
--task-args-file that should be dict in JSON or YAML
presentations.

So now command looks like:

rally task start <file> --task-args <template-args-json-or-yaml> \
  --task-args-file <file-with-args-in-json-yaml>

If both --task-args and --task-args-file then file dict is updated
by task args file.

Extend rally CI performance job. Now we can set template args
via file with name: ${TASK}_args.yaml

Bonus:
* Better message on InvalidTask format
* Remove redudant catch of "keyboardinterrupt"
  it should be implement in different way.
* Replace ' -> " in rally.cmd.commands.task
  and tests.unit.cmd.commands.task
* Imporve a bit CLI messages on rally task start
* Remove old plot2html command (it's enough deprecated)
* Improve test coverage of rally/cmd/commands/task
* Fix rally/cmd/commands/validate return 1 if bad format
* Write errors to stderr (in whole cmd/commands/task.py)

Change-Id: I7dadf2986bb10407865bc73bb2fb8c96a5162d9a
2015-01-15 16:29:34 +03:00
Oleh Anufriiev
0d3a3524b1 Support generation of report from N task
Added ability to build one report from
  results of multiple tasks. Tasks may be passed as UUID or as previously
  saved json results. Also it may be mixed list of UUIDs and file pathes.

  Closes bug 1406585

Change-Id: I11f2ca3ee6b868b79f91a4fa95e6a9ea918a79b0
2015-01-08 16:17:31 +02:00
Roman Vasilets
762b6aac6b 100% coverage in functional tests
In Rally, we have functional tests that run different CLI
commands and check that the CLI output contains all the expected
data.

We need to ensure that every single subcommand of “rally task”,
“rally deployment” etc. (for example, “rally task start”, “rally
task report”) is covered in these functional test with all possible
parameters usage (e.g. the “--deployment” parameter in “rally task
start --deployment <name>” didn’t get tested, which has lead to
errors recently).

Change-Id: I654ad4317b2d061dd899f5fdfb028cda50af9b8b
2014-12-13 11:15:52 +02:00
Li Ma
fc24133c6b Change TaskNotFound traceback info to user-friendly message
In some common cases (like detecting absense of requested object),
CLI shows exception traceback instead of just a simple message
that "<something> is not found".

This traceback is redundant and confusing users - they think that
rally went into trouble, but all that actually happened is wrong
uuid specified.

The traceback must be shown only with `--debug' option explicitly
specified.

The unit test and functional test are both provided.

Change-Id: I32811974d88f414c4508dfed19a7c5dc5e80fd98
Closes-Bug: #1392354
2014-12-10 20:30:44 -08:00
temujin
0b5379e46a add 'rally task list' filters
Add ability to filter tasks by status and/or deployment.

Change-Id: I663bddf73a4d5be1b24e712ddcde9efdf494f005
2014-12-02 13:16:53 +02:00
Alexander Maretskiy
473b9dd155 Add benchmark overview page to html report
The overview page shows all scenarios and their summarized results
in single table, so it is easier to understand the whole result
and compare specific scenarios.

Also, there are some minor features and fixes in html report.

Changes:
  * Benchmark overview page
  * Task input file is available now
  * Scenario full duration is added to overview
  * Scenario duration is renamed to `Load duration'
  * Overview is sortable
  * Fix: control from browser history: back/forward buttons now work
  * Fix: durations are reset for iterations with errors
  * AngularJS version is updated to release 1.3.3
  * task sla_check output: column `success' with options True/False
    is renamed to `status' with options PASS/FAIL

Change-Id: I0eb7af01432c9c10e4ec55720bb53417478a5789
2014-11-27 19:47:32 +02:00
Alexander Maretskiy
093e36c9d3 Base HTML templates and improvements for task report
This patch adds UI templates directory and utils,
which serve and unify HTML generation.

Also, there are some fixes and improvements for HTML task report.

In this patch:
  * Base mako templates (package rally.ui)
  * Rework tests/ci/rally-gate templates
    in order to use base template with generic header and styles
  * Show scenario errors (if any) in task report tab
  * Show scenario output (if any) in task report tab
  * Show SLA data in Overview tab
  * Show total scenario duration value (after the scenario name, above tabs)
  * If got some iteration error, save exception class name in the database
    instead of its repr()
  * Prevent layout from breaking and show proper message if JS libs
    can not be loaded for some reason
  * Fix bug 1387661 - the cause of the bug is wrong input json data,
    generated by plot.py. This happens when some atomic actions data
    missed (which is a result of scenario errors) - and we have different
    atomic actions sets between iterations. The fix saves atomic actions
    integrity by adding missed atomic actions (with 0 value).
  * Fix: if unexistend task uuid is specified in `task report' command,
    then proper exception is raised

Closes-Bug: 1387661

Change-Id: I4bcbf86e6fad844e6752306eb6c1ccfefa6c6909
2014-11-18 19:32:30 +02:00
Alexander Maretskiy
f6650be203 Improvements for task plot2html
CLI command `task plot2html' is renamed to `task report',
however old name is still available for compatibility.

HTML output of benchmark results is reworked:
     * scenario select dropdown is changed to aside menu,
       with scenarios methods grouped by classes
     * initially select scenario from URL hash
     * scenario results are divided into tabs
     * new layout and styling, from bootstrap framework
     * jQuery is removed
     * AngularJS is used for rendering all the data

Change-Id: I00db7016900952f397681045ff99d07a0714fafe
2014-10-14 15:29:43 +03:00
Sergey Skripnick
7f85fe911c Display proper missing argument name
Find and show argument name instead of showing argument of 'dest'
Add functional test for this
Remove test_cli_utils.py -> utils.py because this actually utils,
not tests.

Change-Id: Icc138ecf40b4929826efcad52c135c8809348d20
Closes-Bug: #1380562
2014-10-13 20:48:13 +03:00
Sergey Skripnick
c81e8a5f8b Reorganize test module structure
Moved test modules:
 tests/             ->  tests/unit
 test_ci/           ->  tests/ci
 tests_functional   ->  tests/functional
 rally/hacking      ->  tests/hacking

Add testing read me file

Co-Authored-By: Boris Pavlovic <boris@pavlovic.me>
Co-Authored-By: Andrey Kurilin <akurilin@mirantis.com>

Change-Id: I57c09d892da4adf863c358a4d63e3543b50d10b7
2014-10-07 13:50:40 +00:00