diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2017-01-19 15:47:09 +0100 |
---|---|---|
committer | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2017-01-19 15:52:38 +0100 |
commit | 3d25d4319afbbc485c0f194f394dbe25ce079d2e (patch) | |
tree | ff73b9beedf231e6bf26239c82c08407d2fcdeb3 /automated/lib | |
parent | 2cc6d051bb231cb3918d82027e6567996fc25ae0 (diff) | |
download | test-definitions-pipe-3d25d4319afbbc485c0f194f394dbe25ce079d2e.tar.gz |
automated: add support for measurements with no unit
It is possible to report measurements with no specific units, however the helper
functions currently require the unit to be specified. This patch allows test
case to provide only the measurement in add_metric() , effectively making the
last arg (unit) optional.
When processing the output , we then need to ensure whether or not the unit was
specified in the first place.
I needed this when porting sysbench test case onto 'automated' method
(e.g. sysbench reports 'count of events'). With this change I can get the
following test results from sysbench:
<TEST_CASE_ID=total-time-2-threads RESULT=pass UNITS=s MEASUREMENT=4.0010>
<TEST_CASE_ID=total-number-of-events-2-threads RESULT=pass UNITS= MEASUREMENT=8827>
<TEST_CASE_ID=total-time-taken-by-event-execution-2-threads RESULT=pass UNITS= MEASUREMENT=7.9996>
<TEST_CASE_ID=min-2-threads RESULT=pass UNITS=ms MEASUREMENT=0.90>
<TEST_CASE_ID=avg-2-threads RESULT=pass UNITS=ms MEASUREMENT=0.91>
<TEST_CASE_ID=max-2-threads RESULT=pass UNITS=ms MEASUREMENT=3.38>
<TEST_CASE_ID=approx.-95-percentile-2-threads RESULT=pass UNITS=ms MEASUREMENT=0.93>
<ENDRUN sysbench 9ce36643-e7e9-481e-a45a-464cd07d8cd9>
2017-01-19 15:45:57,557 - RUNNER.ResultParser: INFO: Result files saved to: /home/ndec/output/sysbench_9ce36643-e7e9-481e-a45a-464cd07d8cd9
--- Printing result.csv ---
name,test_case_id,result,measurement,units,test_params
sysbench,total-time-2-threads,pass,4.0010,s,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1
sysbench,total-number-of-events-2-threads,pass,8827,,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1
sysbench,total-time-taken-by-event-execution-2-threads,pass,7.9996,,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1
sysbench,min-2-threads,pass,0.90,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1
sysbench,avg-2-threads,pass,0.91,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1
sysbench,max-2-threads,pass,3.38,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1
sysbench,approx.-95-percentile-2-threads,pass,0.93,ms,DURATION=4;MAX_REQUESTS=50000;SKIP_INSTALL=False;TEST=cpu;FILE_TEST_MODE=seqrewr;TIMES=1
Change-Id: Id41207c3237f597bc3db83a5d7d54ee35f6974e3
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Diffstat (limited to 'automated/lib')
-rwxr-xr-x | automated/lib/sh-test-lib | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib index b02c121..3b2ab43 100755 --- a/automated/lib/sh-test-lib +++ b/automated/lib/sh-test-lib @@ -129,9 +129,9 @@ report_fail() { } add_metric() { - if [ "$#" -ne 4 ]; then - warn_msg "The number of parameters less then 4" - error_msg "Usage: add_metric test_case result measurement units" + if [ "$#" -lt 3 ]; then + warn_msg "The number of parameters less then 3" + error_msg "Usage: add_metric test_case result measurement [units]" fi test_case="$1" result="$2" |