-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OutputModules on FinalPaths do not cause unscheduled execution.
- Loading branch information
Showing
7 changed files
with
288 additions
and
14 deletions.
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
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
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,79 @@ | ||
#!/bin/bash | ||
|
||
LOCAL_TEST_DIR=${CMSSW_BASE}/src/FWCore/Integration/test | ||
LOCAL_TMP_DIR=${CMSSW_BASE}/tmp/${SCRAM_ARCH} | ||
|
||
# Pass in name and status | ||
function die { echo $1: status $2 ; echo === Log file === ; cat ${3:-/dev/null} ; echo === End log file === ; exit $2; } | ||
|
||
pushd ${LOCAL_TMP_DIR} | ||
|
||
cat <<EOF > finalpath_expected_empty.log | ||
EOF | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py >& finalpath.log || die "failed test_finalpath_cfg.py" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_empty.log - || die "differences for test_finalpath_cfg.py" $? | ||
|
||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --schedule >& finalpath.log || die "failed test_finalpath_cfg.py --schedule" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_empty.log - || die "differences for test_finalpath_cfg.py" $? | ||
|
||
|
||
cat <<EOF > finalpath_expected_not_found.log | ||
did not find thing '' TEST | ||
did not find thing '' TEST | ||
did not find thing '' TEST | ||
found thing 'beginLumi' TEST | ||
found thing 'endLumi' TEST | ||
found thing 'beginRun' TEST | ||
found thing 'endRun' TEST | ||
EOF | ||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --schedule --task >& finalpath.log || die "failed test_finalpath_cfg.py --schedule --task" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_not_found.log - || die "differences for test_finalpath_cfg.py --schedule --task" $? | ||
|
||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --endpath >& finalpath.log || die "failed test_finalpath_cfg.py --endpath" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_empty.log - || die "differences for test_finalpath_cfg.py --endpath" $? | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --schedule --endpath >& finalpath.log || die "failed test_finalpath_cfg.py --schedule --endpath" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_empty.log - || die "differences for test_finalpath_cfg.py --schedule --endpath" $? | ||
|
||
|
||
cat <<EOF > finalpath_expected_found.log | ||
found thing '' TEST | ||
found thing '' TEST | ||
found thing '' TEST | ||
found thing 'beginLumi' TEST | ||
found thing 'endLumi' TEST | ||
found thing 'beginRun' TEST | ||
found thing 'endRun' TEST | ||
EOF | ||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --endpath --task >& finalpath.log || die "failed test_finalpath_cfg.py --endpath --task" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_found.log - || die "differences for test_finalpath_cfg.py --endpath --task" $? | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --endpath --task --schedule >& finalpath.log || die "failed test_finalpath_cfg.py --endpath --task --schedule" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_found.log - || die "differences for test_finalpath_cfg.py --endpath --task --schedule" $? | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --path --task >& finalpath.log || die "failed test_finalpath_cfg.py --path --task" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_found.log - || die "differences for test_finalpath_cfg.py --path --task" $? | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --path --task --schedule >& finalpath.log || die "failed test_finalpath_cfg.py --path --task --schedule" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_found.log - || die "differences for test_finalpath_cfg.py --path --task --schedule" $? | ||
|
||
|
||
cat <<EOF > finalpath_expected_filter.log | ||
did not find thing '' TEST | ||
found thing '' TEST | ||
did not find thing '' TEST | ||
found thing 'beginLumi' TEST | ||
found thing 'endLumi' TEST | ||
found thing 'beginRun' TEST | ||
found thing 'endRun' TEST | ||
EOF | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --path --filter >& finalpath.log || die "failed test_finalpath_cfg.py --path --filter" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_filter.log - || die "differences for test_finalpath_cfg.py --path --filter" $? | ||
|
||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_finalpath_cfg.py -- --path --filter --task >& finalpath.log || die "failed test_finalpath_cfg.py --path --filter --task" $? | ||
grep "thing '.*' TEST" finalpath.log | diff finalpath_expected_filter.log - || die "differences for test_finalpath_cfg.py --path --filter --task" $? |
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,69 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test FinalPath.') | ||
|
||
parser.add_argument("--schedule", help="use cms.Schedule", action="store_true") | ||
parser.add_argument("--task", help="put EDProducer into a task", action="store_true") | ||
parser.add_argument("--path", help="put a consumer of the product onto a Path", action="store_true") | ||
parser.add_argument("--endpath", help="put a consumer of the product onto an EndPath", action="store_true") | ||
parser.add_argument("--filter", action="store_true") | ||
parser.add_argument("--tracer", help="add Tracer service", action="store_true") | ||
|
||
print(sys.argv) | ||
argv = sys.argv[:] | ||
if '--' in argv: | ||
argv.remove("--") | ||
args, unknown = parser.parse_known_args(argv) | ||
|
||
|
||
process = cms.Process("TEST") | ||
|
||
process.MessageLogger.cerr.INFO.limit = 10000 | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents.input = 3 | ||
|
||
process.thing = cms.EDProducer("ThingProducer") | ||
|
||
scheduledPaths =[] | ||
if args.path: | ||
print("adding Path") | ||
process.otherThing = cms.EDProducer("OtherThingProducer", thingTag = cms.InputTag("thing")) | ||
p = cms.Path() | ||
if args.filter: | ||
process.fltr = cms.EDFilter("Prescaler", prescaleFactor = cms.int32(2), prescaleOffset=cms.int32(0)) | ||
p += process.fltr | ||
if not args.task: | ||
p += process.thing | ||
p += process.otherThing | ||
process.p = p | ||
scheduledPaths.append(process.p) | ||
if args.task: | ||
process.p.associate(cms.Task(process.thing)) | ||
|
||
if args.endpath: | ||
print("adding EndPath") | ||
process.out2 = cms.OutputModule("AsciiOutputModule",outputCommands = cms.untracked.vstring("drop *", "keep *_thing_*_*")) | ||
process.o = cms.EndPath(process.out2) | ||
scheduledPaths.append(process.o) | ||
if args.task: | ||
process.o.associate(cms.Task(process.thing)) | ||
|
||
process.out = cms.OutputModule("GetProductCheckerOutputModule", verbose= cms.untracked.bool(True), outputCommands = cms.untracked.vstring("drop *", "keep *_thing_*_*")) | ||
process.f = cms.FinalPath(process.out) | ||
|
||
if args.schedule: | ||
print("adding Schedule") | ||
scheduledPaths.append(process.f) | ||
process.schedule = cms.Schedule(*scheduledPaths) | ||
if args.task: | ||
process.schedule.associate(cms.Task(process.thing)) | ||
|
||
if args.tracer: | ||
process.add_(cms.Service("Tracer")) | ||
|
||
process.options.numberOfThreads=3 | ||
process.options.numberOfStreams=1 |
Oops, something went wrong.