Skip to content

Commit a10ed11

Browse files
authored
[QC-297] Fix testWorkflow (#407)
1 parent 19dfc70 commit a10ed11

5 files changed

Lines changed: 24 additions & 16 deletions

File tree

Framework/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ endforeach()
298298
target_include_directories(testVersion PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)
299299
target_include_directories(testCcdbDatabase PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)
300300

301-
set_property(TEST testWorkflow PROPERTY TIMEOUT 10)
301+
set_property(TEST testWorkflow PROPERTY TIMEOUT 20)
302302
set_property(TEST testWorkflow PROPERTY LABELS slow)
303-
set_property(TEST testCheckWorkflow PROPERTY TIMEOUT 10)
303+
set_property(TEST testCheckWorkflow PROPERTY TIMEOUT 20)
304304
set_property(TEST testCheckWorkflow PROPERTY LABELS slow)
305305
set_property(TEST testObjectsManager PROPERTY TIMEOUT 20)
306306
set_property(TEST testObjectsManager PROPERTY LABELS slow)

Framework/include/QualityControl/runnerUtils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ std::string getFirstTaskName(std::string configurationSource)
4141
throw;
4242
}
4343

44-
std::string getFirstCheckerName(std::string configurationSource)
44+
std::string getFirstCheckName(std::string configurationSource)
4545
{
4646
auto config = o2::configuration::ConfigurationFactory::getConfiguration(configurationSource);
4747

4848
if (config->getRecursive("qc").count("checks")) {
49-
for (const auto& task : config->getRecursive("qc.checks")) {
50-
return task.first; // task name;
49+
for (const auto& check : config->getRecursive("qc.checks")) {
50+
return check.first; // check name;
5151
}
5252
}
5353

Framework/src/runBasic.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& config)
104104
DataProcessorSpec printer{
105105
"printer",
106106
Inputs{
107-
{ "checked-mo", "QC", CheckRunner::createCheckRunnerDataDescription(getFirstCheckerName(qcConfigurationSource)), 0 } },
107+
{ "checked-mo", "QC", CheckRunner::createCheckRunnerDataDescription(getFirstCheckName(qcConfigurationSource)), 0 } },
108108
Outputs{},
109109
adaptFromTask<o2::quality_control::example::ExampleQualityPrinterSpec>()
110110
};

Framework/test/testWorkflow.cxx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,25 @@
1313
/// \author Piotr Konopka
1414
///
1515

16+
#include "QualityControl/InfrastructureGenerator.h"
17+
#include <Framework/DataSampling.h>
18+
19+
using namespace o2;
20+
using namespace o2::framework;
21+
22+
void customize(std::vector<CompletionPolicy>& policies)
23+
{
24+
DataSampling::CustomizeInfrastructure(policies);
25+
quality_control::customizeInfrastructure(policies);
26+
}
27+
1628
#include "getTestDataDirectory.h"
1729
#include "QualityControl/CheckRunner.h"
18-
#include "QualityControl/InfrastructureGenerator.h"
1930
#include "QualityControl/runnerUtils.h"
2031
#include <Framework/runDataProcessing.h>
2132
#include <Framework/ControlService.h>
22-
#include <Framework/DataSampling.h>
2333
#include <TH1F.h>
2434

25-
using namespace o2;
26-
using namespace o2::framework;
2735
using namespace o2::quality_control::core;
2836
using namespace o2::quality_control::checker;
2937

@@ -53,13 +61,13 @@ WorkflowSpec defineDataProcessing(ConfigContext const&)
5361
DataSampling::GenerateInfrastructure(specs, qcConfigurationSource);
5462

5563
// Generation of the QC topology (one task, one checker in this case)
56-
quality_control::generateRemoteInfrastructure(specs, qcConfigurationSource);
64+
quality_control::generateStandaloneInfrastructure(specs, qcConfigurationSource);
5765

5866
// Finally the receiver
5967
DataProcessorSpec receiver{
6068
"receiver",
6169
Inputs{
62-
{ "checked-mo", "QC", CheckRunner::createCheckRunnerDataDescription(getFirstCheckerName(qcConfigurationSource)), 0 } },
70+
{ "checked-mo", "QC", CheckRunner::createCheckRunnerDataDescription(getFirstCheckName(qcConfigurationSource)), 0 } },
6371
Outputs{},
6472
AlgorithmSpec{
6573
[](ProcessingContext& pctx) {
@@ -68,14 +76,14 @@ WorkflowSpec defineDataProcessing(ConfigContext const&)
6876
auto qo = pctx.inputs().get<QualityObject*>("checked-mo");
6977
if (!qo) {
7078
LOG(ERROR) << "Quality Object is a NULL";
71-
pctx.services().get<ControlService>().readyToQuit(true);
79+
pctx.services().get<ControlService>().readyToQuit(QuitRequest::All);
7280
return;
7381
}
7482

75-
LOG(DEBUG) << qo->getName() << " - qualit: " << qo->getQuality();
83+
LOG(DEBUG) << qo->getName() << " - quality: " << qo->getQuality();
7684

7785
// We ask to shut the topology down, returning 0 if there were no ERROR logs.
78-
pctx.services().get<ControlService>().readyToQuit(true);
86+
pctx.services().get<ControlService>().readyToQuit(QuitRequest::All);
7987
} }
8088
};
8189
specs.push_back(receiver);

Modules/TOF/src/runTOF.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& config)
9696
DataProcessorSpec printer{
9797
"printer",
9898
Inputs{
99-
{ "checked-mo", "QC", CheckRunner::createCheckRunnerDataDescription(getFirstCheckerName(qcConfigurationSource)), 0 } },
99+
{ "checked-mo", "QC", CheckRunner::createCheckRunnerDataDescription(getFirstCheckName(qcConfigurationSource)), 0 } },
100100
Outputs{},
101101
adaptFromTask<o2::quality_control::example::ExampleQualityPrinterSpec>()
102102
};

0 commit comments

Comments
 (0)