MINIFICPP-2758 Rename step_impls in minifi behave#2144
MINIFICPP-2758 Rename step_impls in minifi behave#2144martinzink wants to merge 2 commits intoapache:mainfrom
Conversation
b32732c to
89e4a7f
Compare
There was a problem hiding this comment.
Pull request overview
Renames Behave step implementation functions across the MiNiFi C++ test framework to use descriptive, unique names, improving stack traces and reducing static analyzer noise in test runs.
Changes:
- Replaced generic
step_impl/step_impfunction names with descriptive snake_case names in extension feature step modules. - Applied the same naming approach to shared Behave framework step modules (
core_steps,flow_building_steps,configuration_steps,checking_steps). - Kept step text/decorators intact so feature files continue to bind to the same step patterns.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| extensions/standard-processors/tests/features/steps/steps.py | Renames step functions for standard-processors extension Behave steps. |
| extensions/standard-processors/tests/features/steps/minifi_controller_steps.py | Renames MiNiFi controller-related step functions. |
| extensions/sql/tests/features/steps/steps.py | Renames SQL extension step functions. |
| extensions/splunk/tests/features/steps/steps.py | Renames Splunk extension step functions. |
| extensions/python/tests/features/steps/steps.py | Renames Python extension step functions. |
| extensions/prometheus/tests/features/steps/steps.py | Renames Prometheus extension step functions. |
| extensions/opc/tests/features/steps/steps.py | Renames OPC UA extension step functions. |
| extensions/mqtt/tests/features/steps/steps.py | Renames MQTT extension step functions. |
| extensions/kubernetes/tests/features/steps/steps.py | Renames Kubernetes extension step functions. |
| extensions/kafka/tests/features/steps/steps.py | Renames Kafka extension step functions (including consumer re-registration step naming). |
| extensions/grafana-loki/tests/features/steps/steps.py | Renames Grafana Loki extension step functions. |
| extensions/gcp/tests/features/steps/steps.py | Renames GCP extension step functions. |
| extensions/elasticsearch/tests/features/steps/steps.py | Renames Elasticsearch/OpenSearch extension step functions. |
| extensions/couchbase/tests/features/steps/steps.py | Renames Couchbase extension step functions. |
| extensions/azure/tests/features/steps/steps.py | Renames Azure extension step functions. |
| extensions/aws/tests/features/steps/steps.py | Renames AWS extension step functions. |
| behave_framework/src/minifi_test_framework/steps/flow_building_steps.py | Renames shared flow-building step functions. |
| behave_framework/src/minifi_test_framework/steps/core_steps.py | Renames shared core lifecycle/file/infra step functions. |
| behave_framework/src/minifi_test_framework/steps/configuration_steps.py | Renames shared configuration step functions. |
| behave_framework/src/minifi_test_framework/steps/checking_steps.py | Renames shared assertion/checking step functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
behave_framework/src/minifi_test_framework/steps/flow_building_steps.py
Outdated
Show resolved
Hide resolved
…_steps.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| @then('exactly these files are in the "{directory}" directory in less than {duration}: ""') | ||
| def step_impl(context, directory, duration): | ||
| def verify_empty_files_string_in_directory(context, directory, duration): |
There was a problem hiding this comment.
| def verify_empty_files_string_in_directory(context, directory, duration): | |
| def verify_no_files_in_directory(context, directory, duration): |
|
|
||
| @given("flow configuration path is set up in flow url property") | ||
| def step_impl(context: MinifiTestContext): | ||
| def setup_flow_config_path_in_url(context: MinifiTestContext): |
There was a problem hiding this comment.
To me, the @given string, the function name, and the implementation are saying 3 slightly different things. I think some clarification about what exactly is happening would improve the readability of the code.
- given: Why do we set the flow config path (conf/config.yml) in the flow URL property?
- fn name: Why do we put the config path in some URL? What URL?
- body: Fetch the flow configuration from the flow URL (through C2), this is clear.
|
|
||
| @step("{duration} later") | ||
| def step_impl(context: MinifiTestContext, duration: str): | ||
| def wait_duration_later(context: MinifiTestContext, duration: str): |
There was a problem hiding this comment.
This is the same as wait_duration, we should merge them
|
|
||
| @step('there is an accessible PLC with modbus enabled') | ||
| def step_impl(context: MinifiTestContext): | ||
| def setup_accessible_plc_with_modbus(context: MinifiTestContext): |
There was a problem hiding this comment.
| def setup_accessible_plc_with_modbus(context: MinifiTestContext): | |
| def setup_plc_with_modbus(context: MinifiTestContext): |
|
|
||
| @given("parameter context name is set to '{context_name}'") | ||
| def step_impl(context: MinifiTestContext, context_name: str): | ||
| def set_parameter_context_name(context: MinifiTestContext, context_name: str): |
There was a problem hiding this comment.
The function impl adds a new parameter context, I think the @given string and the function name are misleading.
| def set_parameter_context_name(context: MinifiTestContext, context_name: str): | |
| def add_parameter_context(context: MinifiTestContext, context_name: str): |
|
|
||
| @given("the connection going to {destination} has \"drop empty\" set") | ||
| def step_impl(context: MinifiTestContext, destination: str): | ||
| def set_drop_empty_for_connection(context: MinifiTestContext, destination: str): |
There was a problem hiding this comment.
| def set_drop_empty_for_connection(context: MinifiTestContext, destination: str): | |
| def set_drop_empty_flag_for_connection(context: MinifiTestContext, destination: str): |
This is to improve stack trace during failures, and also non-unique function name freak out a bunch of static analyzers.
I've used LLM for this PR
-this only affects our test framework
-it only changes the naming of the functions, so no functional changes
-i've reviewed it thoroughly
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically main)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.