You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2026/03/10 12:36:47 UTC
(nifi-minifi-cpp) 07/10: MINIFICPP-2739 Add test scenario info to behave logs
This is an automated email from the ASF dual-hosted git repository.
martinzink pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 30c2434bdf0c2f7109ad6b178c2df67e06cfebe5
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Tue Mar 10 13:17:02 2026 +0100
MINIFICPP-2739 Add test scenario info to behave logs
This closes #2129
Signed-off-by: Martin Zink <ma...@apache.org>
---
.../src/minifi_test_framework/core/hooks.py | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/behave_framework/src/minifi_test_framework/core/hooks.py b/behave_framework/src/minifi_test_framework/core/hooks.py
index 298f27d85..3e4e69a95 100644
--- a/behave_framework/src/minifi_test_framework/core/hooks.py
+++ b/behave_framework/src/minifi_test_framework/core/hooks.py
@@ -14,11 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-import logging
import os
import docker
import types
+import logging
+from pathlib import Path
from behave.model import Scenario
from behave.runner import Context
@@ -80,6 +80,19 @@ def common_before_scenario(context: Context, scenario: Scenario):
def common_after_scenario(context: MinifiTestContext, scenario: Scenario):
+ if hasattr(context, "evidence_path") and os.environ.get("LOGS"):
+ header = (
+ f"FEATURE : {scenario.feature.name}\n"
+ f"SCENARIO : {scenario.name}\n"
+ f"FILE : {scenario.feature.filename}\n"
+ f"LINE : {scenario.line}\n"
+ )
+
+ log_dir_path = Path(os.environ.get("LOGS")) / Path(context.evidence_path)
+ scenario_info_path = log_dir_path / "scenario_info.txt"
+ with open(scenario_info_path, "w") as f:
+ f.write(header)
+
for container in context.containers.values():
container.clean_up()
context.network.remove()