diff options
author | Gwenael Lambrouin <gwenael.lambrouin@orange.com> | 2021-07-19 11:42:39 +0200 |
---|---|---|
committer | Gwenael Lambrouin <gwenael.lambrouin@orange.com> | 2021-07-22 17:08:18 +0200 |
commit | 1b1169940ccab970ae5174dacd6d2ed257727623 (patch) | |
tree | 6297df17cded87661823c333a875c52847acd011 | |
parent | 6e15b62fa75d1d000317beb0ab5244924a3f6ca7 (diff) |
behave_tests: log latency test (fixed threshold)
Change-Id: I8285829a854f146fb9736d44655a7e848923203e
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@orange.com>
-rw-r--r-- | behave_tests/features/steps/steps.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/behave_tests/features/steps/steps.py b/behave_tests/features/steps/steps.py index 76ed12d..a1d29ce 100644 --- a/behave_tests/features/steps/steps.py +++ b/behave_tests/features/steps/steps.py @@ -127,6 +127,7 @@ def add_percentage_rate(context, percentage_rate): context.percentage_rate = percentage_rate rate = percentage_previous_rate(context, percentage_rate) context.json['rate'] = rate + context.logger.info(f"add_percentage_rate: {percentage_rate} => rate={rate}") """When steps.""" @@ -266,12 +267,18 @@ def check_latency_result_against_fixed_threshold(context, max_avg_latency_usec: # Get the just measured average latency (a float): new_avg_latency_usec = context.synthesis['avg_delay_usec'] + # Log what we test: + context.logger.info("check_latency_result_against_fixed_threshold(usec): " + "{value}<={ref}?".format( + value=round(new_avg_latency_usec), + ref=round(max_avg_latency_usec))) + # Compare measured value to reference: if new_avg_latency_usec > max_avg_latency_usec: raise AssertionError("Average latency higher than max threshold: " - "{avg_latency} usec > {threshold} usec".format( - avg_latency=round(new_avg_latency_usec), - threshold=round(max_avg_latency_usec))) + "{value} usec > {ref} usec".format( + value=round(new_avg_latency_usec), + ref=round(max_avg_latency_usec))) @then( |