Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lordgamez committed Dec 11, 2024
1 parent ec5d63d commit 1679a59
Show file tree
Hide file tree
Showing 4 changed files with 263 additions and 205 deletions.
2 changes: 1 addition & 1 deletion libminifi/src/core/ProcessSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ void ProcessSession::commit() {
const auto commit_start_time = std::chrono::steady_clock::now();
try {
std::unordered_map<std::string, TransferMetrics> transfers;
auto increaseTransferMetrics = [&](const FlowFile& record, const Relationship& relationship) {
auto increaseTransferMetrics = [&](const FlowFile& record, const Relationship& relationship) {
++transfers[relationship.getName()].transfer_count;
transfers[relationship.getName()].transfer_size += record.getSize();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SingleProcessorTestController : public TestController {
public:
explicit SingleProcessorTestController(std::unique_ptr<core::Processor> processor) {
auto name = processor->getName();
processor_ = plan->addProcessor(std::move(processor), name);
processor_ = plan->addProcessor(std::move(processor), name, {});
input_ = plan->addConnection(nullptr, core::Relationship{"success", "success"}, processor_);
outgoing_connections_ = [this] {
std::unordered_map<core::Relationship, Connection*> result;
Expand Down
2 changes: 2 additions & 0 deletions libminifi/test/libtest/unit/TestBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,13 @@ bool TestPlan::runProcessor(size_t target_location, const PreTriggerVerifier& ve

if (verify) {
auto current_session = std::make_shared<minifi::core::ProcessSession>(context);
current_session->setMetrics(processor->getMetrics());
process_sessions_.push_back(current_session);
verify(context, current_session);
current_session->commit();
} else {
auto session_factory = std::make_shared<TestSessionFactory>(context, [&] (auto current_session) {
current_session->setMetrics(processor->getMetrics());
process_sessions_.push_back(current_session);
});
logger_->log_info("Running {}", processor->getName());
Expand Down
Loading

0 comments on commit 1679a59

Please sign in to comment.