Index: test/buildbot/builders/Import.py =================================================================== --- test/buildbot/builders/Import.py +++ test/buildbot/builders/Import.py @@ -2,7 +2,6 @@ import zorg from zorg.buildbot.builders import ClangBuilder, LLVMBuilder, LLVMGCCBuilder -from zorg.buildbot.builders import NightlytestBuilder from zorg.buildbot.builders import SanitizerBuilder # Just check that we can instantiate the build factors, what else can we do? @@ -13,6 +12,4 @@ print LLVMGCCBuilder.getLLVMGCCBuildFactory() -print NightlytestBuilder.getFastNightlyTestBuildFactory('x86_64-apple-darwin10') - print SanitizerBuilder.getSanitizerBuildFactory() Index: zorg/buildbot/builders/NightlytestBuilder.py =================================================================== --- zorg/buildbot/builders/NightlytestBuilder.py +++ /dev/null @@ -1,124 +0,0 @@ -from buildbot.steps.shell import Configure, ShellCommand -from buildbot.process.properties import WithProperties -from buildbot.steps.source import SVN - -from zorg.buildbot.commands.NightlyTestCommand import NightlyTestCommand - -import LLVMGCCBuilder -import ClangBuilder - -def getNightlytestBuildFactory(submitAux=None, *args, **kwargs): - f = LLVMGCCBuilder.getLLVMGCCBuildFactory(*args, **kwargs) - - # Prepare environmental variables. Set here all env we want everywhere. - merged_env = { - 'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences. - } - - env = kwargs.pop('env', None) - if env is not None: - merged_env.update(env) # Overwrite pre-set items with the given ones, so user can set anything. - - # Copy NT script. - f.addStep(ShellCommand(name="cp test script", - command=["cp", - WithProperties("%(builddir)s/llvm.src/utils/NewNightlyTest.pl"), - "."], - haltOnFailure = True, - description = "cp test script", - workdir = "llvm.nt", - env = merged_env)) - - submitCommand = [] - if submitAux is not None: - submitCommand = ['-submit-aux', - submitAux] - - f.addStep(ShellCommand(name="nightlytest", - command=["./NewNightlyTest.pl", - "-parallel-jobs", WithProperties("%(jobs)s"), - "-parallel", - "-noremoveatend", - "-noremoveresults", - "-release", - "-enable-llcbeta", - "-verbose", - "-nickname", WithProperties("%(slavename)s"), - "-test-cxxflags", "-I/usr/include/c++/4.2.1/i686-apple-darwin10 -I/usr/include/c++/4.2.1", - "-nosubmit", - "-teelogs"] + submitCommand, - haltOnFailure = True, - description = "nightlytest", - workdir = "llvm.nt", - env = { - 'LLVMGCCDIR' : WithProperties("%(builddir)s/llvm-gcc.install"), - 'BUILDDIR' : WithProperties("%(builddir)s/llvm.nt/build"), - 'WEBDIR' : WithProperties("%(builddir)s/llvm.nt/testresults"), - }.update(merged_env))) - return f - -def getFastNightlyTestBuildFactory(triple, xfails=[], clean=True, test=False, make='make', **kwargs): - # Build compiler to test. - f = ClangBuilder.getClangBuildFactory( - triple, clean=clean, test=test, - make=make, **kwargs) - - # Prepare environmental variables. Set here all env we want everywhere. - merged_env = { - 'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences. - } - env = kwargs.pop('env', None) - if env is not None: - merged_env.update(env) # Overwrite pre-set items with the given ones, so user can set anything. - - # Get the test-suite sources. - f.addStep(SVN(name = 'svn-test-suite', - mode = 'update', - baseURL = 'http://llvm.org/svn/llvm-project/test-suite/', - defaultBranch = 'trunk', - workdir = 'test-suite.src')) - - # Clean up. - if clean: - f.addStep(ShellCommand(name="rm.test-suite", - command=["rm", "-rf", "test-suite.obj"], - haltOnFailure = True, - description = "rm test-suite build dir", - workdir = ".", - env = merged_env)) - - # Configure. - f.addStep(Configure(name="configure.test-suite", - command=['../test-suite.src/configure', - WithProperties("--with-llvmsrc=%(builddir)s/llvm.src"), - WithProperties("--with-llvmobj=%(builddir)s/llvm.obj"), - WithProperties("--with-built-clang")], - haltOnFailure = True, - description = ["configuring", "test-suite"], - descriptionDone = ["configure", "test-suite"], - workdir = 'test-suite.obj', - env = merged_env)) - - # Build and test. - f.addStep(ShellCommand(name="rm.test-suite.report", - command=["rm", "-rf", - "test-suite.obj/report.nightly.raw.out", - "test-suite.obj/report.nightly.txt"], - haltOnFailure = True, - description = "rm test-suite report", - workdir = ".", - env = merged_env)) - f.addStep(NightlyTestCommand(name="make.test-suite", - command=[make, WithProperties("-j%(jobs)s"), - "ENABLE_PARALLEL_REPORT=1", - "DISABLE_CBE=1", "DISABLE_JIT=1", - "TEST=nightly", "report"], - haltOnFailure = True, - logfiles = { 'report' : 'report.nightly.txt' }, - xfails = xfails, - description = ["running", "test-suite"], - descriptionDone = ["run", "test-suite"], - workdir = 'test-suite.obj', - env = merged_env)) - - return f Index: zorg/buildbot/commands/NightlyTestCommand.py =================================================================== --- zorg/buildbot/commands/NightlyTestCommand.py +++ /dev/null @@ -1,86 +0,0 @@ -import itertools -import re -import os - -import buildbot -import buildbot.steps.shell - -class NightlyTestCommand(buildbot.steps.shell.Test): - - def __init__(self, xfails=[], *args, **kwargs): - buildbot.steps.shell.Test.__init__(self, *args, **kwargs) - - self.expectedFailures = set(xfails) - self.addFactoryArguments(xfails=list(xfails)) - - def evaluateCommand(self, cmd): - # Always fail if the command itself failed. - # - # Disabled for now, nightlytest is so broken. - #if cmd.rc != 0: - # return buildbot.status.builder.FAILURE - - failures = {} - xfailures = {} - xpasses = {} - num_passes = 0 - num_tests = 0 - for item in parse_report(self.getLog('report').readlines()): - name = item.pop('Program') - for key,value in item.items(): - if '/' in key: - continue - kname = '%s.%s' % (key,name) - if value == '*': - if kname in self.expectedFailures: - xfailures[key] = xfailures.get(key,[]) - xfailures[key].append(kname) - else: - failures[key] = failures.get(key,[]) - failures[key].append(kname) - else: - if kname in self.expectedFailures: - xpasses[key] = xpasses.get(key,[]) - xpasses[key].append(kname) - else: - num_passes += 1 - num_tests += 1 - - num_fails = num_xfails = num_xpasses = 0 - for type,items in failures.items(): - if len(items) == num_tests: # Assume these are disabled. - continue - self.addCompleteLog('fail.%s' % type, '\n'.join(items) + '\n') - num_fails += len(items) - for type,items in xfailures.items(): - self.addCompleteLog('xfail.%s' % type, '\n'.join(items) + '\n') - num_xfails += len(items) - for type,items in xpasses.items(): - self.addCompleteLog('xpass.%s' % type, '\n'.join(items) + '\n') - num_xpasses += len(items) - - self.setTestResults(total=(num_passes + num_fails + num_xfails + - num_xpasses), - failed=num_fails, - passed=num_passes + num_xpasses, - warnings=num_xfails + num_xpasses) - if num_fails: - return buildbot.status.builder.FAILURE - return buildbot.status.builder.SUCCESS - -def parse_report(lines): - def split_row(ln): - return ln.split() - - header = None - for ln in lines: - if not ln.strip(): - continue - - if header is None: - ln = ln.replace(' compile', '_compile') - ln = ln.replace(' codegen', '_codegen') - header = split_row(ln) - else: - row = split_row(ln) - yield dict(zip(header, split_row(ln)))