Skip to content
Snippets Groups Projects
Commit d3c4be3e authored by Charles Leggett's avatar Charles Leggett
Browse files

test wrapper improvements

modified the test wrapper script/classes to allow access to stdout and stderr
reference files names from the custom validator code in .qmt files.

This allow to implement easily validators addressing the problem reported
in LHCBPS-1693.

See merge request !281
parents 731c578a c7690f7b
No related branches found
No related tags found
1 merge request!281test wrapper improvements
Pipeline #
Showing
with 0 additions and 330 deletions
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/History.opts"]
self.reference = "refs/History.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="../../scripts/HistoUtilsEx.py"
self.reference = "refs/HistoUtilsEx.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/IncidentSvc.opts"]
self.reference = "refs/IncidentSvc.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="gaudirun.py"
self.options="""
#include "Common.opts"
ApplicationMgr.TopAlg = { "LoopAlg" };
ApplicationMgr.InitializationLoopCheck = False;"""
def validator(self,stdout,stderr, result, causes, reference, error_reference):
self.findReferenceBlock('ApplicationMgr INFO Application Manager Initialized successfully')
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="gaudirun.py"
self.exit_code=1
self.options="""
#include "Common.opts"
ApplicationMgr.TopAlg = { "LoopAlg" };"""
def validator(self,stdout,stderr, result, causes, reference, error_reference):
self.findReferenceBlock('ServiceManager ERROR Initialization loop detected when creating service "ServiceB"')
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/Maps.opts"]
self.reference = "refs/Maps.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/NTuples.opts"]
self.reference = "refs/NTuples.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="gaudirun.py"
self.options="""
from Gaudi.Configuration import *
from Configurables import Gaudi__ParticlePropertySvc as ParticlePropertySvc
from Configurables import GaudiExamples__GaudiPPS as GaudiPPS
importOptions("Common.opts")
ParticlePropertySvc( ParticlePropertiesFile = "../data/ParticleTable.txt" )
ApplicationMgr( EvtMax = 1,
EvtSel = 'NONE',
TopAlg = [GaudiPPS()] )
"""
def validator(self,stdout,stderr, result, causes, reference, error_reference):
expected = "Opened particle properties file : ../data/ParticleTable.txt"
if not expected in stdout:
causes.append("missing signature")
result["GaudiTest.expected_line"] = result.Quote(expected)
if 'ERROR' in stdout or 'FATAL' in stdout:
causes.append("error")
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="../scripts/python_bin_module.py"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/QotdAlg.opts"]
self.reference = "refs/QotdAlg.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/RandomNumber.opts"]
self.reference = "refs/RandomNumber.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="gaudirun.py"
self.args=["-v","Selections.py"]
self.reference = "refs/Selections.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="gaudirun.py"
self.exit_code=130
self.options="""
from Gaudi.Configuration import *
from Configurables import GaudiTesting__SignallingAlg as SignallingAlg
from Configurables import Gaudi__Utils__StopSignalHandler as StopSignalHandler
importOptions("Common.opts")
alg = SignallingAlg(Signal = 2) # SIGINT
#StopSignalHandler(Signals = ["SIGINT", "SIGXCPU"]) # this is the default
app = ApplicationMgr(TopAlg = [alg],
EvtSel = "NONE", EvtMax = 5,
StopOnSignal = True)
MessageSvc().setDebug.append("EventLoopMgr")"""
def validator(self,stdout,stderr, result, causes, reference, error_reference):
self.findReferenceBlock("""
GaudiTesting::S... INFO 3 events to go
GaudiTesting::S... INFO 2 events to go
GaudiTesting::S... INFO 1 events to go
GaudiTesting::S... INFO Raising signal now
Gaudi::Utils::S...WARNING Received signal 'SIGINT' (2, Interrupt)
Gaudi::Utils::S...WARNING Scheduling a stop
EventLoopMgr SUCCESS Terminating event processing loop due to a stop scheduled by an incident listener
ApplicationMgr INFO Application Manager Stopped successfully
""")
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/StatSvcAlg.opts"]
self.reference = "refs/StatSvcAlg.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/StatusCodeSvc.opts"]
self.reference = "refs/StatusCodeSvc.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="../../scripts/StringKeyEx.py"
def validator(self,stdout,stderr, result, causes, reference, error_reference):
self.findReferenceBlock("""
StringKeys SUCCESS check for StringKey 'key'
StringKeys SUCCESS In Map 1: True
StringKeys SUCCESS In Map 2: True
StringKeys SUCCESS In Map 3: True
StringKeys SUCCESS In Map 4: True
StringKeys SUCCESS In Map01: True
StringKeys SUCCESS In Map02: True
StringKeys SUCCESS In Map03: True
StringKeys SUCCESS In Map04: True
StringKeys SUCCESS check for std::string key 'rrr'
StringKeys SUCCESS In Map 1: False
StringKeys SUCCESS In Map 2: False
StringKeys SUCCESS In Map 3: False
StringKeys SUCCESS In Map 4: False
StringKeys SUCCESS In Map01: False
StringKeys SUCCESS In Map02: False
StringKeys SUCCESS In Map03: False
StringKeys SUCCESS In Map04: False
""", id = "block1")
self.findReferenceBlock("""
StringKeys SUCCESS check for StringKey 'new Key'
StringKeys SUCCESS In Map 1: True
StringKeys SUCCESS In Map 2: True
StringKeys SUCCESS In Map 3: True
StringKeys SUCCESS In Map 4: True
StringKeys SUCCESS In Map01: True
StringKeys SUCCESS In Map02: True
StringKeys SUCCESS In Map03: True
StringKeys SUCCESS In Map04: True
StringKeys SUCCESS check for std::string key 'rrr'
StringKeys SUCCESS In Map 1: True
StringKeys SUCCESS In Map 2: True
StringKeys SUCCESS In Map 3: True
StringKeys SUCCESS In Map 4: True
StringKeys SUCCESS In Map01: True
StringKeys SUCCESS In Map02: True
StringKeys SUCCESS In Map03: True
StringKeys SUCCESS In Map04: True
""", id = "block2")
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.program="gaudirun.py"
self.args=["$GAUDIEXAMPLESROOT/options/TemplatedAlg.py"]
self.reference = "refs/TemplatedAlg_pyopts.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/TemplatedAlg.opts"]
self.reference = "refs/TemplatedAlg.ref"
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/THistRead.opts"]
self.reference="refs/THistRead.ref"
def validator(self,stdout,stderr, result, causes, reference, error_reference):
preprocessor = normalizeExamples + \
RegexpReplacer(when = "^THistSvc",
orig = r"(stream: read[0-9] name: tuple[0-9].rt size: )([0-9]*)",
repl = r"\1###")
self.validateWithReference(preproc = preprocessor)
\ No newline at end of file
# -*- coding: utf-8 -*-
import BaseTest
from BaseTest import *
class Test(BaseTest):
def __init__(self):
BaseTest.__init__(self)
self.name = os.path.basename(__file__)[:-5]
self.args=["$GAUDIEXAMPLESROOT/options/THistWrite.opts"]
self.reference = "refs/THistWrite.ref"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment