|
| 1 | +# Copyright (C) 2017 Apple Inc. All rights reserved. |
| 2 | +# |
| 3 | +# Redistribution and use in source and binary forms, with or without |
| 4 | +# modification, are permitted provided that the following conditions |
| 5 | +# are met: |
| 6 | +# 1. Redistributions of source code must retain the above copyright |
| 7 | +# notice, this list of conditions and the following disclaimer. |
| 8 | +# 2. Redistributions in binary form must reproduce the above copyright |
| 9 | +# notice, this list of conditions and the following disclaimer in the |
| 10 | +# documentation and/or other materials provided with the distribution. |
| 11 | +# |
| 12 | +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND |
| 13 | +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 14 | +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 15 | +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR |
| 16 | +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 17 | +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 18 | +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 19 | +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 20 | +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 21 | +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 22 | + |
| 23 | +from buildbot.process import factory |
| 24 | +from buildbot.steps import trigger |
| 25 | + |
| 26 | +from steps import * |
| 27 | + |
| 28 | + |
| 29 | +class Factory(factory.BuildFactory): |
| 30 | + def __init__(self, platform, configuration, architectures, buildOnly, additionalArguments, SVNMirror): |
| 31 | + factory.BuildFactory.__init__(self) |
| 32 | + self.addStep(ConfigureBuild(platform=platform, configuration=configuration, architecture=" ".join(architectures), buildOnly=buildOnly, additionalArguments=additionalArguments, SVNMirror=SVNMirror)) |
| 33 | + if SVNMirror: |
| 34 | + self.addStep(WaitForSVNServer()) |
| 35 | + self.addStep(CheckOutSource(SVNMirror=SVNMirror)) |
| 36 | + if not (platform == "jsc-only"): |
| 37 | + self.addStep(KillOldProcesses()) |
| 38 | + self.addStep(CleanBuildIfScheduled()) |
| 39 | + self.addStep(DeleteStaleBuildFiles()) |
| 40 | + if platform == "win": |
| 41 | + self.addStep(InstallWin32Dependencies()) |
| 42 | + if platform == "gtk" and additionalArguments != ["--no-experimental-features"]: |
| 43 | + self.addStep(InstallGtkDependencies()) |
| 44 | + if platform == "wpe": |
| 45 | + self.addStep(InstallWpeDependencies()) |
| 46 | + |
| 47 | + |
| 48 | +class BuildFactory(Factory): |
| 49 | + def __init__(self, platform, configuration, architectures, triggers=None, additionalArguments=None, SVNMirror=None): |
| 50 | + Factory.__init__(self, platform, configuration, architectures, True, additionalArguments, SVNMirror) |
| 51 | + |
| 52 | + if platform == "win": |
| 53 | + self.addStep(CompileWebKit(timeout=2 * 60 * 60)) |
| 54 | + else: |
| 55 | + self.addStep(CompileWebKit()) |
| 56 | + |
| 57 | + if triggers: |
| 58 | + self.addStep(ArchiveBuiltProduct()) |
| 59 | + self.addStep(UploadBuiltProduct()) |
| 60 | + if platform.startswith('mac') or platform.startswith('ios-simulator'): |
| 61 | + self.addStep(ArchiveMinifiedBuiltProduct()) |
| 62 | + self.addStep(UploadMinifiedBuiltProduct()) |
| 63 | + self.addStep(TransferToS3()) |
| 64 | + self.addStep(trigger.Trigger(schedulerNames=triggers)) |
| 65 | + |
| 66 | + |
| 67 | +class TestFactory(Factory): |
| 68 | + JSCTestClass = RunJavaScriptCoreTests |
| 69 | + LayoutTestClass = RunWebKitTests |
| 70 | + |
| 71 | + def getProduct(self): |
| 72 | + self.addStep(DownloadBuiltProduct()) |
| 73 | + self.addStep(ExtractBuiltProduct()) |
| 74 | + |
| 75 | + def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None, **kwargs): |
| 76 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror, **kwargs) |
| 77 | + self.getProduct() |
| 78 | + if self.JSCTestClass: |
| 79 | + self.addStep(self.JSCTestClass()) |
| 80 | + if self.LayoutTestClass: |
| 81 | + self.addStep(self.LayoutTestClass()) |
| 82 | + |
| 83 | + if platform == 'win' or platform.startswith('mac') or platform.startswith('ios-simulator'): |
| 84 | + self.addStep(RunUnitTests()) |
| 85 | + self.addStep(RunPythonTests()) |
| 86 | + self.addStep(RunPerlTests()) |
| 87 | + self.addStep(RunBindingsTests()) |
| 88 | + self.addStep(RunBuiltinsTests()) |
| 89 | + if platform != 'win': |
| 90 | + self.addStep(RunDashboardTests()) |
| 91 | + if self.LayoutTestClass: |
| 92 | + self.addStep(ArchiveTestResults()) |
| 93 | + self.addStep(UploadTestResults()) |
| 94 | + self.addStep(ExtractTestResults()) |
| 95 | + if platform == "gtk": |
| 96 | + self.addStep(RunGtkAPITests()) |
| 97 | + if platform == "wpe": |
| 98 | + self.addStep(RunWPEAPITests()) |
| 99 | + |
| 100 | + |
| 101 | +class BuildAndTestFactory(TestFactory): |
| 102 | + def getProduct(self): |
| 103 | + self.addStep(CompileWebKit()) |
| 104 | + |
| 105 | + def __init__(self, platform, configuration, architectures, triggers=None, additionalArguments=None, SVNMirror=None, **kwargs): |
| 106 | + TestFactory.__init__(self, platform, configuration, architectures, additionalArguments, SVNMirror, **kwargs) |
| 107 | + if triggers: |
| 108 | + self.addStep(ArchiveBuiltProduct()) |
| 109 | + self.addStep(UploadBuiltProduct()) |
| 110 | + self.addStep(trigger.Trigger(schedulerNames=triggers)) |
| 111 | + |
| 112 | + |
| 113 | +class BuildAndTestLLINTCLoopFactory(Factory): |
| 114 | + def __init__(self, platform, configuration, architectures, triggers=None, additionalArguments=None, SVNMirror=None, **kwargs): |
| 115 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror, **kwargs) |
| 116 | + self.addStep(CompileLLINTCLoop()) |
| 117 | + self.addStep(RunLLINTCLoopTests()) |
| 118 | + |
| 119 | + |
| 120 | +class BuildAndTest32bitJSCFactory(Factory): |
| 121 | + def __init__(self, platform, configuration, architectures, triggers=None, additionalArguments=None, SVNMirror=None, **kwargs): |
| 122 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror, **kwargs) |
| 123 | + self.addStep(Compile32bitJSC()) |
| 124 | + self.addStep(Run32bitJSCTests()) |
| 125 | + |
| 126 | + |
| 127 | +class BuildAndNonLayoutTestFactory(BuildAndTestFactory): |
| 128 | + LayoutTestClass = None |
| 129 | + |
| 130 | + |
| 131 | +class BuildAndRemoteJSCTestsFactory(Factory): |
| 132 | + def __init__(self, platform, configuration, architectures, triggers=None, additionalArguments=None, SVNMirror=None): |
| 133 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror) |
| 134 | + self.addStep(CompileJSCOnly(timeout=60 * 60)) |
| 135 | + self.addStep(RunRemoteJavaScriptCoreTests(timeout=60 * 60)) |
| 136 | + |
| 137 | + |
| 138 | +class TestWebKit1LeaksFactory(Factory): |
| 139 | + def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None): |
| 140 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror) |
| 141 | + self.addStep(DownloadBuiltProduct()) |
| 142 | + self.addStep(ExtractBuiltProduct()) |
| 143 | + self.addStep(RunWebKit1LeakTests()) |
| 144 | + self.addStep(ArchiveTestResults()) |
| 145 | + self.addStep(UploadTestResults()) |
| 146 | + self.addStep(ExtractTestResultsAndLeaks()) |
| 147 | + |
| 148 | + |
| 149 | +class TestAllButJSCFactory(TestFactory): |
| 150 | + JSCTestClass = None |
| 151 | + |
| 152 | + |
| 153 | +class TestJSCFactory(Factory): |
| 154 | + def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None): |
| 155 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror) |
| 156 | + self.addStep(DownloadBuiltProduct()) |
| 157 | + self.addStep(ExtractBuiltProduct()) |
| 158 | + self.addStep(RunJavaScriptCoreTests()) |
| 159 | + |
| 160 | + |
| 161 | +class Test262Factory(Factory): |
| 162 | + def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None): |
| 163 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror) |
| 164 | + self.addStep(DownloadBuiltProduct()) |
| 165 | + self.addStep(ExtractBuiltProduct()) |
| 166 | + self.addStep(RunTest262Tests()) |
| 167 | + |
| 168 | + |
| 169 | +class TestWebKit1Factory(TestFactory): |
| 170 | + LayoutTestClass = RunWebKit1Tests |
| 171 | + |
| 172 | + |
| 173 | +class TestWebKit1AllButJSCFactory(TestWebKit1Factory): |
| 174 | + JSCTestClass = None |
| 175 | + |
| 176 | + |
| 177 | +class BuildAndPerfTestFactory(Factory): |
| 178 | + def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None, **kwargs): |
| 179 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror, **kwargs) |
| 180 | + self.addStep(CompileWebKit()) |
| 181 | + self.addStep(RunAndUploadPerfTests()) |
| 182 | + if platform == "gtk": |
| 183 | + self.addStep(RunBenchmarkTests()) |
| 184 | + |
| 185 | + |
| 186 | +class DownloadAndPerfTestFactory(Factory): |
| 187 | + def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None, **kwargs): |
| 188 | + Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror, **kwargs) |
| 189 | + self.addStep(DownloadBuiltProduct()) |
| 190 | + self.addStep(ExtractBuiltProduct()) |
| 191 | + self.addStep(RunAndUploadPerfTests()) |
| 192 | + if platform == "gtk": |
| 193 | + self.addStep(RunBenchmarkTests()) |
0 commit comments