Skip to content
Snippets Groups Projects
Commit 1d333bbf authored by Eduardo Rodrigues's avatar Eduardo Rodrigues
Browse files

Merge branch 'cherry-pick-00fd8dcd' into 'master'

Cherry-pick MR !238 to master branch

See merge request !240
parents b0926f34 02b06bb7
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!240Cherry-pick MR !238 to master branch
"""Script to check TCK-TurboStreamProd compatibility.
To be used in LHCbIntegrationTests and the TCK creation procedure.
Run with e.g.
python $TESLAROOT/tests/options/CheckTurboStreamProd.py turbo_lines.json \
'$APPCONFIGOPTS/Turbo/Streams_pp_2018_nocharmxsec.py'
"""
from __future__ import print_function
import argparse
import json
import re
import sys
from Gaudi.Configuration import importOptions
from Configurables import Tesla
parser = argparse.ArgumentParser(description="")
parser.add_argument("lines", help='JSON file with turbo lines (- for stdin).')
parser.add_argument("options", nargs='+', help="Appconfig options that configure Tesla")
args = parser.parse_args()
if args.lines == '-':
turbo_lines = json.load(sys.stdin)
else:
with open(args.lines) as f:
turbo_lines = json.load(f)
for path in args.options:
importOptions(path)
def ignored_line(line):
return any(re.match(pattern, line) for pattern in Tesla().IgnoredLines)
checked_lines = [line for line in turbo_lines if not ignored_line(line)]
lines_in_streams = sum((v['lines'] for v in Tesla().Streams.values()), [])
orphan_lines = set(checked_lines).difference(set(lines_in_streams))
if orphan_lines:
print("The following lines are missing from TurboStreamProd:\n"
"{}".format(list(orphan_lines)), file=sys.stderr)
sys.exit(1)
extra_lines = set(lines_in_streams).difference(set(checked_lines))
if extra_lines:
print("Some lines are assigned to a stream but not present:\n"
"{}".format(list(extra_lines)))
print("Passed")
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