Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8f653f2
Use AsciiOutputModule for simple FWCore/Framework tests
Dr15Jones Sep 5, 2025
ff3d088
Use AsciiOutputModule for simple FWCore/Integration tests
Dr15Jones Sep 9, 2025
cb18c35
Removed identical test from run_TestEDAlias.sh
Dr15Jones Sep 9, 2025
3c557f6
Use TriggerResultsTestSource for missing path tests
Dr15Jones Sep 9, 2025
24985e1
Move merge testing to IOPool/Tests
Dr15Jones Sep 10, 2025
d5228e0
Removed unused run_all_t.sh
Dr15Jones Sep 10, 2025
4137845
Moved Pool part of ConcurrentIOVsAndRuns test
Dr15Jones Sep 10, 2025
b999adf
Move EDAlias storage test to IOPool/Tests
Dr15Jones Sep 10, 2025
597e6ee
Move ProcessBlock storage tests to IOPool/Tests
Dr15Jones Sep 10, 2025
7366d3a
Move EventHistory storage tests to IOPool/Tests
Dr15Jones Sep 10, 2025
dd135e1
drop on input tests moved to IOPool/Tests
Dr15Jones Sep 10, 2025
3da84cc
Moved thinning/slimming storage tests to IOPool/Tests
Dr15Jones Sep 10, 2025
18ddd2b
Moved SeriesOfProcesses test to IOPool/Tests
Dr15Jones Sep 11, 2025
1995e3f
Move GetBy tests to IOPool/Tests
Dr15Jones Sep 11, 2025
47df20b
Move more tests to IOPool/Tests
Dr15Jones Sep 11, 2025
4c075e8
Move ref related tests to IOPool/Tests
Dr15Jones Sep 11, 2025
bbfdfa7
Move fallback tests to IOPool/Tests
Dr15Jones Sep 11, 2025
b7f1719
Dictionary tests moved to IOPool/Tests
Dr15Jones Sep 11, 2025
a9ae0fe
Move last Pool tests from FWCore/Integration to IOPool/Tests
Dr15Jones Sep 11, 2025
e6aad23
Removed unused test configurations in MessageService
Dr15Jones Sep 12, 2025
eef4621
Removed unused cmsconfig.py and associated test file
Dr15Jones Sep 12, 2025
b0141e3
Remove last use of Pool in FWCore tests
Dr15Jones Sep 12, 2025
2588b1b
mark method as 'final'
Dr15Jones Sep 12, 2025
a876215
Properly find python file for test
Dr15Jones Sep 12, 2025
d36ff43
Remove unnecessary test step
Dr15Jones Sep 12, 2025
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
22 changes: 12 additions & 10 deletions FWCore/Framework/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@
<use name="FWCore/Utilities"/>
</library>

<library file="stubs/TriggerResultsTestSource.cc" name="FWCoreFrameworkTriggerResultsTestSource">
<flags EDM_PLUGIN="1"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="FWCore/Sources"/>
</library>


<bin name="TestFWCoreFramework" file="testRunner.cpp,maker2_t.cppunit.cc,maker_t.cppunit.cc,productregistry.cppunit.cc,edproducer_productregistry_callback.cc,event_getrefbeforeput_t.cppunit.cc,generichandle_t.cppunit.cc,edconsumerbase_t.cppunit.cc,global_producer_t.cppunit.cc,global_filter_t.cppunit.cc,one_outputmodule_t.cppunit.cc,global_outputmodule_t.cppunit.cc,stream_producer_t.cppunit.cc,stream_filter_t.cppunit.cc,limited_producer_t.cppunit.cc,limited_filter_t.cppunit.cc,limited_outputmodule_t.cppunit.cc,checkForModuleDependencyCorrectness_t.cppunit.cc">
<use name="DataFormats/Common"/>
<use name="DataFormats/Provenance"/>
Expand Down Expand Up @@ -338,16 +347,9 @@
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathSameProcessAnotherModuleBefore" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=sameProcess --anotherModule=before 2>&amp;1 | grep 'to request a trigger name that does not exist'"/>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathSameProcessAnotherModuleAfter" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=sameProcess --anotherModule=after 2>&amp;1 | grep 'to request a trigger name that does not exist'"/>

<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlier" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPathEarlier_cfg.py"/>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlierProcess" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=earlierProcess 2>&amp;1 | grep 'to request a trigger name that does not exist'">
<flags PRE_TEST="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlier"/>
</test>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlierProcessBefore" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=earlierProcess --anotherModule=before 2>&amp;1 | grep 'to request a trigger name that does not exist'">
<flags PRE_TEST="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlier"/>
</test>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlierProcessAfter" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=earlierProcess --anotherModule=after 2>&amp;1 | grep 'to request a trigger name that does not exist'">
<flags PRE_TEST="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlier"/>
</test>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlierProcess" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=earlierProcess 2>&amp;1 | grep 'to request a trigger name that does not exist'"/>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlierProcessBefore" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=earlierProcess --anotherModule=before 2>&amp;1 | grep 'to request a trigger name that does not exist'"/>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathEarlierProcessAfter" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=earlierProcess --anotherModule=after 2>&amp;1 | grep 'to request a trigger name that does not exist'"/>

<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathMissingProcess" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=missingProcess 2>&amp;1 | grep 'An exception of category .ProductNotFound'"/>
<test name="testFWCoreFrameworkOutputModuleSelectEventsMissingPathMissingProcessAnotherModuleBefore" command="cmsRun ${LOCALTOP}/src/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py --missingPath=missingProcess --anotherModule=before 2>&amp;1 | grep 'An exception of category .ProductNotFound'"/>
Expand Down
5 changes: 2 additions & 3 deletions FWCore/Framework/test/run_cmsRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ echo $F2 "This test intentionally throws an exception"
# Test maxEvents output parameter
F3=${LOCAL_TEST_DIR}/testMaxEventsOutput_cfg.py
echo $F3
(cmsRun $F3 ) || die "Failure running cmsRun $F3" $?
(cmsRun $F3 ) > testMaxEventsOutput.log 2>&1 || die "Failure running cmsRun $F3" $?
# 6th word on the line containing the string "events"
# output by edmFileUtil
nEvents=`edmFileUtil file:testMaxEventsOutput.root | grep events | awk ' {print $6; exit} '`
nEvents=`grep '>>> processed' testMaxEventsOutput.log | awk ' {print $3; exit} '`
if [ "$nEvents" -lt 6 ] || [ "$nEvents" -gt 9 ]; then
echo "maxEvents output test failed, nEvents = " $nEvents
exit 1
Expand Down
123 changes: 123 additions & 0 deletions FWCore/Framework/test/stubs/TriggerResultsTestSource.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#include "FWCore/Sources/interface/PuttableSourceBase.h"
#include "FWCore/Sources/interface/IDGeneratorSourceBase.h"
#include "FWCore/Framework/interface/InputSourceMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Version/interface/GetReleaseVersion.h"
#include "DataFormats/Common/interface/TriggerResults.h"
#include "DataFormats/Common/interface/Wrapper.h"

#include <memory>
namespace edmtest {
namespace {
edm::ProductDescription makeDesc(std::string const& iProcess) {
edm::ProductDescription desc(
edm::InEvent, "TriggerResults", iProcess, "", edm::TypeID(typeid(edm::TriggerResults)));
desc.setIsProvenanceSetOnRead();
desc.setProduced(false);
return desc;
}

std::pair<edm::ParameterSetID, edm::ParameterSetID> calcID(edm::ProductDescription const& iDesc,
std::vector<std::string> const& iPaths) {
edm::ParameterSet pset;
std::string const& processName = iDesc.processName();
typedef std::vector<std::string> vstring;
vstring empty;

vstring modlbl;
pset.addParameter("@all_sources", modlbl);

edm::ParameterSet triggerPaths;
triggerPaths.addParameter<vstring>("@trigger_paths", iPaths);
pset.addParameter<edm::ParameterSet>("@trigger_paths", triggerPaths);
triggerPaths.registerIt();

pset.addParameter<vstring>("@all_esmodules", empty);
pset.addParameter<vstring>("@all_esprefers", empty);
pset.addParameter<vstring>("@all_essources", empty);
pset.addParameter<vstring>("@all_loopers", empty);
pset.addParameter<vstring>("@all_modules", empty);
pset.addParameter<vstring>("@end_paths", empty);
pset.addParameter<vstring>("@paths", iPaths);
pset.addParameter<std::string>("@process_name", processName);
// Now we register the process parameter set.
pset.registerIt();

return std::make_pair(pset.id(), triggerPaths.id());
}
} // namespace
class TriggerResultsTestSource : public edm::IDGeneratorSourceBase<edm::PuttableSourceBase> {
public:
TriggerResultsTestSource(edm::ParameterSet const&, edm::InputSourceDescription const&);

void readEvent_(edm::EventPrincipal& eventPrincipal) final;

bool setRunAndEventInfo(edm::EventID& id,
edm::TimeValue_t& time,
edm::EventAuxiliary::ExperimentType& etype) override {
return true;
}
static void fillDescriptions(edm::ConfigurationDescriptions&);

private:
const std::string process_;
const std::vector<std::string> paths_;
const std::vector<unsigned int> states_;
const edm::ProductDescription desc_;
edm::ParameterSetID processPsetID_;
edm::ParameterSetID psetID_;
};

TriggerResultsTestSource::TriggerResultsTestSource(edm::ParameterSet const& iPSet,
edm::InputSourceDescription const& iDesc)
: edm::IDGeneratorSourceBase<edm::PuttableSourceBase>(iPSet, iDesc, false),
process_(iPSet.getUntrackedParameter<std::string>("process")),
paths_(iPSet.getUntrackedParameter<std::vector<std::string>>("paths")),
states_(iPSet.getUntrackedParameter<std::vector<unsigned int>>("pathStates")),
desc_(makeDesc(process_)) {
{
auto [processPsetID, psetID] = calcID(desc_, paths_);
processPsetID_ = std::move(processPsetID);
psetID_ = std::move(psetID);
}
std::vector<edm::BranchDescription> products;
products.reserve(1);
products.emplace_back(desc_);
std::vector<std::string> processOrder(1, process_);
productRegistryUpdate().updateFromInput(products, processOrder);
assert(paths_.size() == states_.size());

edm::ProcessHistory ph;
ph.emplace_back(process_, processPsetID_, edm::getReleaseVersion(), edm::HardwareResourcesDescription());
processHistoryRegistryForUpdate().registerProcessHistory(ph);
}

void TriggerResultsTestSource::fillDescriptions(edm::ConfigurationDescriptions& iConfigs) {
edm::ParameterSetDescription desc;
edm::IDGeneratorSourceBase<edm::PuttableSourceBase>::fillDescription(desc);
desc.addUntracked<std::string>("process", std::string(""));
desc.addUntracked<std::vector<std::string>>("paths")->setComment("names of paths");
desc.addUntracked<std::vector<unsigned int>>("pathStates")
->setComment(
"The state of the path. The number of entires must be the same as in 'paths' and the value must be between "
"0-2 inclusive.");

iConfigs.addDefault(desc);
}

void TriggerResultsTestSource::readEvent_(edm::EventPrincipal& eventPrincipal) {
doReadEvent(eventPrincipal, [this](edm::EventPrincipal& eventPrincipal) {
edm::HLTGlobalStatus status(paths_.size());
for (std::size_t i = 0; i < paths_.size(); ++i) {
status.at(i) = edm::HLTPathStatus(static_cast<edm::hlt::HLTState>(states_[i]));
}

auto ptr = std::make_unique<edm::Wrapper<edm::TriggerResults>>(edm::WrapperBase::Emplace(), status, psetID_);
eventPrincipal.put(desc_, std::move(ptr), edm::ProductProvenance(desc_.branchID()));
});
}
} // namespace edmtest

using edmtest::TriggerResultsTestSource;
DEFINE_FWK_INPUT_SOURCE(TriggerResultsTestSource);
6 changes: 3 additions & 3 deletions FWCore/Framework/test/testMaxEventsOutput_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
)

process.p1 = cms.Path(process.busy1)
process.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('testMaxEventsOutput.root')
)

from FWCore.Modules.modules import AsciiOutputModule
process.out = AsciiOutputModule(verbosity=0)

process.e = cms.EndPath(process.out)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

process.source = cms.Source("EmptySource")
if args.missingPath == "earlierProcess":
process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring("file:testOutputModuleSelectEventsMissingPath.root"))
process.source = cms.Source("TriggerResultsTestSource", paths = cms.untracked.vstring("p1"), pathStates=cms.untracked.vuint32(2), process=cms.untracked.string("EARLIER"))
process.maxEvents.input = 3

selectEvents = {
Expand Down
4 changes: 1 addition & 3 deletions FWCore/Framework/test/testPathStatus_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@

process.prod1 = cms.EDProducer("IntProducer", ivalue = cms.int32(1))

process.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('testPathStatus.root')
)
process.out = cms.OutputModule("AsciiOutputModule", verbosity = cms.untracked.uint32(0))

process.path1 = cms.Path(process.prod1 * process.f1 * process.f2)
process.path2 = cms.Path()
Expand Down
4 changes: 1 addition & 3 deletions FWCore/Framework/test/testPrintDependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

process.OtherThing = cms.EDProducer("OtherThingProducer")

process.output = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('file:PoolOutputTest.root')
)
process.output = cms.OutputModule("AsciiOutputModule", verbosity = cms.untracked.uint32(0))

process.source = cms.Source("EmptySource")

Expand Down
6 changes: 0 additions & 6 deletions FWCore/Integration/test/AssociationMapTest_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,4 @@
associationMapTag8 = cms.InputTag("associationMapProducer", "twoArg")
)

process.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('AssociationMapTest.root')
)

process.p = cms.Path(process.intvec1 * process.intvec2 * process.associationMapProducer * process.test)

process.e = cms.EndPath(process.out)
Loading