-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated test of edm::Ref use from a merged ROOT file #47060
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test ConditionalTasks.') | ||
|
||
parser.add_argument("--inFile1", help="first file to read") | ||
parser.add_argument("--inFile2", help="second file to read") | ||
parser.add_argument("--outFile", help="name of output file", default="ref_merge.root") | ||
|
||
args = parser.parse_args() | ||
|
||
process = cms.Process("MERGE") | ||
|
||
process.source = cms.Source("PoolSource", | ||
fileNames = cms.untracked.vstring("file:ref_merge_prod1.root", | ||
"file:ref_merge_prod2.root") | ||
from IOPool.Input.modules import PoolSource | ||
process.source = PoolSource(fileNames = [f"file:{args.inFile1}", | ||
f"file:{args.inFile2}"] | ||
) | ||
|
||
process.out = cms.OutputModule("PoolOutputModule", | ||
fileName = cms.untracked.string("ref_merge.root") | ||
) | ||
from IOPool.Output.modules import PoolOutputModule | ||
process.out = PoolOutputModule(fileName = args.outFile) | ||
|
||
process.tester = cms.EDAnalyzer("OtherThingAnalyzer", | ||
other = cms.untracked.InputTag("d","testUserTag")) | ||
from FWCore.Integration.modules import OtherThingAnalyzer | ||
process.tester = OtherThingAnalyzer(other = ("d","testUserTag")) | ||
|
||
process.o = cms.EndPath(process.out+process.tester) | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test ConditionalTasks.') | ||
|
||
parser.add_argument("--extraProducers", help="Add extra producers to configuration", action="store_true") | ||
parser.add_argument("--fileName", help="name of output file") | ||
parser.add_argument("--firstLumi", help="LuminosityBlock number for first lumi", type = int, default=1) | ||
parser.add_argument("--keepAllProducts", help="Keep all products made in the job", action="store_true") | ||
parser.add_argument("--dropThings", help="drop the Things collections so the refs will not function", action="store_true") | ||
|
||
args = parser.parse_args() | ||
|
||
|
||
process = cms.Process("PROD") | ||
|
||
nEvents = 10 | ||
from FWCore.Modules.modules import EmptySource | ||
process.source = EmptySource( | ||
firstLuminosityBlock = args.firstLumi, | ||
firstEvent = nEvents*(args.firstLumi-1)+1 | ||
) | ||
|
||
process.maxEvents.input = nEvents | ||
|
||
if args.extraProducers: | ||
from FWCore.Framework.modules import IntProducer | ||
process.a = IntProducer(ivalue = 1) | ||
|
||
process.b = IntProducer(ivalue = 2) | ||
|
||
from FWCore.Integration.modules import ThingProducer, OtherThingProducer, OtherThingAnalyzer | ||
process.c = ThingProducer() | ||
|
||
process.d = OtherThingProducer(thingTag="c") | ||
|
||
outputs = [] | ||
if not args.keepAllProducts: | ||
outputs = ["drop *", | ||
"keep edmtestOtherThings_*_*_*"] | ||
if not args.dropThings: | ||
outputs.append("keep edmtestThings_*_*_*") | ||
|
||
|
||
from IOPool.Output.modules import PoolOutputModule | ||
process.o = PoolOutputModule(outputCommands = outputs, | ||
fileName = args.fileName | ||
) | ||
if args.extraProducers: | ||
process.p = cms.Path(process.a+process.b+process.c*process.d) | ||
else: | ||
process.p = cms.Path(process.c*process.d) | ||
|
||
process.tester = OtherThingAnalyzer(other = ("d","testUserTag")) | ||
|
||
process.out = cms.EndPath(process.o+process.tester) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test Refs after merge.') | ||
|
||
parser.add_argument("--fileName", help="file to read") | ||
|
||
args = parser.parse_args() | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("PoolSource", | ||
fileNames = cms.untracked.vstring("file:ref_merge.root") | ||
) | ||
from IOPool.Input.modules import PoolSource | ||
process.source = PoolSource(fileNames = [f"file:{args.fileName}"]) | ||
|
||
process.tester = cms.EDAnalyzer("OtherThingAnalyzer", | ||
other = cms.untracked.InputTag("d","testUserTag")) | ||
from FWCore.Integration.modules import OtherThingAnalyzer | ||
process.tester = OtherThingAnalyzer(other = ("d","testUserTag")) | ||
|
||
process.e = cms.EndPath(process.tester) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a test with the other way around, where
cmsRun
would fail, be worth it? Or is it tested already somewhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think such a test belongs in this particular suite as it is not a test of Refs just file compatibility. If it does exist, it should probably be in IPool/Input. From a quick look, it does not appear to exist there.