Skip to content

Commit

Permalink
getLastNFailedBuildsFactory("debug")
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Dec 30, 2023
1 parent 9ffe952 commit 02bcc5a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
23 changes: 17 additions & 6 deletions common_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# * uses N=50 now, this could be increased to catch more failures or decreased
# to run faster
# * more branch protection builders should use it
# * run for debug and sanitizers
# * run for view protocol and sanitizers
# * how to do it for install/upgrade tests?
#
class FetchTestData(MTR):
Expand Down Expand Up @@ -163,7 +163,7 @@ def addPostTests(f_quick_build):
)
return f_quick_build

def getBuildFactoryPreTest(additional_args=""):
def getBuildFactoryPreTest(build_type="RelWithDebInfo", additional_args=""):
f_quick_build = util.BuildFactory()
f_quick_build.addStep(
steps.ShellCommand(
Expand Down Expand Up @@ -208,7 +208,7 @@ def getBuildFactoryPreTest(additional_args=""):
util.Interpolate(
"cmake . -DCMAKE_BUILD_TYPE=%(kw:build_type)s -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=%(kw:c_compiler)s -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=%(kw:cxx_compiler)s -DPLUGIN_TOKUDB=NO -DPLUGIN_MROONGA=NO -DPLUGIN_SPIDER=YES -DPLUGIN_OQGRAPH=NO -DPLUGIN_PERFSCHEMA=%(kw:perf_schema)s -DPLUGIN_SPHINX=NO %(kw:additional_args)s && make %(kw:verbose_build)s -j%(kw:jobs)s %(kw:create_package)s",
perf_schema=util.Property("perf_schema", default="YES"),
build_type=util.Property("build_type", default="RelWithDebInfo"),
build_type=util.Property("build_type", default=f"{build_type}"),
jobs=util.Property("jobs", default="$(getconf _NPROCESSORS_ONLN)"),
c_compiler=util.Property("c_compiler", default="gcc"),
cxx_compiler=util.Property("cxx_compiler", default="g++"),
Expand Down Expand Up @@ -300,7 +300,7 @@ def getQuickBuildFactory(test_type, mtrDbPool):
addGaleraTests(f, mtrDbPool)
return addPostTests(f)

def getLastNFailedBuildsFactory(mtrDbPool):
def getLastNFailedBuildsFactory(test_type, mtrDbPool):
@util.renderer
def getTests(props):
mtr_additional_args = props.getProperty('mtr_additional_args', '--suite=main')
Expand All @@ -310,9 +310,20 @@ def getTests(props):

return mtr_additional_args

f = getBuildFactoryPreTest("-DWITH_EMBEDDED_SERVER=ON")
config={
"nm": {
"args" : ("RelWithDebInfo", "-DWITH_EMBEDDED_SERVER=ON"),
"steps": ("nm", "ps", "emb", "emb-ps") # TODO "view"
},
"debug": {
"args" : ("Debug", "-DWITH_EMBEDDED_SERVER=ON"),
"steps": ("debug", "debug-ps", "debug-emb", "debug-emb-ps") # TODO "view"
}
}

f = getBuildFactoryPreTest(*config[test_type]['args'])

for typ in ("nm", "ps", "emb", "emb-ps"): # TODO "view"
for typ in config[test_type]['steps']:
f.addStep(FetchTestData(name=f"Get last N failed {typ} tests", mtrDbPool=mtrDbPool, test_type=typ))
addTests(f, typ, mtrDbPool, getTests)

Expand Down
6 changes: 2 additions & 4 deletions master-protected-branches/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ for w_name in ["hz-bbw"]:

####### FACTORY CODE

f_last_n_failed = getLastNFailedBuildsFactory(mtrDbPool)

## f_tarball - create source tarball
f_tarball = util.BuildFactory()
f_tarball.addStep(
Expand Down Expand Up @@ -522,7 +520,7 @@ c["builders"].append(
canStartBuild=canStartBuild,
locks=getLocks,
properties={"mtr_additional_args": protected_branches_mtr_additional_args},
factory=f_last_n_failed,
factory=getLastNFailedBuildsFactory('nm', mtrDbPool),
)
)

Expand All @@ -536,7 +534,7 @@ c["builders"].append(
canStartBuild=canStartBuild,
locks=getLocks,
properties={"mtr_additional_args": protected_branches_mtr_additional_args},
factory=f_last_n_failed,
factory=getLastNFailedBuildsFactory('debug', mtrDbPool),
)
)

Expand Down

0 comments on commit 02bcc5a

Please sign in to comment.