Skip to content

MINIFICPP-2758 Rename step_impls in minifi behave#2144

Open
martinzink wants to merge 2 commits intoapache:mainfrom
martinzink:MINIFICPP-2758
Open

MINIFICPP-2758 Rename step_impls in minifi behave#2144
martinzink wants to merge 2 commits intoapache:mainfrom
martinzink:MINIFICPP-2758

Conversation

@martinzink
Copy link
Member

@martinzink martinzink commented Mar 25, 2026

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:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

@martinzink martinzink requested a review from Copilot March 25, 2026 16:44
@martinzink martinzink added low-impact Test only or trivial change that's most likely not gonna introduce any new bugs minifi-behave labels Mar 25, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_imp function 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.

…_steps.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@martinzink martinzink marked this pull request as ready for review March 25, 2026 17:27
@martinzink martinzink added the llm label Mar 25, 2026

@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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function impl adds a new parameter context, I think the @given string and the function name are misleading.

Suggested change
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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def set_drop_empty_for_connection(context: MinifiTestContext, destination: str):
def set_drop_empty_flag_for_connection(context: MinifiTestContext, destination: str):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm low-impact Test only or trivial change that's most likely not gonna introduce any new bugs minifi-behave

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants