Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Utilities/DataSampling/src/DataSamplingPolicy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ DataSamplingPolicy DataSamplingPolicy::fromConfiguration(const ptree& config)
}
for (const auto& outputAsInputSpec : outputsAsInputSpecs) {
outputSpecs.emplace_back(DataSpecUtils::asOutputSpec(outputAsInputSpec));
outputSpecs.back().lifetime = Lifetime::QA;
}
} else { // otherwise default format will be used
for (const auto& inputSpec : inputSpecs) {
Expand All @@ -78,12 +79,12 @@ DataSamplingPolicy DataSamplingPolicy::fromConfiguration(const ptree& config)
createPolicyDataOrigin(),
createPolicyDataDescription(name, outputId++),
DataSpecUtils::getOptionalSubSpec(inputSpec).value(),
inputSpec.lifetime});
Lifetime::QA});
} else {
outputSpecs.emplace_back(OutputSpec{
{inputSpec.binding},
{createPolicyDataOrigin(), createPolicyDataDescription(name, outputId++)},
inputSpec.lifetime});
Lifetime::QA});
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Utilities/DataSampling/test/test_DataSampling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ BOOST_AUTO_TEST_CASE(DataSamplingSimpleFlow)

auto output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
[](const OutputSpec& out) {
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters0", 0}) && out.lifetime == Lifetime::Timeframe;
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters0", 0}) && out.lifetime == Lifetime::QA;
});
BOOST_CHECK(output != disp->outputs.end());

output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
[](const OutputSpec& out) {
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters1", 0}) && out.lifetime == Lifetime::Timeframe;
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters1", 0}) && out.lifetime == Lifetime::QA;
});
BOOST_CHECK(output != disp->outputs.end());

Expand Down Expand Up @@ -125,13 +125,13 @@ BOOST_AUTO_TEST_CASE(DataSamplingParallelFlow)

auto output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
[](const OutputSpec& out) {
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters0", 0}) && out.lifetime == Lifetime::Timeframe;
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters0", 0}) && out.lifetime == Lifetime::QA;
});
BOOST_CHECK(output != disp->outputs.end());

output = std::find_if(disp->outputs.begin(), disp->outputs.end(),
[](const OutputSpec& out) {
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters1", 0}) && out.lifetime == Lifetime::Timeframe;
return DataSpecUtils::match(out, ConcreteDataMatcher{"DS", "tpcclusters1", 0}) && out.lifetime == Lifetime::QA;
});
BOOST_CHECK(output != disp->outputs.end());

Expand Down
14 changes: 7 additions & 7 deletions Utilities/DataSampling/test/test_DataSamplingPolicy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ BOOST_AUTO_TEST_CASE(DataSamplingPolicyFromConfiguration)
BOOST_CHECK((policy.prepareOutput(ConcreteDataMatcher{"TST", "CHLEB", 33})) == (Output{"DS", "my_policy0", 33}));
BOOST_CHECK((policy.prepareOutput(ConcreteDataMatcher{"TST", "MLEKO", 33})) == (Output{"DS", "my_policy1", 33}));
const auto& map = policy.getPathMap();
BOOST_CHECK((*map.find(ConcreteDataMatcher{"TST", "CHLEB", 33})).second == (OutputSpec{"DS", "my_policy0", 33}));
BOOST_CHECK((*map.find(ConcreteDataMatcher{"TST", "MLEKO", 33})).second == (OutputSpec{"DS", "my_policy1", 33}));
BOOST_CHECK_EQUAL((*map.find(ConcreteDataMatcher{"TST", "CHLEB", 33})).second, (OutputSpec{"DS", "my_policy0", 33, Lifetime::QA}));
BOOST_CHECK_EQUAL((*map.find(ConcreteDataMatcher{"TST", "MLEKO", 33})).second, (OutputSpec{"DS", "my_policy1", 33, Lifetime::QA}));
BOOST_CHECK_EQUAL(map.size(), 2);

BOOST_CHECK(policy.match(ConcreteDataMatcher{"TST", "CHLEB", 33}));
Expand Down Expand Up @@ -97,8 +97,8 @@ BOOST_AUTO_TEST_CASE(DataSamplingPolicyFromConfiguration)
BOOST_CHECK((policy.prepareOutput(ConcreteDataMatcher{"TST", "CHLEB", 33})) == (Output{"TST", "CHLEB_S", 33}));
BOOST_CHECK((policy.prepareOutput(ConcreteDataMatcher{"TST", "MLEKO", 33})) == (Output{"TST", "MLEKO_S", 33}));
const auto& map = policy.getPathMap();
BOOST_CHECK((*map.find(ConcreteDataMatcher{"TST", "CHLEB", 33})).second == (OutputSpec{"TST", "CHLEB_S", 33}));
BOOST_CHECK((*map.find(ConcreteDataMatcher{"TST", "MLEKO", 33})).second == (OutputSpec{"TST", "MLEKO_S", 33}));
BOOST_CHECK_EQUAL((*map.find(ConcreteDataMatcher{"TST", "CHLEB", 33})).second, (OutputSpec{"TST", "CHLEB_S", 33, Lifetime::QA}));
BOOST_CHECK_EQUAL((*map.find(ConcreteDataMatcher{"TST", "MLEKO", 33})).second, (OutputSpec{"TST", "MLEKO_S", 33, Lifetime::QA}));
BOOST_CHECK_EQUAL(map.size(), 2);
}
// with custom outputs which are wildcards
Expand All @@ -109,8 +109,8 @@ BOOST_AUTO_TEST_CASE(DataSamplingPolicyFromConfiguration)
BOOST_CHECK((policy.prepareOutput(ConcreteDataMatcher{"TST", "CHLEB", 33})) == (Output{"TST", "CHLEB_S", 33}));
BOOST_CHECK((policy.prepareOutput(ConcreteDataMatcher{"TST", "MLEKO", 33})) == (Output{"TST", "MLEKO_S", 33}));
const auto& map = policy.getPathMap();
BOOST_CHECK((*map.find(ConcreteDataMatcher{"TST", "CHLEB", 33})).second == (OutputSpec{{"TST", "CHLEB_S"}}));
BOOST_CHECK((*map.find(ConcreteDataMatcher{"TST", "MLEKO", 33})).second == (OutputSpec{{"TST", "MLEKO_S"}}));
BOOST_CHECK_EQUAL((*map.find(ConcreteDataMatcher{"TST", "CHLEB", 33})).second, (OutputSpec{{"TST", "CHLEB_S"}, Lifetime::QA}));
BOOST_CHECK_EQUAL((*map.find(ConcreteDataMatcher{"TST", "MLEKO", 33})).second, (OutputSpec{{"TST", "MLEKO_S"}, Lifetime::QA}));
BOOST_CHECK_EQUAL(map.size(), 2);
}
}
Expand Down Expand Up @@ -138,4 +138,4 @@ BOOST_AUTO_TEST_CASE(DataSamplingPolicyStaticMethods)
BOOST_CHECK(DataSamplingPolicy::createPolicyDataDescription("asdf", 0) == DataDescription("asdf0"));
BOOST_CHECK(DataSamplingPolicy::createPolicyDataDescription("asdfasdfasdfasdf", 0) == DataDescription("asdfasdfasdfas0"));
BOOST_CHECK(DataSamplingPolicy::createPolicyDataDescription("asdfasdfasdfasdf", 10) == DataDescription("asdfasdfasdfas10"));
}
}