-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit test for StatisticsSenderService
- Loading branch information
Showing
8 changed files
with
147 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("SECOND") | ||
|
||
process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:stat_sender_first.root")) | ||
|
||
process.o = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string("stat_sender_second.root"), outputCommands = cms.untracked.vstring("drop *")) | ||
|
||
process.ep = cms.EndPath(process.o) | ||
|
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,20 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("FIRST") | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.first = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string("stat_sender_first.root")) | ||
process.b = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string("stat_sender_b.root")) | ||
process.c = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string("stat_sender_c.root")) | ||
process.d = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string("stat_sender_d.root")) | ||
process.e = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string("stat_sender_e.root")) | ||
|
||
process.Thing = cms.EDProducer("ThingProducer") | ||
process.OtherThing = cms.EDProducer("OtherThingProducer") | ||
process.EventNumber = cms.EDProducer("EventNumberIntProducer") | ||
|
||
|
||
process.o = cms.EndPath(process.first+process.b+process.c+process.d+process.e, cms.Task(process.Thing, process.OtherThing, process.EventNumber)) | ||
|
||
process.maxEvents.input = 10 |
41 changes: 41 additions & 0 deletions
41
Utilities/StorageFactory/test/test_file_statistics_sender.sh
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,41 @@ | ||
#!/bin/bash | ||
|
||
# Pass in name and status | ||
function die { echo $1: status $2 ; exit $2; } | ||
|
||
LOCAL_TEST_DIR=${CMSSW_BASE}/src/Utilities/StorageFactory/test | ||
LOCAL_TMP_DIR=${CMSSW_BASE}/tmp/${SCRAM_ARCH} | ||
|
||
pushd ${LOCAL_TMP_DIR} | ||
|
||
#setup files used in tests | ||
cmsRun ${LOCAL_TEST_DIR}/make_test_files_cfg.py &> make_test_files.log || die "cmsRun make_test_files_cfg.py" $? | ||
rm make_test_files.log | ||
cmsRun ${LOCAL_TEST_DIR}/make_2nd_file_cfg.py &> make_2nd_file.log || die "cmsRun make_2nd_file_cfg.py" $? | ||
rm make_2nd_file.log | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_single_file_statistics_sender_cfg.py &> test_single_file_statistics_sender.log || die "cmsRun test_single_file_statistics_sender_cfg.py" $? | ||
grep -q '"file_lfn":"file:stat_sender_first.root"' test_single_file_statistics_sender.log || die "no StatisticsSenderService output for single file" 1 | ||
rm test_single_file_statistics_sender.log | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_multiple_files_file_statistics_sender_cfg.py &> test_multiple_files_file_statistics_sender.log || die "cmsRun test_multiple_files_file_statistics_sender_cfg.py" $? | ||
grep -q '"file_lfn":"file:stat_sender_b.root"' test_multiple_files_file_statistics_sender.log || die "no StatisticsSenderService output for file b in multiple files" 1 | ||
grep -q '"file_lfn":"file:stat_sender_c.root"' test_multiple_files_file_statistics_sender.log || die "no StatisticsSenderService output for file c in multiple files" 1 | ||
grep -q '"file_lfn":"file:stat_sender_d.root"' test_multiple_files_file_statistics_sender.log || die "no StatisticsSenderService output for file d in multiple files" 1 | ||
grep -q '"file_lfn":"file:stat_sender_e.root"' test_multiple_files_file_statistics_sender.log || die "no StatisticsSenderService output for file e in multiple files" 1 | ||
rm test_multiple_files_file_statistics_sender.log | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_multi_file_statistics_sender_cfg.py &> test_multi_file_statistics_sender.log || die "cmsRun test_multi_file_statistics_sender_cfg.py" $? | ||
grep -q '"file_lfn":"file:stat_sender_first.root"' test_multi_file_statistics_sender.log || die "no StatisticsSenderService output for file first in multi file" 1 | ||
grep -q '"file_lfn":"file:stat_sender_second.root"' test_multi_file_statistics_sender.log || die "no StatisticsSenderService output for file second in multi file" 1 | ||
rm test_multi_file_statistics_sender.log | ||
|
||
cmsRun ${LOCAL_TEST_DIR}/test_secondary_file_statistics_sender_cfg.py &> test_secondary_file_statistics_sender.log || die "cmsRun test_secondary_file_statistics_sender_cfg.py" $? | ||
grep -q '"file_lfn":"file:stat_sender_first.root"' test_secondary_file_statistics_sender.log || die "no StatisticsSenderService output for file 'first' in secondary files" 1 | ||
grep -q '"file_lfn":"file:stat_sender_b.root"' test_secondary_file_statistics_sender.log || die "no StatisticsSenderService output for file 'b' in secondary files" 1 | ||
grep -q '"file_lfn":"file:stat_sender_c.root"' test_secondary_file_statistics_sender.log || die "no StatisticsSenderService output for file 'c' in secondary files" 1 | ||
grep -q '"file_lfn":"file:stat_sender_d.root"' test_secondary_file_statistics_sender.log || die "no StatisticsSenderService output for file 'd' in secondary files" 1 | ||
grep -q '"file_lfn":"file:stat_sender_e.root"' test_secondary_file_statistics_sender.log || die "no StatisticsSenderService output for file 'e' in secondary files" 1 | ||
rm test_secondary_file_statistics_sender.log | ||
|
||
popd |
10 changes: 10 additions & 0 deletions
10
Utilities/StorageFactory/test/test_multi_file_statistics_sender_cfg.py
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,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("PoolSource", | ||
fileNames = cms.untracked.vstring("file:stat_sender_second.root"), | ||
secondaryFileNames = cms.untracked.vstring("file:stat_sender_first.root") | ||
) | ||
|
||
process.add_(cms.Service("StatisticsSenderService", debug = cms.untracked.bool(True))) |
10 changes: 10 additions & 0 deletions
10
Utilities/StorageFactory/test/test_multiple_files_file_statistics_sender_cfg.py
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,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:stat_sender_b.root", "file:stat_sender_c.root", "file:stat_sender_d.root", "file:stat_sender_e.root"), | ||
duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), | ||
inputCommands = cms.untracked.vstring('drop *_*_beginRun_*', 'drop *_*_endRun_*', 'drop *_*_beginLumi_*', 'drop *_*_endLumi_*') | ||
) | ||
|
||
process.add_(cms.Service("StatisticsSenderService", debug = cms.untracked.bool(True))) |
44 changes: 44 additions & 0 deletions
44
Utilities/StorageFactory/test/test_secondary_file_statistics_sender_cfg.py
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,44 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:stat_sender_first.root")) | ||
|
||
process.b = cms.EDProducer("SecondaryProducer", | ||
seq = cms.untracked.bool(True), | ||
input = cms.SecSource("EmbeddedRootSource", | ||
sequential = cms.untracked.bool(True), | ||
fileNames = cms.untracked.vstring('file:stat_sender_b.root') | ||
) | ||
) | ||
|
||
process.c = cms.EDProducer("SecondaryProducer", | ||
seq = cms.untracked.bool(True), | ||
input = cms.SecSource("EmbeddedRootSource", | ||
sequential = cms.untracked.bool(True), | ||
fileNames = cms.untracked.vstring('file:stat_sender_c.root') | ||
) | ||
) | ||
|
||
process.d = cms.EDProducer("SecondaryProducer", | ||
seq = cms.untracked.bool(True), | ||
input = cms.SecSource("EmbeddedRootSource", | ||
sequential = cms.untracked.bool(True), | ||
fileNames = cms.untracked.vstring('file:stat_sender_d.root') | ||
) | ||
) | ||
|
||
process.e = cms.EDProducer("SecondaryProducer", | ||
seq = cms.untracked.bool(True), | ||
input = cms.SecSource("EmbeddedRootSource", | ||
sequential = cms.untracked.bool(True), | ||
fileNames = cms.untracked.vstring('file:stat_sender_e.root') | ||
) | ||
) | ||
|
||
process.pB = cms.Path(process.b) | ||
process.pC = cms.Path(process.c) | ||
process.pD = cms.Path(process.d) | ||
process.pE = cms.Path(process.e) | ||
|
||
process.add_(cms.Service("StatisticsSenderService", debug = cms.untracked.bool(True))) |
11 changes: 11 additions & 0 deletions
11
Utilities/StorageFactory/test/test_single_file_statistics_sender_cfg.py
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,11 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:stat_sender_first.root")) | ||
|
||
process.add_(cms.Service("StatisticsSenderService", debug = cms.untracked.bool(True))) | ||
|
||
process.load("FWCore.MessageService.MessageLogger_cfi") | ||
|
||
process.MessageLogger.cerr.INFO.limit = 1000 |