|
1 | 1 | from buildbot.plugins import steps
|
2 |
| -from buildbot.process.results import SUCCESS, FAILURE, WARNINGS |
| 2 | +from buildbot.process.build import Build |
| 3 | +from buildbot.process.results import SUCCESS, FAILURE, WARNINGS, SKIPPED, EXCEPTION, RETRY, CANCELLED |
3 | 4 | from buildbot.steps.shell import ShellCommand
|
| 5 | +from twisted.internet import defer |
4 | 6 | from zorg.buildbot.builders.UnifiedTreeBuilder import getLLVMBuildFactoryAndSourcecodeSteps, addCmakeSteps, addNinjaSteps
|
5 | 7 | from zorg.buildbot.commands.LitTestCommand import LitTestCommand
|
6 | 8 | from zorg.buildbot.commands.CmakeCommand import CmakeCommand
|
@@ -36,6 +38,7 @@ def getBOLTCmakeBuildFactory(
|
36 | 38 | depends_on_projects=depends_on_projects,
|
37 | 39 | **kwargs) # Pass through all the extra arguments.
|
38 | 40 |
|
| 41 | + f.buildClass = SkipAwareBuild |
39 | 42 | if bolttests:
|
40 | 43 | checks += ['check-large-bolt']
|
41 | 44 | extra_configure_args += [
|
@@ -168,3 +171,21 @@ def getBOLTCmakeBuildFactory(
|
168 | 171 | ])
|
169 | 172 |
|
170 | 173 | return f
|
| 174 | +class SkipAwareBuild(Build): |
| 175 | + """ |
| 176 | + Custom Build class that marks the overall build status as skipped when no |
| 177 | + BOLT tests have run and no other important statuses are logged. |
| 178 | +
|
| 179 | + This is done by overriding stepDone, which merges the results of each step |
| 180 | + to the overall build. |
| 181 | + """ |
| 182 | + @defer.inlineCallbacks |
| 183 | + def stepDone(self, results, step): |
| 184 | + # Run the default logic. |
| 185 | + terminate = yield Build.stepDone(self, results, step) |
| 186 | + |
| 187 | + # Specialize by setting the overall build result to skipped when no |
| 188 | + # tests have ran and no other errors occurred. |
| 189 | + if step.name == "nfc-check-bolt" and results == SKIPPED and self.results not in (FAILURE, WARNINGS, EXCEPTION, RETRY, CANCELLED): |
| 190 | + self.results = SKIPPED |
| 191 | + return terminate |
0 commit comments