From d3ba4acfbebaa5dea295bf02ab69f0331498a2cd Mon Sep 17 00:00:00 2001 From: mquinson Date: Sat, 27 Oct 2007 20:58:38 +0000 Subject: [PATCH] Cosmetics: do display the amount of failed tests in the waterfall, as well as the svn revision git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4924 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- build/buildbot/extensions.py | 88 +++++++++++++++++++++++++++++------- build/buildbot/master.cfg | 64 +++++++++++--------------- 2 files changed, 99 insertions(+), 53 deletions(-) diff --git a/build/buildbot/extensions.py b/build/buildbot/extensions.py index fee767194a..80e9347535 100644 --- a/build/buildbot/extensions.py +++ b/build/buildbot/extensions.py @@ -1,7 +1,8 @@ +import re from buildbot.process import step -from buildbot.process.step import ShellCommand +from buildbot.process.step import ShellCommand, SVN from buildbot.status import builder from buildbot.status.builder import SUCCESS,FAILURE, EXCEPTION,WARNINGS @@ -10,8 +11,6 @@ from buildbot.status.builder import SUCCESS,FAILURE, EXCEPTION,WARNINGS # bear ucontext functionnality. In this case the CustomConfigure returns # INCOMPATIBLE_PLATFORM. -INCOMPATIBLE_PLATFORM = EXCEPTION +1 - """ CustomConfigure class for master-side representation of the custom configure command. This class considers the error (exit code 77) @@ -22,34 +21,33 @@ class CustomConfigure(ShellCommand): name = "configure" description = ["running configure"] descriptionDone = [name] + incompatible = False # Override evaluateCommand method to handle the case of platform that - # don't support ucontext. The method returns INCOMPATIBLE_PLATFORM + # don't support ucontext. The method returns sets self.incompatible # in this case. def evaluateCommand(self, cmd): - """Decide whether the command was SUCCESS, INCOMPATIBLE_PLATFORM, - or FAILURE.""" + """Decide whether the command was SUCCESS, FAILURE or incompatible platform""" if cmd.rc == 0: return SUCCESS elif cmd.rc == 77: - builder.Results.append('incompatible_platform') - return INCOMPATIBLE_PLATFORM + self.incompatible = True + return FAILURE else: - return FAILURE + return FAILURE - # Override getColor method. The method returns the text "yellow" - # when the results parameter is INCOMPATIBLE_PLATFORM. + # Override getColor method. The method returns the text "blue" when platform is incompatible def getColor(self, cmd, results): - assert results in (SUCCESS, WARNINGS, FAILURE,INCOMPATIBLE_PLATFORM) + assert results in (SUCCESS, WARNINGS, FAILURE) if results == SUCCESS: return "green" elif results == WARNINGS: return "orange" - elif results == INCOMPATIBLE_PLATFORM: - return "bleu" + elif self.incompatible: + return "blue" else: return "red" @@ -62,11 +60,69 @@ class CustomConfigure(ShellCommand): return self.describe(True) + ["Configure success"] elif results == WARNINGS: return self.describe(True) + ["warnings"] - elif results == INCOMPATIBLE_PLATFORM: + elif self.incompatible: return self.describe(True) + ["failed {incompatible platform}"] else: return self.describe(True) + ["failed"] - + +""" +Just like a plain SVN, but displays the current revision in the waterfall afterall +""" +class CustomSVN(SVN): + def getText(self,cmd,results): + lines = cmd.logs['stdio'].getText() + r = re.search(' (\d+).',lines) + if results == SUCCESS and r: + return self.describe(True) + ["updated to %s" % r.group(1)] + elif results == SUCCESS: + return self.describe(True) + ["updated to some version"] + else: + return self.describe(True) + ["failed"] + +""" +CustomCheck class for master-side representation of the checkall results. +This class stores and displays the amount of errors in the checks. +""" +class CustomCheck(ShellCommand): + name = "check" + description = ["running checks"] + descriptionDone = [name] + + + # Override getText method. + def getText(self, cmd, results): + lines = cmd.logs['stdio'].getText().split("\n") + re.compile('^FAIL:') + fail = len( filter(lambda line: re.search('^FAIL:', line), lines) ) + re.compile('^XFAIL:') + xfail = len( filter(lambda line: re.search('^XFAIL:', line), lines) ) + re.compile('^SKIP:') + skip = len( filter(lambda line: re.search('^SKIP:', line), lines) ) + re.compile('^XPASS:') + xpass = len( filter(lambda line: re.search('^XPASS:', line), lines) ) + re.compile('^PASS:') + passed = len( filter(lambda line: re.search('^PASS:', line), lines) ) + + res = "" + if fail != 0: + res += "%d failed, " % fail + if skip != 0: + res += "%d skipped, " % skip + if xpass != 0: + res += "%d unexpected success, " % xpass + if xfail != 0: + res += "%d expected failure, " % xfail + res += "%d total" % (passed + fail + skip + xpass + xfail) + + if results == SUCCESS: + return self.describe(True) + ["Success (%s)" % res] + elif results == WARNINGS: + return self.describe(True) + ["warnings"] + elif fail == 0: + return self.describe(True) + ["failed strangly"] + else: + return self.describe(True) + [res] + \ No newline at end of file diff --git a/build/buildbot/master.cfg b/build/buildbot/master.cfg index 8ec4d3c4ad..ffb30b19c2 100644 --- a/build/buildbot/master.cfg +++ b/build/buildbot/master.cfg @@ -4,6 +4,9 @@ ################################################################################### # This is the file configuration of the buildmaster used in the Simgrid project. +#from os import environ +#environ['LC_ALL'] = "C" + # The buildmaster configuration object. c = BuildmasterConfig = {} @@ -91,8 +94,8 @@ c['schedulers'] = [nightly_scheduler] from buildbot import locks from buildbot.process import step, factory -from extensions import CustomConfigure -from buildbot.process.step import ShellCommand, CVS +from extensions import CustomSVN, CustomConfigure, CustomCheck +from buildbot.process.step import ShellCommand # the following lock manages the builds of the machine bob @@ -109,48 +112,36 @@ fastnet_lock = locks.MasterLock("fastnet_lock") # factories -pthreads_factory= factory.BuildFactory() -pthreads_factory.addStep(step.SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update") -pthreads_factory.addStep(step.ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert",haltOnFailure = 1,command=["svn" ,"revert","-R","build"]) -pthreads_factory.addStep(step.ShellCommand,name = "{configure}",command=["./configure", "--with-pthread", "--enable-botbuild"]) -pthreads_factory.addStep(step.ShellCommand,name = "{make clean}",command=["make", "clean"]) -pthreads_factory.addStep(step.ShellCommand,name = "{make}",command=["make","-j","4"]) -pthreads_factory.addStep(step.ShellCommand,name ="{check all}",command=["./checkall"]) -#pthreads_factory.addStep(step.ShellCommand,name ="{make distcheck}",command=["make", "distcheck"]) - -ucontext_factory= factory.BuildFactory() -ucontext_factory.addStep(step.SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update") -ucontext_factory.addStep(step.ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert",haltOnFailure = 1,command=["svn" ,"revert","-R","build"]) -ucontext_factory.addStep(CustomConfigure,name ="{configure}",command=["./configure", " --with-context=ucontext","--enable-botbuild"]) # Main difference with pthread_factory -ucontext_factory.addStep(step.ShellCommand,name = "{make clean}",command=["make", "clean"]) -ucontext_factory.addStep(step.ShellCommand,name = "{make}",command=["make","-j","4"]) -ucontext_factory.addStep(step.ShellCommand,name = "{check all}",command=["./checkall"]) -#ucontext_factory.addStep(step.ShellCommand,name = "{make distcheck}",command=["make", "distcheck"]) - pthreads_factory_O3= factory.BuildFactory() -pthreads_factory_O3.addStep(step.SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update") -pthreads_factory_O3.addStep(step.ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert",haltOnFailure = 1,command=["svn" ,"revert","-R","build"]) -pthreads_factory_O3.addStep(step.ShellCommand,name = "{configure}",description="running configure",descriptionDone="configure",haltOnFailure = 1,command=["./configure", "--with-pthread","--enable-compile-optimizations","--enable-botbuild"]) -pthreads_factory_O3.addStep(step.ShellCommand,name = "{make clean}",description = "running make clean",descriptionDone = "make clean",haltOnFailure = 1,command=["make", "clean"]) -pthreads_factory_O3.addStep(step.ShellCommand,name = "{make}",description = "running make",descriptionDone = "make",haltOnFailure = 1,command=["make","-j","4"]) -pthreads_factory_O3.addStep(step.ShellCommand,name ="{check all}",description = "running check all",descriptionDone ="check all",haltOnFailure = 1,command=["./checkall"]) -#pthreads_factory_O3.addStep(step.ShellCommand,name ="{make distcheck}",description="running make distcheck",descriptionDone="make distcheck",haltOnFailure = 1,command=["make", "distcheck"]) +pthreads_factory_O3.addStep(CustomSVN, name ="{svn update}", baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update") +pthreads_factory_O3.addStep(step.ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","build"]) +pthreads_factory_O3.addStep(step.ShellCommand,name = "{configure}", description="running configure", descriptionDone="configure", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-pthread","--enable-compile-warnings","--enable-compile-optimizations","--enable-botbuild"]) +pthreads_factory_O3.addStep(step.ShellCommand,name = "{make clean}",description = "running make clean",descriptionDone = "make clean", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make", "clean"]) +pthreads_factory_O3.addStep(step.ShellCommand,name = "{make}", description = "running make", descriptionDone = "make", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4"]) +pthreads_factory_O3.addStep(CustomCheck,name ="{check all}", description = "running check all", descriptionDone ="check all", + haltOnFailure = True,command=["./checkall"]) ucontext_factory_O3= factory.BuildFactory() -ucontext_factory_O3.addStep(step.SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update") -ucontext_factory_O3.addStep(step.ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert",haltOnFailure = 1,command=["svn" ,"revert","-R","build"]) -ucontext_factory_O3.addStep(CustomConfigure,name ="{configure}",description="running configure",descriptionDone="configure",haltOnFailure = 1,command=["./configure", "--with-context=ucontext","--enable-compile-optimizations","--enable-botbuild"]) # Main difference with pthread_factory -ucontext_factory_O3.addStep(step.ShellCommand,name = "{make}",description = "running make",descriptionDone = "make",haltOnFailure = 1,command=["make"]) -ucontext_factory_O3.addStep(step.ShellCommand,name = "{check all}",description = "running check all",descriptionDone ="check all",haltOnFailure = 1,command=["./checkall"]) -#ucontext_factory_O3.addStep(step.ShellCommand,name = "{make distcheck}",description="running make distcheck",descriptionDone="make distcheck",haltOnFailure = 1,command=["make", "distcheck"]) - +ucontext_factory_O3.addStep(CustomSVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update") +ucontext_factory_O3.addStep(step.ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","build"]) +ucontext_factory_O3.addStep(CustomConfigure,name ="{configure}",description="running configure",descriptionDone="configure", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-context=ucontext","--enable-compile-warnings","--enable-compile-optimizations","--enable-botbuild"]) # Main difference with pthread_factory +ucontext_factory_O3.addStep(step.ShellCommand,name = "{make}",description = "running make",descriptionDone = "make", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make"]) +ucontext_factory_O3.addStep(CustomCheck,name = "{check all}",description = "running check all",descriptionDone ="check all", + environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./checkall"]) windows_factory= factory.BuildFactory() windows_factory.addStep(step.SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update") -windows_factory.addStep(step.ShellCommand,name = "{make}",description = "running make",descriptionDone = "make",haltOnFailure = 1,command=["C:\\buildslave\\projects\\simgrid\\builddir\\buildMake", "C:\\buildslave\\projects\\simgrid\\builddir\\make_all.tst"]) -windows_factory.addStep(step.ShellCommand,name = "{test suite}",description= "running test suite",descriptionDone ="test suite",haltOnFailure = 1,command=["C:\\buildslave\\projects\\simgrid\\builddir\\Test", "C:\\buildslave\\projects\\simgrid\\builddir\\test_all.tst"]) +windows_factory.addStep(step.ShellCommand,name = "{make}",description = "running make",descriptionDone = "make",haltOnFailure = True,command=["C:\\buildslave\\projects\\simgrid\\builddir\\buildMake", "C:\\buildslave\\projects\\simgrid\\builddir\\make_all.tst"]) +windows_factory.addStep(step.ShellCommand,name = "{test suite}",description= "running test suite",descriptionDone ="test suite",haltOnFailure = True,command=["C:\\buildslave\\projects\\simgrid\\builddir\\Test", "C:\\buildslave\\projects\\simgrid\\builddir\\test_all.tst"]) # builders @@ -333,5 +324,4 @@ c['status'].append(mail.MailNotifier(builders=['linux_i386_ucontext_O3'], c['projectName'] = "SimGrid compilation status" c['projectURL']= "http://simgrid.gforge.inria.fr/" -#c['projectURL'] = "http://bob.loria.fr:8010/" c['buildbotURL'] = "http://bob.loria.fr:8010/" -- 2.20.1