martinzink commented on code in PR #2081:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2081#discussion_r2661691403


##########
libminifi/test/unit/LogMetricsPublisherTests.cpp:
##########
@@ -86,8 +85,49 @@ TEST_CASE_METHOD(LogPublisherTestFixture, "Verify empty 
metrics if no valid metr
   }
   publisher_->initialize(configuration_, response_node_loader_);
   publisher_->loadMetricNodes();
-  using 
org::apache::nifi::minifi::test::utils::verifyLogLinePresenceInPollTime;
-  REQUIRE(verifyLogLinePresenceInPollTime(5s, "LogMetricsPublisher is 
configured without any valid metrics!"));
+  REQUIRE(utils::verifyLogLinePresenceInPollTime(5s, "LogMetricsPublisher is 
configured without any valid metrics!"));
+}
+
+std::string expectedRepositoryMetricsRegex(std::string level) {
+  std::string regex_pattern =
+      // 1. Log Header & Opening
+      R"(\[[\d\-\s\:\.]+\]\s*\[[^\]]+\]\s*\[)" + std::move(level) + 
R"(\]\s*\{\s*)" +
+      R"(\"LogMetrics\":\s*\{\s*)" +
+
+      // 2. (skips other nodes, stops if a \n[ starts (other log line))
+      R"((?:(?!\n\[)[\s\S])*?)" +
+
+      // 3. RepositoryMetrics Node
+      R"(\"RepositoryMetrics\":\s*\{\s*)" +

Review Comment:
   refactored it because the huge regex matching was unfeasable on CI machines
   [refactor LogMetricsPublisherTests so it doesn't really on huge 
regex_match](https://github.com/apache/nifi-minifi-cpp/pull/2081/changes/72bef5f063a2d873474d0de065e346a74845d9d7)



-- 
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]

Reply via email to