Skip to content
Snippets Groups Projects
Commit 707949fa authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Fixes to counter comparison script

- make the test run fine (was only working locally, not in the nightlies)
- distinguish ref and new counters (all were markes as ref)
parent a9a56356
No related branches found
No related tags found
1 merge request!4006Fixes to counter comparison script
Pipeline #5255481 passed
......@@ -262,24 +262,24 @@ def extract_counters(s, counter_preproc=None, comp_type='Counters'):
return _extract_counters(blocks, comp_type=comp_type)
def _printCounter(algoName, counterName, counters):
def _printCounter(algoName, counterName, counters, tag):
'''prints given counter of given algo to string'''
return ' (%s ref) %s\n' % (
algoName, ' | '.join([counterName] + counters[algoName][counterName]))
return ' (%s %s) %s\n' % (algoName, tag, ' | '.join(
[counterName] + counters[algoName][counterName]))
def _printCounterDiff(refAlgoName, newAlgoName, counterNameRef, refCounters,
counterNameStdout, newCounters):
'''prints 2 counter lines for reference and new value'''
return _printCounter(refAlgoName,
counterNameRef, refCounters) + _printCounter(
newAlgoName, counterNameStdout, newCounters)
return _printCounter(
refAlgoName, counterNameRef, refCounters, 'ref') + _printCounter(
newAlgoName, counterNameStdout, newCounters, 'new')
def _printAllCountersForAlgo(algoName, counters, indent=''):
'''Prints all counters of a given algo'''
return '%sCounters for algo %s\n' % (indent, algoName) + "".join([
_printCounter(algoName, counterName, counters)
_printCounter(algoName, counterName, counters, 'ref')
for counterName in counters[algoName]
])
......
......@@ -59,11 +59,13 @@ Algo fromV2MuonPIDV1MuonPIDLong_75645bb5 has been renamed into fromV2MuonPIDV1Mu
def test_compare():
with open('GaudiConf/QMTest/tests/test_counter_compare.ref') as refFile:
with open(os.path.dirname(__file__) +
"/test_counter_compare.ref") as refFile:
refLog = refFile.read()
refBlock = LHCbTest._extract_counter_blocks(
refLog, LHCbTest._COUNTER_START_RE['Counters'])
with open('GaudiConf/QMTest/tests/test_counter_compare.newref') as newFile:
with open(os.path.dirname(__file__) +
"/test_counter_compare.newref") as newFile:
newLog = newFile.read()
newBlock = LHCbTest._extract_counter_blocks(
newLog, LHCbTest._COUNTER_START_RE['Counters'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment