def Summary(repos): buildbot.Step('Summary') info = {'repositories': repos} info_file = os.path.join(HOST_DIR, 'buildinfo.json') print 'Failed steps: %s.' % buildbot.Failed() for step in buildbot.FailedList(): print ' %s' % step print 'Warned steps: %s.' % buildbot.Warned() for step in buildbot.WarnedList(): print ' %s' % step if buildbot.Failed(): buildbot.Fail()
def Summary(repos): buildbot.Step('Summary') info = {'repositories': repos} info['build'] = BUILDBOT_BUILDNUMBER info['scheduler'] = SCHEDULER info_json = json.dumps(info) print info print 'Failed steps: %s.' % buildbot.Failed() with open('latest', 'w+') as f: f.write(info_json) buildbot.Link('latest', cloud.Upload('latest', 'git/latest')) if buildbot.Failed(): buildbot.Fail() else: with open('lkgr', 'w+') as f: f.write(info_json) buildbot.Link('lkgr', cloud.Upload('lkgr', 'git/lkgr'))
def Summary(repos): buildbot.Step('Summary') info = {'repositories': repos} info['build'] = BUILDBOT_BUILDNUMBER info['scheduler'] = SCHEDULER info_json = json.dumps(info, indent=2) print info_json print 'Failed steps: %s.' % buildbot.Failed() for step in buildbot.FailedList(): print ' %s' % step latest_file = os.path.join(WORK_DIR, 'latest') with open(latest_file, 'w+') as f: f.write(info_json) buildbot.Link('latest', cloud.Upload(latest_file, 'git/latest')) if buildbot.Failed(): buildbot.Fail() else: lkgr_file = os.path.join(WORK_DIR, 'lkgr') with open(lkgr_file, 'w+') as f: f.write(info_json) buildbot.Link('lkgr', cloud.Upload(lkgr_file, 'git/lkgr'))
def run(): #Clobber() try: BuildRepos() except Exception: # If any exception reaches here, do not attempt to run the tests; just # log the error for buildbot and exit print "Exception thrown in build step." traceback.print_exc() buildbot.Fail() Summary({}) return 1 for t in AllTests(): t.Test() # Keep the summary step last: it'll be marked as red if the return code is # non-zero. Individual steps are marked as red with buildbot.Fail(). Summary({}) return buildbot.Failed()
def run(sync_filter, build_filter, test_filter, options): Clobber() Chdir(SCRIPT_DIR) Mkdir(WORK_DIR) SyncRepos(sync_filter, options.sync_lkgr) repos = None if sync_filter.Check(''): repos = GetRepoInfo() if build_filter.All(): Remove(INSTALL_DIR) Mkdir(INSTALL_DIR) Mkdir(INSTALL_BIN) Mkdir(INSTALL_LIB) # Add prebuilt cmake to PATH so any subprocesses use a consistent cmake. os.environ['PATH'] = (os.path.join(PREBUILT_CMAKE_DIR, 'bin') + os.pathsep + os.environ['PATH']) try: BuildRepos(build_filter, test_filter.Check('asm')) except Exception as e: # If any exception reaches here, do not attempt to run the tests; just # log the error for buildbot and exit print "Exception thrown: {}".format(e) buildbot.Fail() Summary(repos) return 1 if test_filter.Check('bare'): CompileLLVMTorture() s2wasm_out = LinkLLVMTorture( name='s2wasm', linker=os.path.join(INSTALL_BIN, '0xb', 's2wasm'), fails=S2WASM_KNOWN_TORTURE_FAILURES) sexpr_wasm_out = AssembleLLVMTorture( name='s2wasm-sexpr-wasm', assembler=os.path.join(INSTALL_BIN, 'sexpr-wasm'), indir=s2wasm_out, fails=SEXPR_S2WASM_KNOWN_TORTURE_FAILURES) ExecuteLLVMTorture( name='wasm-shell', runner=os.path.join(INSTALL_BIN, '0xb', 'wasm-shell'), indir=s2wasm_out, fails=BINARYEN_SHELL_KNOWN_TORTURE_FAILURES, extension='wast', warn_only=True) # TODO wasm-shell is flaky when running tests. ExecuteLLVMTorture( name='spec', runner=os.path.join(INSTALL_BIN, 'wasm.opt'), indir=s2wasm_out, fails=SPEC_KNOWN_TORTURE_FAILURES, extension='wast') ExecuteLLVMTorture( name='d8', runner=os.path.join(INSTALL_BIN, 'd8'), indir=sexpr_wasm_out, fails=V8_KNOWN_TORTURE_FAILURES, extension='wasm', warn_only=True, wasmjs=os.path.join(INSTALL_LIB, 'wasm.js')) ExecuteLLVMTorture( name='d8-musl', runner=os.path.join(INSTALL_BIN, 'd8'), indir=sexpr_wasm_out, fails=V8_MUSL_KNOWN_TORTURE_FAILURES, extension='wasm', warn_only=True, wasmjs=os.path.join(INSTALL_LIB, 'wasm.js'), extra_files=[os.path.join(INSTALL_LIB, 'musl.wasm')]) if test_filter.Check('asm'): asm2wasm_out = CompileLLVMTortureBinaryen( 'Compile LLVM Torture (asm2wasm)', os.path.join(INSTALL_DIR, 'emscripten_config'), ASM2WASM_TORTURE_OUT_DIR, ASM2WASM_KNOWN_TORTURE_COMPILE_FAILURES) ExecuteLLVMTorture( name='asm2wasm', runner=os.path.join(INSTALL_BIN, 'd8'), indir=asm2wasm_out, fails=ASM2WASM_KNOWN_TORTURE_FAILURES, extension='c.js', outdir=asm2wasm_out) # emscripten's wasm.js expects all files in cwd. if test_filter.Check('emwasm'): emscripten_wasm_out = CompileLLVMTortureBinaryen( 'Compile LLVM Torture (emscripten+wasm backend)', os.path.join(INSTALL_DIR, 'emscripten_config_vanilla'), EMSCRIPTENWASM_TORTURE_OUT_DIR, EMSCRIPTENWASM_KNOWN_TORTURE_COMPILE_FAILURES) ExecuteLLVMTorture( name='emscripten-wasm', runner=os.path.join(INSTALL_BIN, 'd8'), indir=emscripten_wasm_out, fails=EMSCRIPTENWASM_KNOWN_TORTURE_FAILURES, extension='c.js', outdir=emscripten_wasm_out) if test_filter.Check('emtest'): ExecuteEmscriptenTestSuite( 'Emscripten test suite (wasm backend)', outdir=EMSCRIPTEN_TEST_OUT_DIR) # Keep the summary step last: it'll be marked as red if the return code is # non-zero. Individual steps are marked as red with buildbot.Fail(). Summary(repos) return buildbot.Failed()
def main(sync_filter, build_filter, test_filter, options): Clobber() Chdir(SCRIPT_DIR) Mkdir(WORK_DIR) SyncRepos(sync_filter) repos = None if sync_filter.Check(''): repos = GetRepoInfo() if build_filter.All(): Remove(INSTALL_DIR) Mkdir(INSTALL_DIR) Mkdir(INSTALL_BIN) Mkdir(INSTALL_LIB) BuildRepos(build_filter, test_filter.Check('asm')) if test_filter.Check('bare'): CompileLLVMTorture() s2wasm_out = LinkLLVMTorture(name='s2wasm', linker=os.path.join( INSTALL_BIN, 's2wasm'), fails=S2WASM_KNOWN_TORTURE_FAILURES) sexpr_wasm_out = AssembleLLVMTorture( name='s2wasm-sexpr-wasm', assembler=os.path.join(INSTALL_BIN, 'sexpr-wasm'), indir=s2wasm_out, fails=SEXPR_S2WASM_KNOWN_TORTURE_FAILURES) ExecuteLLVMTorture( name='wasm-shell', runner=os.path.join(INSTALL_BIN, 'wasm-shell'), indir=s2wasm_out, fails=BINARYEN_SHELL_KNOWN_TORTURE_FAILURES, extension='wast', is_flaky=True) # TODO wasm-shell is flaky when running tests. ExecuteLLVMTorture(name='spec', runner=os.path.join(INSTALL_BIN, 'wasm.opt'), indir=s2wasm_out, fails=SPEC_KNOWN_TORTURE_FAILURES, extension='wast') ExecuteLLVMTorture(name='d8', runner=os.path.join(INSTALL_BIN, 'd8'), indir=sexpr_wasm_out, fails=V8_KNOWN_TORTURE_FAILURES, extension='wasm', wasmjs=os.path.join(INSTALL_LIB, 'wasm.js')) ExecuteLLVMTorture( name='d8-musl', runner=os.path.join(INSTALL_BIN, 'd8'), indir=sexpr_wasm_out, fails=V8_MUSL_KNOWN_TORTURE_FAILURES, extension='wasm', wasmjs=os.path.join(INSTALL_LIB, 'wasm.js'), extra_files=[os.path.join(INSTALL_LIB, 'musl.wasm')]) if test_filter.Check('asm'): asm2wasm_out = CompileLLVMTortureBinaryen( 'Compile LLVM Torture (asm2wasm)', os.path.join(INSTALL_DIR, 'emscripten_config'), ASM2WASM_TORTURE_OUT_DIR, ASM2WASM_KNOWN_TORTURE_COMPILE_FAILURES) ExecuteLLVMTorture(name='asm2wasm', runner=os.path.join(INSTALL_BIN, 'd8'), indir=asm2wasm_out, fails=ASM2WASM_KNOWN_TORTURE_FAILURES, extension='c.js', outdir=asm2wasm_out ) # emscripten's wasm.js expects all files in cwd. if test_filter.Check('emwasm'): emscripten_wasm_out = CompileLLVMTortureBinaryen( 'Compile LLVM Torture (emscripten+wasm backend)', os.path.join(INSTALL_DIR, 'emscripten_config_vanilla'), EMSCRIPTENWASM_TORTURE_OUT_DIR, EMSCRIPTENWASM_KNOWN_TORTURE_COMPILE_FAILURES) ExecuteLLVMTorture(name='emscripten-wasm', runner=os.path.join(INSTALL_BIN, 'd8'), indir=emscripten_wasm_out, fails=EMSCRIPTENWASM_KNOWN_TORTURE_FAILURES, extension='c.js', outdir=emscripten_wasm_out) # Keep the summary step last: it'll be marked as red if the return code is # non-zero. Individual steps are marked as red with buildbot.Fail(). Summary(repos) return buildbot.Failed()