Copilot commented on code in PR #2144:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2144#discussion_r2989622594
##########
behave_framework/src/minifi_test_framework/steps/flow_building_steps.py:
##########
@@ -143,106 +143,106 @@ def step_impl(context: MinifiTestContext,
property_name: str, controller_name: s
@step('a Funnel with the name "{funnel_name}" is set up')
-def step_impl(context: MinifiTestContext, funnel_name: str):
+def setup_funnel(context: MinifiTestContext, funnel_name: str):
context.get_or_create_default_minifi_container().flow_definition.add_funnel(Funnel(funnel_name))
@step('in the "{minifi_container_name}" flow the "{relationship_name}"
relationship of the {source} processor is connected to the {target}')
@step('in the "{minifi_container_name}" flow the "{relationship_name}"
relationship of the {source} node is connected to the {target}')
-def step_impl(context: MinifiTestContext, relationship_name: str, source: str,
target: str, minifi_container_name: str):
+def connect_relationship_in_minifi_flow(context: MinifiTestContext,
relationship_name: str, source: str, target: str, minifi_container_name: str):
connection = Connection(source_name=source,
source_relationship=relationship_name, target_name=target)
context.get_or_create_minifi_container(minifi_container_name).flow_definition.add_connection(connection)
@step('in the NiFi flow the "{relationship_name}" relationship of the {source}
processor is connected to the {target}')
-def step_impl(context: MinifiTestContext, relationship_name: str, source: str,
target: str):
+def connect_relationship_in_nifi_flow(context: MinifiTestContext,
relationship_name: str, source: str, target: str):
connection = Connection(source_name=source,
source_relationship=relationship_name, target_name=target)
context.containers["nifi"].flow_definition.add_connection(connection)
@step('the "{relationship_name}" relationship of the {source} processor is
connected to the {target}')
@step('the "{relationship_name}" relationship of the {source} node is
connected to the {target}')
-def step_impl(context: MinifiTestContext, relationship_name: str, source: str,
target: str):
+def connect_relationship(context: MinifiTestContext, relationship_name: str,
source: str, target: str):
context.execute_steps(f'given in the "{DEFAULT_MINIFI_CONTAINER_NAME}"
flow the "{relationship_name}" relationship of the {source} processor is
connected to the {target}')
@step("the output port \"{port_name}\" is connected to the {destination_name}
processor")
-def step_impl(context: MinifiTestContext, port_name: str, destination_name:
str):
+def connect_output_port_to_processor(context: MinifiTestContext, port_name:
str, destination_name: str):
connection = Connection(source_name=port_name,
source_relationship="undefined", target_name=destination_name)
context.get_or_create_minifi_container(DEFAULT_MINIFI_CONTAINER_NAME).flow_definition.add_connection(connection)
@step('the Funnel with the name "{funnel_name}" is connected to the {target}')
-def step_impl(context: MinifiTestContext, funnel_name: str, target: str):
+def connect_funnel_to_target(context: MinifiTestContext, funnel_name: str,
target: str):
connection = Connection(source_name=funnel_name,
source_relationship="success", target_name=target)
context.get_or_create_default_minifi_container().flow_definition.add_connection(connection)
@step("{processor_name}'s {relationship} relationship is auto-terminated in
the \"{minifi_container_name}\" flow")
-def step_impl(context: MinifiTestContext, processor_name: str, relationship:
str, minifi_container_name: str):
+def auto_terminate_relationship_in_minifi_flow(context: MinifiTestContext,
processor_name: str, relationship: str, minifi_container_name: str):
context.get_or_create_minifi_container(minifi_container_name).flow_definition.get_processor(processor_name).auto_terminated_relationships.append(
relationship)
@step("{processor_name}'s {relationship} relationship is auto-terminated in
the NiFi flow")
-def step_impl(context: MinifiTestContext, processor_name: str, relationship:
str):
+def auto_terminate_relationship_in_nifi_flow(context: MinifiTestContext,
processor_name: str, relationship: str):
context.containers["nifi"].flow_definition.get_processor(processor_name).auto_terminated_relationships.append(relationship)
@step("{processor_name}'s {relationship} relationship is auto-terminated")
@step("the \"{relationship}\" relationship of the {processor_name} processor
is auto-terminated")
-def step_impl(context: MinifiTestContext, processor_name: str, relationship:
str):
+def auto_terminate_relationship(context: MinifiTestContext, processor_name:
str, relationship: str):
context.execute_steps(f'given {processor_name}\'s {relationship}
relationship is auto-terminated in the "{DEFAULT_MINIFI_CONTAINER_NAME}" flow')
@given("a transient MiNiFi flow is set up")
-def step_impl(context: MinifiTestContext):
+def setup_transient_minifi_flow(context: MinifiTestContext):
context.get_or_create_default_minifi_container().command = ["/bin/sh",
"-c", "timeout 10s ./bin/minifi.sh run && sleep 100"]
@step('the scheduling period of the {processor_name} processor is set to
"{duration_str}" in the "{minifi_container_name}" flow')
-def step_impl(context: MinifiTestContext, processor_name: str, duration_str:
str, minifi_container_name: str):
+def set_scheduling_period_in_minifi_flow(context: MinifiTestContext,
processor_name: str, duration_str: str, minifi_container_name: str):
context.get_or_create_minifi_container(minifi_container_name).flow_definition.get_processor(processor_name).scheduling_period
= duration_str
@step('the scheduling period of the {processor_name} processor is set to
"{duration_str}" in the NiFi flow')
-def step_impl(context: MinifiTestContext, processor_name: str, duration_str:
str, minifi_container_name: str):
+def set_scheduling_period_in_nifi_flow(context: MinifiTestContext,
processor_name: str, duration_str: str, minifi_container_name: str):
Review Comment:
The step pattern for the NiFi flow scheduling period only defines
{processor_name} and {duration_str}, but the step implementation also requires
a `minifi_container_name` argument. Behave will call this step with only the
parsed placeholders, causing a runtime TypeError when the step is used. Remove
the unused parameter (and adjust any related logic if needed) so the function
signature matches the decorator placeholders.
```suggestion
def set_scheduling_period_in_nifi_flow(context: MinifiTestContext,
processor_name: str, duration_str: str):
```
--
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]