This is a test framework designed to aid in the Behavior-Driven Development (BDD) integration testing of Apache NiFi MiNiFi C++.
The framework uses Docker containers to verify the agent's behavior, both in isolation and alongside third-party components. It provides predefined steps to configure a flow, deploy various containers, and automatically verify the results.
Before running the tests, ensure your system has the following installed:
The framework is packaged as a standard Python project. It is highly recommended to use a virtual environment.
pyproject.toml is located).python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
behavex, docker, and PyYAML) in editable mode:pip install -e .
To write additional tests, create a features folder within your extension's directory and describe your desired behavior using standard Gherkin syntax.
src/minifi_behave/steps/steps folder. Example: extensions/standard-processors/tests/features/steps/steps.pyFeature: File system operations are handled by the GetFile and PutFile processors In order to store and access data on the local file system As a user of MiNiFi I need to have GetFile and PutFile processors Scenario: Get and put operations run in a simple flow Given a GetFile processor with the "Input Directory" property set to "/tmp/input" And a directory at "/tmp/input" has a file with the content "test" And a PutFile processor with the "Directory" property set to "/tmp/output" And PutFile is EVENT_DRIVEN And the "success" relationship of the GetFile processor is connected to the PutFile And PutFile's success relationship is auto-terminated When the MiNiFi instance starts up Then a single file with the content "test" is placed in the "/tmp/output" directory in less than 10 seconds
Make sure your virtual environment is activated, then run:
# Run all tests behavex # Run a specific feature file behavex extensions/standard-processors/tests/features/file_system_operations.feature # Run tests with a specific tag (if you tag your scenarios) behavex -t @my_tag