martinzink commented on code in PR #2089:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2089#discussion_r2815505671
##########
behave_framework/src/minifi_test_framework/steps/checking_steps.py:
##########
@@ -246,6 +246,14 @@ def step_impl(context, container_name: str, directory:
str, size: str, duration:
@then("at least one file with minimum size of \"{size}\" is placed in the
\"{directory}\" directory in less than {duration}")
-def step_impl(context, directory: str, size: str, duration: str):
+def step_impl(context: MinifiTestContext, directory: str, size: str, duration:
str):
context.execute_steps(
f'Then in the "{DEFAULT_MINIFI_CONTAINER_NAME}" container at least one
file with minimum size of "{size}" is placed in the "{directory}" directory in
less than {duration}')
+
+
+@then("the MiNiFi C2 server logs contain the following message:
\"{log_message}\" in less than {duration}")
+def step_impl(context: MinifiTestContext, log_message: str, duration: str):
+ duration_seconds = humanfriendly.parse_timespan(duration)
+ assert wait_for_condition(condition=lambda: log_message in
context.containers["minifi-c2-server"].get_logs(),
+ timeout_seconds=duration_seconds,
bail_condition=lambda: context.containers["minifi-c2-server"].exited,
Review Comment:
here aswell it might be better to put this in the standard processors
steps.py not here
##########
behave_framework/src/minifi_test_framework/steps/checking_steps.py:
##########
@@ -246,6 +246,14 @@ def step_impl(context, container_name: str, directory:
str, size: str, duration:
@then("at least one file with minimum size of \"{size}\" is placed in the
\"{directory}\" directory in less than {duration}")
-def step_impl(context, directory: str, size: str, duration: str):
+def step_impl(context: MinifiTestContext, directory: str, size: str, duration:
str):
context.execute_steps(
f'Then in the "{DEFAULT_MINIFI_CONTAINER_NAME}" container at least one
file with minimum size of "{size}" is placed in the "{directory}" directory in
less than {duration}')
+
+
+@then("the MiNiFi C2 server logs contain the following message:
\"{log_message}\" in less than {duration}")
+def step_impl(context: MinifiTestContext, log_message: str, duration: str):
+ duration_seconds = humanfriendly.parse_timespan(duration)
+ assert wait_for_condition(condition=lambda: log_message in
context.containers["minifi-c2-server"].get_logs(),
+ timeout_seconds=duration_seconds,
bail_condition=lambda: context.containers["minifi-c2-server"].exited,
Review Comment:
here aswell it might be better to put this in the standard processors
steps.py not here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]