diff --git a/FWCore/Framework/test/BuildFile.xml b/FWCore/Framework/test/BuildFile.xml index a8632195155d2..38566cd53545b 100644 --- a/FWCore/Framework/test/BuildFile.xml +++ b/FWCore/Framework/test/BuildFile.xml @@ -193,6 +193,15 @@ + + + + + + + + + @@ -338,16 +347,9 @@ - - - - - - - - - - + + + diff --git a/FWCore/Framework/test/run_cmsRun.sh b/FWCore/Framework/test/run_cmsRun.sh index 6e167c2e68e68..557b95a4f9aa2 100755 --- a/FWCore/Framework/test/run_cmsRun.sh +++ b/FWCore/Framework/test/run_cmsRun.sh @@ -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 diff --git a/FWCore/Framework/test/stubs/TriggerResultsTestSource.cc b/FWCore/Framework/test/stubs/TriggerResultsTestSource.cc new file mode 100644 index 0000000000000..5b466d8d681f7 --- /dev/null +++ b/FWCore/Framework/test/stubs/TriggerResultsTestSource.cc @@ -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 +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 calcID(edm::ProductDescription const& iDesc, + std::vector const& iPaths) { + edm::ParameterSet pset; + std::string const& processName = iDesc.processName(); + typedef std::vector vstring; + vstring empty; + + vstring modlbl; + pset.addParameter("@all_sources", modlbl); + + edm::ParameterSet triggerPaths; + triggerPaths.addParameter("@trigger_paths", iPaths); + pset.addParameter("@trigger_paths", triggerPaths); + triggerPaths.registerIt(); + + pset.addParameter("@all_esmodules", empty); + pset.addParameter("@all_esprefers", empty); + pset.addParameter("@all_essources", empty); + pset.addParameter("@all_loopers", empty); + pset.addParameter("@all_modules", empty); + pset.addParameter("@end_paths", empty); + pset.addParameter("@paths", iPaths); + pset.addParameter("@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 { + 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 paths_; + const std::vector states_; + const edm::ProductDescription desc_; + edm::ParameterSetID processPsetID_; + edm::ParameterSetID psetID_; + }; + + TriggerResultsTestSource::TriggerResultsTestSource(edm::ParameterSet const& iPSet, + edm::InputSourceDescription const& iDesc) + : edm::IDGeneratorSourceBase(iPSet, iDesc, false), + process_(iPSet.getUntrackedParameter("process")), + paths_(iPSet.getUntrackedParameter>("paths")), + states_(iPSet.getUntrackedParameter>("pathStates")), + desc_(makeDesc(process_)) { + { + auto [processPsetID, psetID] = calcID(desc_, paths_); + processPsetID_ = std::move(processPsetID); + psetID_ = std::move(psetID); + } + std::vector products; + products.reserve(1); + products.emplace_back(desc_); + std::vector 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::fillDescription(desc); + desc.addUntracked("process", std::string("")); + desc.addUntracked>("paths")->setComment("names of paths"); + desc.addUntracked>("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(states_[i])); + } + + auto ptr = std::make_unique>(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); diff --git a/FWCore/Framework/test/testMaxEventsOutput_cfg.py b/FWCore/Framework/test/testMaxEventsOutput_cfg.py index 819863e34d7d5..3f21238c81bc3 100644 --- a/FWCore/Framework/test/testMaxEventsOutput_cfg.py +++ b/FWCore/Framework/test/testMaxEventsOutput_cfg.py @@ -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) diff --git a/FWCore/Framework/test/testOutputModuleSelectEventsMissingPathEarlier_cfg.py b/FWCore/Framework/test/testOutputModuleSelectEventsMissingPathEarlier_cfg.py deleted file mode 100644 index 8276b3d8a74ca..0000000000000 --- a/FWCore/Framework/test/testOutputModuleSelectEventsMissingPathEarlier_cfg.py +++ /dev/null @@ -1,17 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("EARLIER") - -process.source = cms.Source("EmptySource") -process.maxEvents.input = 3 - -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string("testOutputModuleSelectEventsMissingPath.root") -) - -process.intprod = cms.EDProducer("IntProducer", ivalue=cms.int32(3)) - -process.p = cms.Path(process.intprod) - -process.ep3 = cms.EndPath(process.out) - diff --git a/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py b/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py index 68f8281725aa2..7c22c63cdb58b 100644 --- a/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py +++ b/FWCore/Framework/test/testOutputModuleSelectEventsMissingPath_cfg.py @@ -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 = { diff --git a/FWCore/Framework/test/testPathStatus_cfg.py b/FWCore/Framework/test/testPathStatus_cfg.py index 6c49ad0449f56..97f22004b880a 100644 --- a/FWCore/Framework/test/testPathStatus_cfg.py +++ b/FWCore/Framework/test/testPathStatus_cfg.py @@ -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() diff --git a/FWCore/Framework/test/testPrintDependencies.py b/FWCore/Framework/test/testPrintDependencies.py index 1cdf76e3a0443..a87d20f7e1c9e 100644 --- a/FWCore/Framework/test/testPrintDependencies.py +++ b/FWCore/Framework/test/testPrintDependencies.py @@ -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") diff --git a/FWCore/Integration/test/AssociationMapTest_cfg.py b/FWCore/Integration/test/AssociationMapTest_cfg.py index 010847ac68d3c..94099fa39dea1 100644 --- a/FWCore/Integration/test/AssociationMapTest_cfg.py +++ b/FWCore/Integration/test/AssociationMapTest_cfg.py @@ -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) diff --git a/FWCore/Integration/test/BuildFile.xml b/FWCore/Integration/test/BuildFile.xml index 7cd52f161d90f..6873393bfa569 100644 --- a/FWCore/Integration/test/BuildFile.xml +++ b/FWCore/Integration/test/BuildFile.xml @@ -7,7 +7,6 @@ - @@ -17,21 +16,14 @@ - - - - - + + + + - - - - - - @@ -39,11 +31,8 @@ - - - @@ -112,6 +101,10 @@ + + + + @@ -135,84 +128,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FWCore/Integration/test/CatchCmsExceptiontest.sh b/FWCore/Integration/test/CatchCmsExceptiontest.sh index cd09bace0de44..0a4d87c5096a4 100755 --- a/FWCore/Integration/test/CatchCmsExceptiontest.sh +++ b/FWCore/Integration/test/CatchCmsExceptiontest.sh @@ -10,16 +10,3 @@ grep -q WhatsItESProducer CatchCmsException.log || die 'Failed to find Producers #echo running cmsRun testSkipEvent_cfg.py #cmsRun ${LOCAL_TEST_DIR}/testSkipEvent_cfg.py &> testSkipEvent.log || die 'Failed in using testSkipEvent_cfg.py' $? - -#echo running cmsRun CatchCmsExceptionFromSource_cfg.py - -#cmsRun ${LOCAL_TEST_DIR}/CatchCmsExceptionFromSource_cfg.py &> CatchCmsExceptionFromSource.log && \ -#die 'Failed because expected exception was not thrown while running cmsRun CatchCmsExceptionFromSource_cfg.py' 1 - -#grep -q "Calling Source::beginRun" CatchCmsExceptionFromSource.log || die 'Failed to find string Calling Source::beginRun' $? - -# It is intentional that this test throws an exception. The test fails if it does not. -cmsRun ${LOCAL_TEST_DIR}/testMissingDictionaryChecking_cfg.py &> testMissingDictionaryChecking.log && die 'Failed to get exception running testMissingDictionaryChecking_cfg.py' 1 -grep -q MissingDictionaryTestF testMissingDictionaryChecking.log || die 'Failed to print out exception message with missing dictionary listed' $? - -#grep -w ESProducer CatcheStdException.log diff --git a/FWCore/Integration/test/eventSetupTest.sh b/FWCore/Integration/test/eventSetupTest.sh index 0b2a1303872ee..d1d7ef208d636 100755 --- a/FWCore/Integration/test/eventSetupTest.sh +++ b/FWCore/Integration/test/eventSetupTest.sh @@ -44,9 +44,6 @@ grep "A module declared it consumes an EventSetup product after its constructor" echo testConcurrentIOVsAndRuns_cfg.py cmsRun ${LOCAL_TEST_DIR}/testConcurrentIOVsAndRuns_cfg.py || die 'Failed in testConcurrentIOVsAndRuns_cfg.py' $? -echo testConcurrentIOVsAndRunsRead_cfg.py -cmsRun ${LOCAL_TEST_DIR}/testConcurrentIOVsAndRunsRead_cfg.py || die 'Failed in testConcurrentIOVsAndRunsRead_cfg.py' $? - echo testESProducerUsingAcquire_cfg.py cmsRun ${LOCAL_TEST_DIR}/testESProducerUsingAcquire_cfg.py || die 'Failed in testESProducerUsingAcquire_cfg.py' $? diff --git a/FWCore/Integration/test/refTest.sh b/FWCore/Integration/test/refTest.sh index 01afd34785215..288d9164e25e1 100755 --- a/FWCore/Integration/test/refTest.sh +++ b/FWCore/Integration/test/refTest.sh @@ -9,6 +9,3 @@ cmsRun ${LOCAL_TEST_DIR}/RefTest_cfg.py || die 'Failed in RefTest_cfg.py' $? echo cmsRun AssociationMapTest_cfg.py cmsRun ${LOCAL_TEST_DIR}/AssociationMapTest_cfg.py || die 'Failed in AssociationMapTest_cfg.py' $? - -echo cmsRun AssociationMapReadTest_cfg.py -cmsRun ${LOCAL_TEST_DIR}/AssociationMapReadTest_cfg.py || die 'Failed in AssociationMapReadTest_cfg.py' $? diff --git a/FWCore/Integration/test/run_TestConsumesInfo.sh b/FWCore/Integration/test/run_TestConsumesInfo.sh new file mode 100755 index 0000000000000..b9d95055da164 --- /dev/null +++ b/FWCore/Integration/test/run_TestConsumesInfo.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +test=testGetBy + +function die { echo Failure $1: status $2 ; exit $2 ; } + +LOCAL_TEST_DIR=${SCRAM_TEST_PATH} + + echo "testConsumesInfo" + cmsRun ${LOCAL_TEST_DIR}/testConsumesInfo_cfg.py > testConsumesInfo.log 2>/dev/null || die "cmsRun testConsumesInfo_cfg.py" $? + grep -v '++\|LegacyModules\|time' testConsumesInfo.log > testConsumesInfo_1.log + rm testConsumesInfo.log + diff ${LOCAL_TEST_DIR}/unit_test_outputs/testConsumesInfo_1.log testConsumesInfo_1.log || die "comparing testConsumesInfo_1.log" $? + +exit 0 diff --git a/FWCore/Integration/test/run_TestEDAlias.sh b/FWCore/Integration/test/run_TestEDAlias.sh index 3c410cb42aabb..0031eba59e204 100755 --- a/FWCore/Integration/test/run_TestEDAlias.sh +++ b/FWCore/Integration/test/run_TestEDAlias.sh @@ -10,18 +10,6 @@ LOCAL_TEST_DIR=${SCRAM_TEST_PATH} echo "EDAlias consumer in a Task" cmsRun ${LOCAL_TEST_DIR}/${test}Task_cfg.py || die "cmsRun ${test}Task_cfg.py 1" $? - echo "*************************************************" - echo "Test output" - cmsRun ${LOCAL_TEST_DIR}/${test}Analyze_cfg.py testEDAliasTask.root || die "cmsRun ${test}Analyze_cfg.py testEDAliasTask.root" $? - - echo "*************************************************" - echo "EDAlias consumer in a Path" - cmsRun ${LOCAL_TEST_DIR}/${test}Path_cfg.py || die "cmsRun ${test}Path_cfg.py 1" $? - - echo "*************************************************" - echo "Test output" - cmsRun ${LOCAL_TEST_DIR}/${test}Analyze_cfg.py testEDAliasTask.root || die "cmsRun ${test}Analyze_cfg.py testEDAliasPath.root" $? - echo "*************************************************" echo "Test EDAlias aliasing for many modules" cmsRun ${LOCAL_TEST_DIR}/${test}ManyModules_cfg.py || die "cmsRun ${test}ManyModules_cfg.py 1" $? diff --git a/FWCore/Integration/test/run_TestEmptyRootFile.sh b/FWCore/Integration/test/run_TestEmptyRootFile.sh deleted file mode 100755 index a5c4ec3e9bcdf..0000000000000 --- a/FWCore/Integration/test/run_TestEmptyRootFile.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -function die { echo Failure $1: status $2 ; exit $2 ; } - -LOCAL_TEST_DIR=${SCRAM_TEST_PATH} - -echo "write empty file" -cmsRun ${LOCAL_TEST_DIR}/makeEmptyRootFile.py || die "cmsRun makeEmptyRootFile.py" $? - -echo "read empty file" -cmsRun ${LOCAL_TEST_DIR}/useEmptyRootFile.py || die "cmsRun useEmptyRootFile.py" $? - -exit 0 diff --git a/FWCore/Integration/test/run_TestOutput.sh b/FWCore/Integration/test/run_TestOutput.sh index ce1f47af9c212..385e7fea1f9df 100755 --- a/FWCore/Integration/test/run_TestOutput.sh +++ b/FWCore/Integration/test/run_TestOutput.sh @@ -38,32 +38,4 @@ LOCAL_TEST_DIR=${SCRAM_TEST_PATH} grep "limited globalEndLuminosityBlock" testOutput1.log > /dev/null || die "grep failed to find 'limited globalEndLuminosityBlock'" $? grep "limited branchID 3673681161" testOutput1.log > /dev/null || die "grep failed to find 'limited branchID 3673681161'" $? - # Above we tested using EmptySource. Repeat reading a file using PoolSource - echo "testOutput2" - cmsRun ${LOCAL_TEST_DIR}/${test}2_cfg.py 2> testOutput2.log || die "cmsRun ${test}2_cfg.py" $? - - grep "global write event" testOutput2.log > /dev/null || die "grep failed to find 'global write event'" $? - grep "global writeLuminosityBlock" testOutput2.log > /dev/null || die "grep failed to find 'global writeLuminosityBlock'" $? - grep "global writeRun" testOutput2.log > /dev/null || die "grep failed to find 'global writeRun'" $? - grep "global writeProcessBlock" testOutput2.log > /dev/null || die "grep failed to find 'global writeProcessBlock'" $? - grep "global respondToOpenInputFile" testOutput2.log > /dev/null || die "grep failed to find 'global respondToOpenInputFile'" $? - grep "global respondToCloseInputFile" testOutput2.log > /dev/null || die "grep failed to find 'global respondToCloseInputFile'" $? - grep "global globalBeginRun" testOutput2.log > /dev/null || die "grep failed to find 'global globalBeginRun'" $? - grep "global globalEndRun" testOutput2.log > /dev/null || die "grep failed to find 'global globalEndRun'" $? - grep "global globalBeginLuminosityBlock" testOutput2.log > /dev/null || die "grep failed to find 'global globalBeginLuminosityBlock'" $? - grep "global globalEndLuminosityBlock" testOutput2.log > /dev/null || die "grep failed to find 'global globalEndLuminosityBlock'" $? - grep "global branchID 4057644746" testOutput2.log > /dev/null || die "grep failed to find 'global branchID 4057644746'" $? - - grep "limited write event" testOutput2.log > /dev/null || die "grep failed to find 'limited write event'" $? - grep "limited writeLuminosityBlock" testOutput2.log > /dev/null || die "grep failed to find 'limited writeLuminosityBlock'" $? - grep "limited writeRun" testOutput2.log > /dev/null || die "grep failed to find 'limited writeRun'" $? - grep "limited writeProcessBlock" testOutput2.log > /dev/null || die "grep failed to find 'limited writeProcessBlock'" $? - grep "limited respondToOpenInputFile" testOutput2.log > /dev/null || die "grep failed to find 'limited respondToOpenInputFile'" $? - grep "limited respondToCloseInputFile" testOutput2.log > /dev/null || die "grep failed to find 'limited respondToCloseInputFile'" $? - grep "limited globalBeginRun" testOutput2.log > /dev/null || die "grep failed to find 'limited globalBeginRun'" $? - grep "limited globalEndRun" testOutput2.log > /dev/null || die "grep failed to find 'limited globalEndRun'" $? - grep "limited globalBeginLuminosityBlock" testOutput2.log > /dev/null || die "grep failed to find 'limited globalBeginLuminosityBlock'" $? - grep "limited globalEndLuminosityBlock" testOutput2.log > /dev/null || die "grep failed to find 'limited globalEndLuminosityBlock'" $? - grep "limited branchID 4057644746" testOutput2.log > /dev/null || die "grep failed to find 'limited branchID 4057644746'" $? - exit 0 diff --git a/FWCore/Integration/test/run_all_t.sh b/FWCore/Integration/test/run_all_t.sh deleted file mode 100755 index a9cb62ab9516c..0000000000000 --- a/FWCore/Integration/test/run_all_t.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - - -# Pass in name and status -function die { echo $1: status $2 ; exit $2; } - -LOCAL_TEST_DIR=${SCRAM_TEST_PATH} - -${LOCAL_TEST_DIR}/refTest.sh || die 'Failed in refTest.sh' $? - -${LOCAL_TEST_DIR}/transRefTest.sh || die 'Failed in transRefTest.sh' $? - -${LOCAL_TEST_DIR}/inputSourceTest.sh || die 'Failed in inputSourceTest.sh' $? - -${LOCAL_TEST_DIR}/inputExtSourceTest.sh || die 'Failed in inputExtSourceTest.sh' $? - -${LOCAL_TEST_DIR}/eventSetupTest.sh || die 'Failed in eventSetupTest.sh' $? - -${LOCAL_TEST_DIR}/hierarchy_example.sh || die 'Failed in hierarchy_example.sh' $? - -${LOCAL_TEST_DIR}/service_example.sh || die 'Failed in service_example.sh' $? - diff --git a/FWCore/Integration/test/standalone_t.cppunit.cc b/FWCore/Integration/test/standalone_t.cppunit.cc index c5a9b843fc7e0..3a31663ee4695 100644 --- a/FWCore/Integration/test/standalone_t.cppunit.cc +++ b/FWCore/Integration/test/standalone_t.cppunit.cc @@ -62,9 +62,7 @@ void testStandalone::writeAndReadFile() { "process.m1 = cms.EDProducer('IntProducer',\n" " ivalue = cms.int32(11)\n" ")\n" - "process.out = cms.OutputModule('PoolOutputModule',\n" - " fileName = cms.untracked.string('testStandalone.root')\n" - ")\n" + "process.out = cms.OutputModule('AsciiOutputModule')\n" "process.p = cms.Path(process.m1)\n" "process.e = cms.EndPath(process.out)\n"); @@ -73,21 +71,4 @@ void testStandalone::writeAndReadFile() { proc.run(); proc.endJob(); } - - { - std::string configuration( - "import FWCore.ParameterSet.Config as cms\n" - "process = cms.Process('TEST1')\n" - "process.source = cms.Source('PoolSource',\n" - " fileNames = cms.untracked.vstring('file:testStandalone.root')\n" - ")\n" - "process.InitRootHandlers = cms.Service('InitRootHandlers')\n" - "process.JobReportService = cms.Service('JobReportService')\n" - "process.add_(cms.Service('SiteLocalConfigService'))\n"); - - edm::EventProcessor proc(edm::getPSetFromConfig(configuration)); - proc.beginJob(); - proc.run(); - proc.endJob(); - } } diff --git a/FWCore/Integration/test/testConcurrentIOVsAndRuns_cfg.py b/FWCore/Integration/test/testConcurrentIOVsAndRuns_cfg.py index 04fa4744b7718..2dd00ae1fd668 100644 --- a/FWCore/Integration/test/testConcurrentIOVsAndRuns_cfg.py +++ b/FWCore/Integration/test/testConcurrentIOVsAndRuns_cfg.py @@ -45,9 +45,3 @@ process.busy1 = cms.EDProducer("BusyWaitIntProducer",ivalue = cms.int32(1), iterations = cms.uint32(40*1000*1000)) process.p1 = cms.Path(process.busy1 * process.test) - -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('testConcurrentIOVsAndRuns.root') -) - -process.e = cms.EndPath(process.out) diff --git a/FWCore/Integration/test/testConsumesInfo_cfg.py b/FWCore/Integration/test/testConsumesInfo_cfg.py index 7beeb5edfd22c..ce230a523a462 100644 --- a/FWCore/Integration/test/testConsumesInfo_cfg.py +++ b/FWCore/Integration/test/testConsumesInfo_cfg.py @@ -29,8 +29,8 @@ input = cms.untracked.int32(3) ) -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('testConsumesInfo.root'), +process.out = cms.OutputModule("AsciiOutputModule", + verbosity = cms.untracked.uint32(0), outputCommands = cms.untracked.vstring( 'keep *', 'drop *_intProducerA_*_*', diff --git a/FWCore/Integration/test/testEDAliasPath_cfg.py b/FWCore/Integration/test/testEDAliasPath_cfg.py index 118388aebcd33..0c384f477e756 100644 --- a/FWCore/Integration/test/testEDAliasPath_cfg.py +++ b/FWCore/Integration/test/testEDAliasPath_cfg.py @@ -14,8 +14,7 @@ input = cms.untracked.int32(3) ) -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('testEDAliasPath.root'), +process.out = cms.OutputModule("AsciiOutputModule", outputCommands = cms.untracked.vstring( 'keep *_intProducer_*_*', ) diff --git a/FWCore/Integration/test/testEDAliasTask_cfg.py b/FWCore/Integration/test/testEDAliasTask_cfg.py index 9b1bef9cd5fa7..5c4c7e69c38ec 100644 --- a/FWCore/Integration/test/testEDAliasTask_cfg.py +++ b/FWCore/Integration/test/testEDAliasTask_cfg.py @@ -14,8 +14,7 @@ input = cms.untracked.int32(3) ) -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('testEDAliasTask.root'), +process.out = cms.OutputModule("AsciiOutputModule", outputCommands = cms.untracked.vstring( 'keep *_intProducer_*_*', ) diff --git a/FWCore/Integration/test/testIllegalSourceParameter_cfg.py b/FWCore/Integration/test/testIllegalSourceParameter_cfg.py index a0b16cf51dfab..30e5ae0a14c9b 100644 --- a/FWCore/Integration/test/testIllegalSourceParameter_cfg.py +++ b/FWCore/Integration/test/testIllegalSourceParameter_cfg.py @@ -12,7 +12,7 @@ # Intentionally define a parameter that does not # exist in the ParameterSetDescription which # should result in an exception. -process.source = cms.Source("PoolSource", +process.source = cms.Source("EmptySource", fileNames = cms.untracked.vstring("file:dummy.root"), doesNotExist = cms.bool(True)) diff --git a/FWCore/Integration/test/testOutput1_cfg.py b/FWCore/Integration/test/testOutput1_cfg.py index bc39d0c017478..10bf38c10fc47 100644 --- a/FWCore/Integration/test/testOutput1_cfg.py +++ b/FWCore/Integration/test/testOutput1_cfg.py @@ -30,14 +30,6 @@ ) ) -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('testOutput1.root'), - outputCommands = cms.untracked.vstring( - 'keep *', - 'drop *_intProducerA_*_*' - ) -) - process.path = cms.Path(process.intProducerA) -process.endpath = cms.EndPath(process.testout + process.testoutlimited + process.out) +process.endpath = cms.EndPath(process.testout + process.testoutlimited) diff --git a/FWCore/Integration/test/testProducesCollector_cfg.py b/FWCore/Integration/test/testProducesCollector_cfg.py index ee78c42e4c528..8be5442049c76 100644 --- a/FWCore/Integration/test/testProducesCollector_cfg.py +++ b/FWCore/Integration/test/testProducesCollector_cfg.py @@ -15,9 +15,7 @@ process.producerUsingCollector = cms.EDProducer("ProducerUsingCollector") -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('testProducesCollector.root') -) +process.out = cms.OutputModule("AsciiOutputModule") process.test = cms.EDAnalyzer("TestFindProduct", inputTags = cms.untracked.VInputTag(cms.InputTag("producerUsingCollector"), diff --git a/FWCore/Integration/test/testSkipEvent_cfg.py b/FWCore/Integration/test/testSkipEvent_cfg.py index 725fbfc685387..8f40675905949 100644 --- a/FWCore/Integration/test/testSkipEvent_cfg.py +++ b/FWCore/Integration/test/testSkipEvent_cfg.py @@ -81,9 +81,8 @@ onlyOne = cms.untracked.bool(False) ) -from IOPool.Output.modules import PoolOutputModule -process.out = PoolOutputModule( - fileName = 'testSkipEvent.root', +from FWCore.Modules.modules import AsciiOutputModule +process.out = AsciiOutputModule( SelectEvents = dict(SelectEvents = ['p1']) ) diff --git a/FWCore/Integration/test/unit_test_outputs/testConsumesInfo_1.log b/FWCore/Integration/test/unit_test_outputs/testConsumesInfo_1.log index f60c5a802b055..9b037f8c55b3b 100644 --- a/FWCore/Integration/test/unit_test_outputs/testConsumesInfo_1.log +++ b/FWCore/Integration/test/unit_test_outputs/testConsumesInfo_1.log @@ -85,7 +85,7 @@ All modules and modules in the current process whose products they consume: IntProducerEndProcessBlock/'intProducerEndProcessBlock' IntProducer/'intProducerU' IntVectorProducer/'intVectorProducer' - PoolOutputModule/'out' + AsciiOutputModule/'out' consumes products from these modules: TriggerResultInserter/'TriggerResults' IntProducer/'intProducerA' @@ -217,7 +217,7 @@ stating whether it matched the actual module label of the producer. IntProducerEndProcessBlock/'intProducerEndProcessBlock' IntProducer/'intProducerU' IntVectorProducer/'intVectorProducer' - PoolOutputModule/'out' + AsciiOutputModule/'out' consumes: edm::TriggerResults 'TriggerResults' '' 'PROD1' edmtest::IntProduct 'aliasForInt' '' 'PROD1' @@ -389,3 +389,4 @@ TestFindProduct sum = 300 TestFindProduct sum = 300 TestFindProduct sum = 220000 TestFindProduct sum = 33 +>>> processed 3 events diff --git a/FWCore/MessageService/test/bug75836_cfg.py b/FWCore/MessageService/test/bug75836_cfg.py deleted file mode 100644 index 3c189849a689d..0000000000000 --- a/FWCore/MessageService/test/bug75836_cfg.py +++ /dev/null @@ -1,16 +0,0 @@ -import FWCore.ParameterSet.Config as cms -process = cms.Process("MERGE") - -process.source = cms.Source("PoolSource", - fileNames = -cms.untracked.vstring("ref_merge_prod1.root", - "ref_merge_prod2.root") - ) - -process.out = cms.OutputModule("PoolOutputModule", - fileName = -cms.untracked.string("ref_merge.root") - ) - -process.o = cms.EndPath(process.out) - diff --git a/FWCore/MessageService/test/bug75836a_cfg.py b/FWCore/MessageService/test/bug75836a_cfg.py deleted file mode 100644 index ce19d06bd802f..0000000000000 --- a/FWCore/MessageService/test/bug75836a_cfg.py +++ /dev/null @@ -1,9 +0,0 @@ -import FWCore.ParameterSet.Config as cms -process = cms.Process("MERGE") - -process.source = cms.Source("EmptySource") - -process.thing = cms.EDProducer ("IntProducer") - -process.o = cms.Path(process.thing) - diff --git a/FWCore/MessageService/test/bug75836b_cfg.py b/FWCore/MessageService/test/bug75836b_cfg.py deleted file mode 100644 index be703d1cdb958..0000000000000 --- a/FWCore/MessageService/test/bug75836b_cfg.py +++ /dev/null @@ -1,16 +0,0 @@ -import FWCore.ParameterSet.Config as cms -process = cms.Process("MERGE") - -process.source = cms.Source("EmptySource") - -process.doit = cms.EDAnalyzer ("IntTestAnalyzer", - valueMustMatch = cms.untracked.int32(90), - moduleLabel = cms.untracked.InputTag("missing")) - -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(3)) - -process.o = cms.Path(process.doit) - -process.options = cms.untracked.PSet( - StopProcessing = cms.untracked.vstring('ProductNotFound') ) - diff --git a/FWCore/Modules/test/testBunchCrossingFilter.py b/FWCore/Modules/test/testBunchCrossingFilter.py deleted file mode 100644 index c50d2fa360c4c..0000000000000 --- a/FWCore/Modules/test/testBunchCrossingFilter.py +++ /dev/null @@ -1,80 +0,0 @@ -# simple test for the BunchCrossingFilter - -# colliding bunches in run 317435, fill 6759, scheme 25ns_2556b_2544_2215_2332_144bpi_20injV2: -# 81-128, 136-183 -# 215-262, 270-317, 325-372, -# 404-451, 459-506, 514-561, -# 593-640, 648-695, 703-750, -# 786-833, 841-888, -# 920-967, 975-1022, 1030-1077, -# 1109-1156, 1164-1211, 1219-1266, -# 1298-1345, 1353-1400, 1408-1455, -# 1487-1534, 1542-1589, 1597-1644, -# 1680-1727, 1735-1782, -# 1814-1861, 1869-1916, 1924-1971, -# 2003-2050, 2058-2105, 2113-2160, -# 2192-2239, 2247-2294, 2302-2349, -# 2381-2428, 2436-2483, 2491-2538, -# 2574-2621, 2629-2676, -# 2708-2755, 2763-2810, 2818-2865, -# 2897-2944, 2952-2999, 3007-3054, -# 3086-3133, 3141-3188, 3196-3243, -# 3275-3322, 3330-3377, 3385-3432 -# (see https://lpc.web.cern.ch/fillingSchemes/2018/25ns_2556b_2544_2215_2332_144bpi_20injV2.csv) - -from builtins import range -import FWCore.ParameterSet.Config as cms -from FWCore.ParameterSet.pfnInPath import * - -process = cms.Process('TEST') - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.options = cms.untracked.PSet( - wantSummary = cms.untracked.bool(True) -) - -process.load('FWCore.MessageService.MessageLogger_cfi') - -# input data -process.source = cms.Source('PoolSource', - fileNames = cms.untracked.pfnInPaths('FWCore/Modules/data/rawData_empty_CMSSW_10_2_0.root') -) - -from FWCore.Modules.bunchCrossingFilter_cfi import bunchCrossingFilter as _bunchCrossingFilter - -# empty input, do not select any bunch crossings -process.selectNone = _bunchCrossingFilter.clone( - bunches = cms.vuint32(), -) - -# full range of possible bunch crossings [1,3564] -process.selectAll = _bunchCrossingFilter.clone( - bunches = cms.vuint32(list(range(1,3565))) -) - -# select bx 536 -process.selectSingle = _bunchCrossingFilter.clone( - bunches = cms.vuint32(536) -) - -# select the whole train 514-561 -process.selectTrain = _bunchCrossingFilter.clone( - bunches = cms.vuint32(list(range(514,562))) -) - -# inverted to veto (non-colliding) bx 1 -process.selectEmpty = _bunchCrossingFilter.clone( - bunches = cms.vuint32(1) -) - -process.SelectNone = cms.Path( process.selectNone ) -process.SelectAll = cms.Path( process.selectAll ) -process.SelectSingle = cms.Path( process.selectSingle ) -process.SelectTrain = cms.Path( process.selectTrain ) -process.VetoEmpty = cms.Path( ~ process.selectEmpty ) -process.VetoSingle = cms.Path( ~ process.selectSingle ) -process.VetoTrain = cms.Path( ~ process.selectTrain ) -process.SelectTrainButOne = cms.Path( process.selectTrain * ~ process.selectSingle ) diff --git a/FWCore/Modules/test/testEventAuxiliaryHistory_cfg.py b/FWCore/Modules/test/testEventAuxiliaryHistory_cfg.py index 8079e0215b5bb..4cfbdcb3e6c15 100644 --- a/FWCore/Modules/test/testEventAuxiliaryHistory_cfg.py +++ b/FWCore/Modules/test/testEventAuxiliaryHistory_cfg.py @@ -19,11 +19,5 @@ ) -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('test.root') -) - process.p1 = cms.Path(process.aux) - -process.e1 = cms.EndPath(process.out) diff --git a/FWCore/ParameterSet/test/cmsconfig.py b/FWCore/ParameterSet/test/cmsconfig.py deleted file mode 100644 index 193651f3abcfe..0000000000000 --- a/FWCore/ParameterSet/test/cmsconfig.py +++ /dev/null @@ -1,432 +0,0 @@ -#------------------------------------------------------------ -# -# -# cmsconfig: a class to provide convenient access to the Python form -# of a parsed CMS configuration file. -# -# Note: we have not worried about security. Be careful about strings -# you put into this; we use a naked 'eval'! -# -#------------------------------------------------------------ -# -# Tests for this class need to be run 'by hand', until we figure out -# how to make use of the SCRAMV1 tools for running tests on Python -# code. -# -#------------------------------------------------------------ -# TODO: We need some refactoring to handle the writing of module-like -# objects more gracefully. Right now, we have to pull the classname -# out of the dictionary in more than one place. Try making a class -# which represents the module, which contains the dictionary now used, -# and knows about special features: the class name, now to print the -# guts without repeating the classname, etc. -#------------------------------------------------------------ - -import io -import types - -# TODO: Refactor pset_dict_to_string and class printable_parameter to -# have a consistent view of the problem. Perhaps have a class -# representing the configuration data for a PSet object, rather than -# just using a dictionary instance. See also __write_module_guts, -# which should be refactored at the same time. - -def pset_dict_to_string(psetDict): - """Convert dictionary representing a PSet to a string consistent - with the configuration grammar.""" - stream = io.StringIO() - stream.write('\n{\n') - - for name, value in psetDict.items(): - stream.write('%s' % printable_parameter(name, value)) - stream.write('\n') - - stream.write('}\n') - return stream.getvalue() - - -def secsource_dict_to_string(secSourceDict): - """Make a string representing the secsource""" - stream = io.StringIO() - stream.write("%s\n{\n" % secSourceDict["@classname"][2]) - for name, value in secSourceDict.items(): - if name[0] != '@': - stream.write('%s' % printable_parameter(name, value)) - stream.write('\n') - - stream.write('}\n') - return stream.getvalue() - - -class printable_parameter: - """A class to provide automatic unpacking of the tuple (triplet) - representation of a single parameter, suitable for printing. - - Note that 'value' may in fact be a list.""" - - def __init__(self, aName, aValueTuple): - self.name = aName - self.type, self.trackedCode, self.value = aValueTuple - # Because the configuration grammar treats tracked status as - # the default, we only have to write 'untracked' as the - # tracking code if the parameter is untracked. - if self.trackedCode == "tracked": - self.trackedCode = "" - else: - self.trackedCode = "untracked " # trailing space is needed - - # We need special handling of some of the parameter types. - if self.type in ["vbool", "vint32", "vuint32", "vdouble", "vstring", "VInputTag", "VESInputTag"]: - # TODO: Consider using cStringIO, if this is observed - # to be a bottleneck. This may happen if many large - # vectors are used in parameter sets. - temp = '{' - # Write out values as a comma-separated list - temp += ", ".join(self.value) - temp += '}' - self.value = temp - - if self.type == "PSet": - self.value = pset_dict_to_string(self.value) - if self.type == "secsource": - self.value = secsource_dict_to_string(self.value) - if self.type == "VPSet": - temp = '{' - tup = [ pset_dict_to_string(x) for x in self.value ] - temp += ", ".join( tup ) - temp += '}' - self.value = temp - - def __str__(self): - """Print this parameter in the right format for a - configuration file.""" - s = "%(trackedCode)s%(type)s %(name)s = %(value)s" % self.__dict__ - return s - -# I'm not using new-style classes, because I'm not sure that we can -# rely on a new enough version of Python to support their use. - -class cmsconfig: - """A class to provide convenient access to the contents of a - parsed CMS configuration file.""" - - def __init__(self, stringrep): - """Create a cmsconfig object from the contents of the (Python) - exchange format for configuration files.""" - self.psdata = eval(stringrep) - - def numberOfModules(self): - return len(self.psdata['modules']) - - def numberOfOutputModules(self): - return len(self.outputModuleNames()) - - def moduleNames(self): - """Return the names of modules. Returns a list.""" - return self.psdata['modules'].keys() - - def module(self, name): - """Get the module with this name. Exception raised if name is - not known. Returns a dictionary.""" - return self.psdata['modules'][name] - - def psetNames(self): - """Return the names of psets. Returns a list.""" - return self.psdata['psets'].keys() - - def pset(self, name): - """Get the pset with this name. Exception raised if name is - not known. Returns a dictionary.""" - return self.psdata['psets'][name] - - def outputModuleNames(self): - return self.psdata['output_modules'] - - def moduleNamesWithSecSources(self): - return self.psdata['modules_with_secsources'] - - def esSourceNames(self): - """Return the names of all ESSources. Names are of the form '@