Skip to content

Commit

Permalink
don't do FetchTestData step for builds that don't use it
Browse files Browse the repository at this point in the history
and don't run galera for getLastNFailedBuildFactory
  • Loading branch information
vuvova committed Dec 28, 2023
1 parent e1accc6 commit 89a81b9
Showing 1 changed file with 110 additions and 98 deletions.
208 changes: 110 additions & 98 deletions common_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,102 @@ def run(self):

return results.SUCCESS

def getBaseBuildFactory(mtrDbPool, mtrArgs):
def addPostTests(f_quick_build):
f_quick_build.addStep(
steps.DirectoryUpload(
name="save log files",
compress="bz2",
alwaysRun=True,
workersrc="/buildbot/logs/",
masterdest=util.Interpolate(
"/srv/buildbot/packages/"
+ "%(prop:tarbuildnum)s"
+ "/logs/"
+ "%(prop:buildername)s"
),
)
)

## trigger packages
f_quick_build.addStep(
steps.Trigger(
schedulerNames=["s_packages"],
waitForFinish=False,
updateSourceStamp=False,
alwaysRun=True,
set_properties={
"parentbuildername": Property("buildername"),
"tarbuildnum": Property("tarbuildnum"),
"mariadb_version": Property("mariadb_version"),
"master_branch": Property("master_branch"),
},
doStepIf=hasAutobake,
)
)
## trigger bigtest
f_quick_build.addStep(
steps.Trigger(
schedulerNames=["s_bigtest"],
waitForFinish=False,
updateSourceStamp=False,
set_properties={
"parentbuildername": Property("buildername"),
"tarbuildnum": Property("tarbuildnum"),
"mariadb_version": Property("mariadb_version"),
"master_branch": Property("master_branch"),
},
doStepIf=hasBigtest,
)
)
# create package and upload to master
f_quick_build.addStep(
steps.SetPropertyFromCommand(
command="basename mariadb-*-linux-*.tar.gz",
property="mariadb_binary",
doStepIf=savePackage,
)
)
f_quick_build.addStep(
steps.ShellCommand(
name="save_packages",
timeout=7200,
haltOnFailure=True,
command=util.Interpolate(
"""
mkdir -p /packages/%(prop:tarbuildnum)s/%(prop:buildername)s \
&& sha256sum %(prop:mariadb_binary)s >> sha256sums.txt \
&& cp %(prop:mariadb_binary)s sha256sums.txt /packages/%(prop:tarbuildnum)s/%(prop:buildername)s/ \
&& sync /packages/%(prop:tarbuildnum)s
"""
),
doStepIf=savePackage,
)
)
f_quick_build.addStep(
steps.Trigger(
name="eco",
schedulerNames=["s_eco"],
waitForFinish=False,
updateSourceStamp=False,
set_properties={
"parentbuildername": Property("buildername"),
"tarbuildnum": Property("tarbuildnum"),
"mariadb_binary": Property("mariadb_binary"),
"mariadb_version": Property("mariadb_version"),
"master_branch": Property("master_branch"),
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: savePackage(step) and hasEco(step),
)
)
f_quick_build.addStep(
steps.ShellCommand(
name="cleanup", command="rm -r * .* 2> /dev/null || true", alwaysRun=True
)
)
return f_quick_build

def getBuildFactoryPreTest():
f_quick_build = util.BuildFactory()
f_quick_build.addStep(
steps.ShellCommand(
Expand Down Expand Up @@ -75,7 +170,6 @@ def getBaseBuildFactory(mtrDbPool, mtrArgs):
],
)
)
f_quick_build.addStep(FetchTestData(name="Get last N failed tests", mtrDbPool=mtrDbPool))
# build steps
f_quick_build.addStep(
steps.Compile(
Expand All @@ -98,6 +192,9 @@ def getBaseBuildFactory(mtrDbPool, mtrArgs):
haltOnFailure="true",
)
)
return f_quick_build

def addTests(f_quick_build, mtrDbPool, mtrArgs):
f_quick_build.addStep(
steps.MTR(
logfiles={"mysqld*": "/buildbot/mysql_logs.html"},
Expand All @@ -120,6 +217,9 @@ def getBaseBuildFactory(mtrDbPool, mtrArgs):
))
f_quick_build.addStep(steps.ShellCommand(name="move mariadb log files", alwaysRun=True, command=['bash', '-c', util.Interpolate(moveMTRLogs(), jobs=util.Property('jobs', default='$(getconf _NPROCESSORS_ONLN'))]))
f_quick_build.addStep(steps.ShellCommand(name="create var archive", alwaysRun=True, command=['bash', '-c', util.Interpolate(createVar())], doStepIf=hasFailed))
return f_quick_build

def addGaleraTests(f_quick_build, mtrDbPool):
f_quick_build.addStep(steps.MTR(
description="testing galera",
descriptionDone="test galera",
Expand Down Expand Up @@ -160,104 +260,13 @@ def getBaseBuildFactory(mtrDbPool, mtrArgs):
doStepIf=hasGalera,
)
)
f_quick_build.addStep(
steps.DirectoryUpload(
name="save log files",
compress="bz2",
alwaysRun=True,
workersrc="/buildbot/logs/",
masterdest=util.Interpolate(
"/srv/buildbot/packages/"
+ "%(prop:tarbuildnum)s"
+ "/logs/"
+ "%(prop:buildername)s"
),
)
)

## trigger packages
f_quick_build.addStep(
steps.Trigger(
schedulerNames=["s_packages"],
waitForFinish=False,
updateSourceStamp=False,
alwaysRun=True,
set_properties={
"parentbuildername": Property("buildername"),
"tarbuildnum": Property("tarbuildnum"),
"mariadb_version": Property("mariadb_version"),
"master_branch": Property("master_branch"),
},
doStepIf=hasAutobake,
)
)
## trigger bigtest
f_quick_build.addStep(
steps.Trigger(
schedulerNames=["s_bigtest"],
waitForFinish=False,
updateSourceStamp=False,
set_properties={
"parentbuildername": Property("buildername"),
"tarbuildnum": Property("tarbuildnum"),
"mariadb_version": Property("mariadb_version"),
"master_branch": Property("master_branch"),
},
doStepIf=hasBigtest,
)
)
# create package and upload to master
f_quick_build.addStep(
steps.SetPropertyFromCommand(
command="basename mariadb-*-linux-*.tar.gz",
property="mariadb_binary",
doStepIf=savePackage,
)
)
f_quick_build.addStep(
steps.ShellCommand(
name="save_packages",
timeout=7200,
haltOnFailure=True,
command=util.Interpolate(
"""
mkdir -p /packages/%(prop:tarbuildnum)s/%(prop:buildername)s \
&& sha256sum %(prop:mariadb_binary)s >> sha256sums.txt \
&& cp %(prop:mariadb_binary)s sha256sums.txt /packages/%(prop:tarbuildnum)s/%(prop:buildername)s/ \
&& sync /packages/%(prop:tarbuildnum)s
"""
),
doStepIf=savePackage,
)
)
f_quick_build.addStep(
steps.Trigger(
name="eco",
schedulerNames=["s_eco"],
waitForFinish=False,
updateSourceStamp=False,
set_properties={
"parentbuildername": Property("buildername"),
"tarbuildnum": Property("tarbuildnum"),
"mariadb_binary": Property("mariadb_binary"),
"mariadb_version": Property("mariadb_version"),
"master_branch": Property("master_branch"),
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: savePackage(step) and hasEco(step),
)
)
f_quick_build.addStep(
steps.ShellCommand(
name="cleanup", command="rm -r * .* 2> /dev/null || true", alwaysRun=True
)
)
return f_quick_build

def getQuickBuildFactory(mtrDbPool):
return getBaseBuildFactory(mtrDbPool,util.Property(
"mtr_additional_args", default=""
))
f = getBuildFactoryPreTest()
f.addTests(mtrDbPool, util.Property( "mtr_additional_args", default=""))
f.addGaleraTests(mtrDbPool)
return f.addPostTests()

def getLastNFailedBuildsFactory(mtrDbPool):
@util.renderer
Expand All @@ -269,7 +278,10 @@ def getTests(props):

return mtr_additional_args

return getBaseBuildFactory(mtrDbPool, getTests)
f = getBuildFactoryPreTest()
f.addStep(FetchTestData(name="Get last N failed tests", mtrDbPool=mtrDbPool))
f.addTests(mtrDbPool, getTests)
return f.addPostTests()

def getRpmAutobakeFactory(mtrDbPool):
## f_rpm_autobake
Expand Down

0 comments on commit 89a81b9

Please sign in to comment.