lordgamez commented on code in PR #2022:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2022#discussion_r2336511754
##########
extensions/standard-processors/tests/integration/TailFileIntegrationTest.cpp:
##########
@@ -36,7 +36,8 @@ namespace org::apache::nifi::minifi::test {
class TailFileTestHarness : public IntegrationBase {
public:
- TailFileTestHarness() {
+ explicit TailFileTestHarness(const std::filesystem::path& test_file_location)
+ : IntegrationBase(test_file_location, {}, 2s) {
Review Comment:
Good catch, removed in
https://github.com/apache/nifi-minifi-cpp/pull/2022/commits/4d33ad4abe767c3f8b256b4989fe6ee439fd17d2
##########
libminifi/test/libtest/integration/IntegrationBase.cpp:
##########
@@ -28,9 +29,16 @@
namespace org::apache::nifi::minifi::test {
-IntegrationBase::IntegrationBase(std::chrono::milliseconds waitTime)
+IntegrationBase::IntegrationBase(const std::optional<std::filesystem::path>&
test_file_location, const std::optional<std::filesystem::path>& home_path,
std::chrono::milliseconds waitTime)
: configuration(std::make_shared<minifi::ConfigureImpl>()),
- wait_time_(waitTime) {
+ wait_time_(waitTime),
+ home_path_(home_path) {
+ flow_config_path_.config_path = test_file_location;
+ if (test_file_location && std::filesystem::exists(*test_file_location) &&
std::filesystem::is_regular_file(*test_file_location)) {
Review Comment:
There are still some tests where no flow file path is used, also there are
some tests where the test file is created later, so it may not be present yet
when the harness is created.
##########
libminifi/test/libtest/integration/IntegrationBase.h:
##########
@@ -31,26 +31,35 @@
#include "utils/file/AssetManager.h"
#include "utils/file/FileUtils.h"
#include "core/BulletinStore.h"
+#include "unit/TestBase.h"
namespace minifi = org::apache::nifi::minifi;
namespace core = minifi::core;
namespace utils = minifi::utils;
namespace org::apache::nifi::minifi::test {
+struct FlowConfigPath {
+ std::unique_ptr<TempDirectory> temp_dir;
+ std::optional<std::filesystem::path> config_path;
+};
+
class IntegrationBase {
public:
- explicit IntegrationBase(std::chrono::milliseconds waitTime =
std::chrono::milliseconds(DEFAULT_WAITTIME_MSECS));
+ explicit IntegrationBase(const std::optional<std::filesystem::path>&
test_file_location = {}, const std::optional<std::filesystem::path>& home_path
= {},
Review Comment:
There are still some tests like C2UpdateAssetTest, C2LogHeartbeatTest,
C2CompressTest, C2AssetSyncTest where no flow config file is used so it can
remain optional
--
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]