-
Notifications
You must be signed in to change notification settings - Fork 2
/
master.cfg
795 lines (699 loc) · 31.1 KB
/
master.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# -*- python -*-
# ex: set syntax=python:
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory (although the filename
# can be changed with the --basedir option to 'mktap buildbot master').
# It has one job: define a dictionary named BuildmasterConfig. This
# dictionary has a variety of keys to control different aspects of the
# buildmaster. They are documented in docs/config.xhtml .
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### BUILDSLAVES
# the 'slaves' list defines the set of allowable buildslaves. Each element is
# a BuildSlave object, which is created with bot-name, bot-password. These
# correspond to values given to the buildslave's mktap invocation.
from buildbot.buildslave import BuildSlave
MAINBOTS = [
["win", ["xp", "vista_x64", "7_x64"]],
["linux", ["lucid_x64"]],
]
c['slaves'] = []
for (os, os_versions) in MAINBOTS:
for version in os_versions:
c['slaves'].append(BuildSlave("%s_%s_bot" % (os, version),
"bot1passwd", max_builds=1))
STABBOT="win7_stab_bot"
c['slaves'].append(BuildSlave(STABBOT, "bot1passwd", max_builds=1))
# 'slavePortnum' defines the TCP port to listen on. This must match the value
# configured into the buildslaves (with their --master option)
c['slavePortnum'] = 19989
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Any class which implements IChangeSource can be
# put here: there are several in buildbot/changes/*.py to choose from.
dr_svnurl = "http://dynamorio.googlecode.com/svn/trunk"
drm_svnurl = "http://drmemory.googlecode.com/svn/trunk"
from buildbot.changes.svnpoller import SVNPoller
drm_poller = SVNPoller(
svnurl=drm_svnurl,
pollinterval=60, # seconds
histmax=50,
svnbin='/usr/bin/svn',
)
c['change_source'] = [ drm_poller ]
####### SCHEDULERS
## configure the Schedulers
from buildbot import scheduler
BUILDERS=[]
DRM_BUILDERS=[]
DR_BUILDERS=[]
DR_NIGHTLY_BUILDERS=[]
for (os, os_versions) in MAINBOTS:
for version in os_versions:
drm_builder = "%s-%s-drm" % (os, version)
dr_builder = "%s-%s-dr" % (os, version)
dr_nightly_builder = "%s-%s-dr_nightly" % (os, version)
DRM_BUILDERS += [drm_builder]
DR_BUILDERS += [dr_builder]
DR_NIGHTLY_BUILDERS += [dr_nightly_builder]
BUILDERS += [drm_builder, dr_builder, dr_nightly_builder]
STABLE_BUILDERS=["win-builder", "linux-builder",
"win-xp-drm", "win-7_x64-drm",
"win7-stab", "linux-cr"]
c['schedulers'] = []
c['schedulers'].append(scheduler.Scheduler(
name="all",
branch=None,
treeStableTimer=60,
builderNames=(["win-builder"] +
["linux-builder"] +
DRM_BUILDERS)))
c['schedulers'].append(scheduler.Periodic(
name="periodic",
branch=None,
periodicBuildTimer=12*60*60, # Every 12 hours
builderNames=DRM_BUILDERS+DR_BUILDERS))
c['schedulers'].append(scheduler.Periodic(
name="periodic_stable",
branch=None,
periodicBuildTimer=2*60*60, # Every 2 hours
builderNames=["win7-stab", "linux-cr"]))
c['schedulers'].append(scheduler.Nightly(
name="dr-nightly",
branch=None,
hour=0, minute=0, # At midnight
builderNames=DR_NIGHTLY_BUILDERS))
c['schedulers'].append(scheduler.Nightly(
name="weekly",
branch=None,
dayOfWeek=6, # Monday=0, Sunday=6
properties={"is_weekly": True},
builderNames=["win7-stab"]))
####### BUILDERS
# the 'builders' list defines the Builders. Each one is configured with a
# dictionary, using the following keys:
# name (required): the name used to describe this builder
# slavename (required): which slave to use (must appear in c['bots'])
# builddir (required): which subdirectory to run the builder in
# factory (required): a BuildFactory to define how the build is run
# periodicBuildTime (optional): if set, force a build every N seconds
# buildbot/process/factory.py provides several BuildFactory classes you can
# start with, which implement build processes for common targets (GNU
# autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the
# base class, and is configured with a series of BuildSteps. When the build
# is run, the appropriate buildslave is told to execute each Step in turn.
# the first BuildStep is typically responsible for obtaining a copy of the
# sources. There are source-obtaining Steps in buildbot/steps/source.py for
# CVS, SVN, and others.
import re
from buildbot.process import factory
from buildbot.process.properties import WithProperties
from buildbot.steps.source import SVN
from buildbot.steps.shell import Configure
from buildbot.steps.shell import Compile
from buildbot.steps.shell import ShellCommand
from buildbot.steps.shell import SetProperty
from buildbot.steps.shell import Test
from buildbot.steps.transfer import DirectoryUpload
from buildbot.steps.transfer import FileUpload
from buildbot.steps.transfer import FileDownload
from buildbot.steps.python_twisted import Trial
from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, SKIPPED
LATEST_WIN_BUILD="public_html/builds/drmemory-windows-latest-sfx.exe"
class CTest(Test):
def __init__(self, **kwargs):
self.__result = None
Test.__init__(self, **kwargs)
def createSummary(self, log):
passed_count = 0
failure_count = 0
flaky_count = 0
last_project_line = None
summary_lines = []
found_summary = False
# Don't use 'readlines' because we want both stdout and stderr.
for line in log.getText().split("\n"):
if line.strip() == "RESULTS":
assert not found_summary, "Found two summaries!"
found_summary = True
if found_summary:
summary_lines.append(line)
# We try to recognize every line of the summary, because
# if we fail to match the failure count line we might stay
# green when we should be red.
if line.strip() == "RESULTS":
continue # Start of summary line
if not line.strip():
continue # Blank line
if re.match("^\t", line):
continue # Test failure lines start with tabs
if "build successful; no tests for this build" in line:
continue # Successful build with no tests
if "Error in read script" in line:
continue # DR i#636: Spurious line from ctest
# All tests passed for this config.
match = re.search("all (?P<passed>\d+) tests passed", line)
if match:
passed_count += int(match.group('passed'))
continue
# Some tests failed in this config.
match = re.match(r"^[^:]*: (?P<passed>\d+) tests passed, "
"\*\*\*\* (?P<failed>\d+) tests failed"
"(, of which (?P<flaky>\d+) were flaky)?:",
line)
if match:
passed_count += int(match.group('passed'))
failure_count += int(match.group('failed'))
num_flaky_str = match.group('flaky')
if num_flaky_str:
flaky_count += int(num_flaky_str)
else:
# Add a fake failure so we get notified. Put the warning
# before the line we don't recognize.
failure_count += 1
summary_lines[-1:-1] = ["WARNING: next line unrecognized\n"]
if not found_summary:
# Add a fake failure so we get notified.
failure_count += 1
summary_lines.append("WARNING: Failed to find summary in stdio.\n")
self.setTestResults(passed=passed_count,
failed=failure_count - flaky_count,
warnings=flaky_count)
if failure_count > 0:
if failure_count > flaky_count:
self.__result = FAILURE
else:
self.__result = WARNINGS
summary_name = "summary: %d failed" % failure_count
if flaky_count > 0:
summary_name += ", %d flaky failed" % flaky_count
self.addCompleteLog(summary_name, "".join(summary_lines))
else:
self.__result = SUCCESS
got_revision = self.getProperty("got_revision")
buildnumber = self.getProperty("buildnumber")
buildername = self.getProperty("buildername")
if "drm" in buildername:
self.addURL("test logs",
"http://build.chromium.org/p/client.drmemory/testlogs/" +
"from_%s/testlogs_r%s_b%s.7z" % \
(buildername, got_revision, buildnumber))
def evaluateCommand(self, cmd):
if self.__result is not None:
return self.__result
return Test.evaluateCommand(self, cmd)
class DrMemoryTest(Test):
def __init__(self, **kwargs):
self.failed__ = False # there's a "failed" method in Test, ouch!
Test.__init__(self, **kwargs)
def createSummary(self, log):
failed_tests = []
summary = []
report_count = 0
assert_failure = None
# Don't use 'readlines' because we want both stdout and stderr.
for line in log.getText().split("\n"):
m = re.match("\[ FAILED \] (.*\..*) \([0-9]+ ms\)", line.strip())
if m:
failed_tests.append(m.groups()[0]) # Append failed test name.
DRM_PREFIX="~~[Dr\.M0-9]+~~ "
m = re.match(DRM_PREFIX + "(.*)", line)
if m:
summary.append(m.groups()[0])
m = re.match(DRM_PREFIX + "*([0-9]+) unique,.*total,* (.*)", line)
if m:
(error_count, error_type) = m.groups()
error_count = int(error_count)
report_count += error_count
m = re.match(DRM_PREFIX + "ASSERT FAILURE \(.*\): (.*)", line)
if m:
assert_failure = "ASSERT FAILURE: " + m.groups()[0]
if assert_failure:
self.failed__ = True
self.addCompleteLog("ASSERT FAILURE!!!", assert_failure)
if failed_tests:
self.failed__ = True
self.setTestResults(failed=len(failed_tests))
self.addCompleteLog('%d tests failed' % len(failed_tests),
"\n".join(failed_tests))
if report_count > 0:
self.failed__ = True
self.setTestResults(warnings=report_count)
self.addCompleteLog('summary: %d report(s)' % report_count,
"".join(summary))
def evaluateCommand(self, cmd):
if self.failed__:
return FAILURE
return Test.evaluateCommand(self, cmd)
def CreateAppTest(windows, app_name, app_cmd, build_mode, run_mode,
use_syms=True, **kwargs):
# Pick exe from build mode.
if windows:
cmd = ["build_drmemory-%s-32\\bin\\drmemory" % build_mode]
else:
cmd = ["build_drmemory-%s-32/bin/drmemory.pl" % build_mode]
# Default flags turn off message boxes, notepad, and print to stderr.
cmd += ['-dr_ops', '-msgbox_mask 0 -stderr_mask 15',
'-results_to_stderr', '-batch']
if windows:
# FIXME: The point of these app tests is to verify that we get no false
# positives on well-behaved applications, so we should remove these
# extra suppressions. We're not using them on dev machines but we'll
# leave them on the bots and for tsan tests for now.
cmd += ['-suppress',
'..\\drmemory\\tests\\app_suite\\default-suppressions.txt']
# Full mode flags are default, light mode turns off uninits and leaks.
if run_mode == "light":
cmd += ['-light']
cmd.append('--')
cmd += app_cmd
# Set _NT_SYMBOL_PATH appropriately.
syms_part = ""
env = {}
if not use_syms:
syms_part = "nosyms "
if windows:
env["_NT_SYMBOL_PATH"] = ""
step_name = "%s %s %s%s" % (build_mode, run_mode, syms_part, app_name)
return DrMemoryTest(command=cmd,
env=env,
name=step_name,
descriptionDone=step_name,
description="run " + step_name,
**kwargs)
def CreateDRFactory(nightly=False, os='', os_version=''):
ret = factory.BuildFactory()
# DR factory - we checkout Dr. Memory and *then* update drmemory/dynamorio,
# otherwise Buildbot goes crazy about multiple revisions/ChangeSources.
ret.addStep(
SVN(
svnurl=drm_svnurl,
workdir="drmemory",
mode="update",
name="Checkout Dr. Memory"))
ret.addStep(
ShellCommand(
command=["svn", "up", "--force", "../drmemory/dynamorio"],
name="Update DR to ToT",
description="update DR"))
ret.addStep(
SetProperty(
command=["svnversion", "../drmemory/dynamorio"],
property="dr_revision",
name="Get DR revision",
descriptionDone="Get DR revision",
description="DR revision"))
if nightly:
assert os
assert os_version
os_mapping = {'win' : 'Windows', 'linux' : 'Linux'}
site_name = "%s.%s.BuildBot" % (os_mapping[os], os_version.capitalize())
runsuite_cmd = ("../drmemory/dynamorio/suite/runsuite.cmake,nightly" +
";long;site=%s" % site_name)
step_name = "Run DR nightly suite"
timeout = 20 * 60 # 20min w/o output. 10 is too short for Windows.
else:
runsuite_cmd = "../drmemory/dynamorio/suite/runsuite.cmake"
step_name = "Build and test DR"
timeout = 10 * 60 # 10min w/o output
ret.addStep(
CTest(
command=["ctest", "--timeout", "120", "-VV",
"-S", runsuite_cmd],
name=step_name,
descriptionDone=step_name,
timeout=timeout))
if os == 'linux':
ret.addStep(
DirectoryUpload(
slavesrc="install/docs/html",
masterdest="public_html/dr_docs"))
return ret
def CreateDrMFactory(windows):
ret = factory.BuildFactory()
ret.addStep(
SVN(svnurl=drm_svnurl,
workdir="drmemory",
mode="update",
name="Checkout Dr. Memory"))
ret.addStep(
SetProperty(
command=["svnversion", "../drmemory/dynamorio"],
property="dr_revision",
name="Get DR revision",
descriptionDone="Get DR revision",
description="DR revision"))
ret.addStep(
CTest(
command=["ctest", "--timeout", "60", "-VV", "-S",
WithProperties("../drmemory/tests/runsuite.cmake," +
"drmemory_only;" +
"build=%(buildnumber)s") ],
name="Dr. Memory ctest",
descriptionDone="runsuite",
flunkOnFailure=False, # failure doesn't mark the whole run as failure
warnOnFailure=True,
timeout=600))
if windows:
app_suite_cmd = ['build_drmemory-dbg-32\\tests\\app_suite_tests.exe']
else:
app_suite_cmd = ['build_drmemory-dbg-32/tests/app_suite_tests']
# Run app_suite tests in (dbg, rel) in light mode.
for build_mode in ('dbg', 'rel'):
ret.addStep(CreateAppTest(windows, "app_suite_tests", app_suite_cmd,
build_mode, 'light', use_syms=True))
if windows:
ret.addStep(CreateAppTest(windows, "app_suite_tests", app_suite_cmd,
build_mode, 'light', use_syms=False))
if windows:
ret.addStep(
ShellCommand(
command=[
"svn", "checkout", "--force",
"http://data-race-test.googlecode.com/svn/trunk/",
"../tsan"],
name="Checkout TSan tests",
description="checkout tsan tests"))
ret.addStep(
Compile(
command=["make", "-C", "../tsan/unittest"],
env={
# We have to over-ride PATH to include cygwin (make, sed
# and uname) but can't add cygwin for all steps, see
# http://code.google.com/p/drmemory/issues/detail?id=366
"PATH":
"e:\\b\\depot_tools\\svn_bin;" \
+ "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE;" \
+ "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin;C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE;" \
+ "C:\\cygwin\\bin",
"CYGWIN":
"nodosfilewarning", # suppress cygwin "MSDOS" warnings
},
name="Build TSan tests",
descriptionDone="build tsan tests",
description="build tsan tests"))
tsan_suite_cmd = ['..\\tsan\\unittest\\bin\\racecheck_unittest-windows-x86-O0.exe',
'--gtest_filter="-PositiveTests.FreeVsRead:NegativeTests.WaitForMultiple*"',
'-147']
# Run tsan tests in (dbg, rel) cross (full, light).
for build_mode in ('dbg', 'rel'):
for run_mode in ('full', 'light'):
ret.addStep(CreateAppTest(windows, "TSan tests", tsan_suite_cmd,
build_mode, run_mode, use_syms=True))
# Do one more run of TSan + app_suite without any pdb symbols to make
# sure our default suppressions match.
ret.addStep(CreateAppTest(windows, "TSan tests", tsan_suite_cmd,
"dbg", "full", use_syms=False))
ret.addStep(
ShellCommand(
command=[
"taskkill", "/T", "/F", "/IM", "drmemory.exe", "||",
"echo", "Dr. Memory is not running"],
alwaysRun=True,
name="Kill Dr. Memory processes",
description="taskkill"))
ret.addStep(
ShellCommand(
command=["del" if windows else "rm", "testlogs.7z"],
haltOnFailure=False,
flunkOnFailure=False,
warnOnFailure=True,
name="Prepare to pack test results",
description="cleanup"))
testlog_dirs = ["build_drmemory-dbg-32/logs",
"build_drmemory-dbg-32/Testing/Temporary",
"build_drmemory-rel-32/logs",
"build_drmemory-rel-32/Testing/Temporary"]
if windows:
testlog_dirs += ["xmlresults"]
else:
testlog_dirs += ["xml:results"]
ret.addStep(
ShellCommand(
command=(["7z", "a", "testlogs.7z"] + testlog_dirs),
haltOnFailure=True,
name="Pack test results",
description="pack results"))
ret.addStep(
FileUpload(
slavesrc="testlogs.7z",
masterdest=WithProperties(
"public_html/testlogs/" +
"from_%(buildername)s/testlogs_r%(got_revision)s_b%(buildnumber)s.7z"),
name="Upload test logs to the master"))
return ret
def CreateDrMPackageFactory(windows):
ret = factory.BuildFactory()
ret.addStep(
SVN(svnurl=drm_svnurl,
mode="clobber",
name="Checkout Dr. Memory"))
# package.cmake will complain if this does not start with "DrMemory-"
package_name = "DrMemory-package"
# The default package name has the version and revision, so we override it
# to something we can predict.
cpack_arg = 'cpackappend=set(CPACK_PACKAGE_FILE_NAME "%s")' % package_name
ret.addStep(
Compile(
command=["ctest", "-VV", "-S", 'package.cmake,build=42;' + cpack_arg],
name="Package Dr. Memory"))
if windows:
OUTPUT_DIR=("build_drmemory-debug-32\\" +
"_CPack_Packages\\Windows\\ZIP\\" + package_name)
RES_FILE="drmemory-windows-r%(got_revision)s-sfx.exe"
PUB_FILE=RES_FILE
ret.addStep(
ShellCommand(
command=["7z", "a", "-sfx", WithProperties(RES_FILE), "*"],
workdir=WithProperties("build\\" + OUTPUT_DIR),
haltOnFailure=True,
name="Pack test results",
description="pack results"))
ret.addStep(
FileUpload(
slavesrc=WithProperties(OUTPUT_DIR + "/" + RES_FILE),
masterdest=LATEST_WIN_BUILD,
name="Upload as latest build"))
else:
OUTPUT_DIR=("build_drmemory-debug-32/" +
"_CPack_Packages/Linux/TGZ")
RES_FILE=package_name + ".tar.gz"
PUB_FILE="drmemory-linux-r%(got_revision)s.tar.gz"
ret.addStep(
FileUpload(
slavesrc=WithProperties(OUTPUT_DIR + "/" + RES_FILE),
masterdest=WithProperties("public_html/builds/" +
PUB_FILE),
name="Upload binaries to the master"))
return ret
from buildbot.config import BuilderConfig
FACTORIES = {
"win": [
["drm", CreateDrMFactory(True)],
["dr", CreateDRFactory()],
],
"linux": [
["drm", CreateDrMFactory(False)],
["dr", CreateDRFactory(os='linux')],
],
}
c['builders'] = []
for (os, os_versions) in MAINBOTS:
c['builders'].append(
BuilderConfig(name=("%s-builder" % os),
slavename=("%s_%s_bot" % (os, os_versions[-1])),
factory=CreateDrMPackageFactory(os == "win"),
builddir=("%s_builder_checkout" % os)))
for version in os_versions:
for (f_name, f_obj) in FACTORIES[os]:
c['builders'].append(
BuilderConfig(name=("%s-%s-%s" % (os, version, f_name)),
slavename=("%s_%s_bot" % (os, version)),
factory=f_obj,
builddir=("%s_%s_%s_checkout" % (os, version, f_name))))
c['builders'].append(
BuilderConfig(name=("%s-%s-dr_nightly" % (os, version)),
slavename=("%s_%s_bot" % (os, version)),
factory=CreateDRFactory(nightly=True, os=os,
os_version=version),
builddir=("%s_%s_dr_nightly_checkout" % (os, version))))
def CreateWinStabFactory():
ret = factory.BuildFactory()
SFX_NAME="drm-sfx" # TODO: add .exe when BB supports that, d'oh!
ret.addStep(
FileDownload(mastersrc=LATEST_WIN_BUILD,
slavedest=(SFX_NAME + ".exe"),
name="Download the latest build"))
ret.addStep(
ShellCommand(command=[SFX_NAME, "-ounpacked", "-y"],
haltOnFailure=True,
name="Unpack the build",
description="unpack the build"))
# Find out the revision number using -version
def get_revision(rc, stdout, stderr):
m = re.search(r"version \d+\.\d+\.(\d+)", stdout)
if m:
return { 'got_revision': int(m.groups()[0]) }
return { 'failed_to_parse': stdout }
ret.addStep(
SetProperty(
command=["unpacked\\bin\\drmemory", "-version"],
extract_fn=get_revision,
name="Get the revision number",
description="get revision",
descriptionDone="get revision"))
# VP8 tests
ret.addStep(
DrMemoryTest(command=[
"bash",
"E:\\vpx\\vp8-test-vectors\\run_tests.sh",
("--exec=unpacked/bin/drmemory.exe -batch "
"-no_check_leaks -no_count_leaks "
"-no_check_uninitialized "
"e:/vpx/b/Win32/Debug/vpxdec.exe"),
"E:\\vpx\\vp8-test-vectors",
],
env={'PATH': "C:\\cygwin\\bin;%PATH%"},
name="VP8 tests",
descriptionDone="VP8 tests",
description="run vp8 tests"))
# Chromium tests
for test in ['googleurl', 'printing', 'media', 'sql', 'crypto', 'remoting',
'ipc', 'base', 'net', 'unit']:
ret.addStep(
Test(command=[
"E:\\chromium\\src\\tools\\valgrind\\chrome_tests.bat",
"-t", test, "--tool", "drmemory_light", "--keep_logs",
],
env={'DRMEMORY_COMMAND': 'unpacked/bin/drmemory.exe'},
name=("Chromium '%s' tests" % test),
descriptionDone=("'%s' tests" % test),
description=("run '%s' tests" % test)))
def isWeeklyRun(step):
# No hasProperty, so we have to test for a lookup exception.
try:
step.getProperty("is_weekly")
except KeyError:
return False
return True
ret.addStep(ShellCommand(command="shutdown -t 2 -r -f",
name="reboot",
description="reboot",
descriptionDone="reboot",
doStepIf=isWeeklyRun))
return ret
c['builders'].append(
BuilderConfig(name="win7-stab",
slavename=STABBOT,
factory=CreateWinStabFactory(),
builddir="win7_stab_checkout"))
def CreateLinuxChromeFactory():
ret = factory.BuildFactory()
ret.addStep(
SVN(
svnurl=dr_svnurl,
workdir="dynamorio",
mode="update",
name="Checkout DynamoRIO"))
# If we need to execute 32-bit children, we'll need a full exports package.
ret.addStep(
Compile(
command=["cmake", "..", "-DDEBUG=OFF"],
workdir="dynamorio/build",
name="Configure release DynamoRIO"))
ret.addStep(
Compile(
command=["make", "-j5"],
workdir="dynamorio/build",
name="Compile release DynamoRIO"))
test = "DRT"
ret.addStep(
Test(command=" ".join([
"xvfb-run", "-a",
"./dynamorio/build/bin64/drrun",
"./chromium/src/out/Release/DumpRenderTree",
"file:///home/chrome-bot/bb.html",
">drt_out",
"&&",
"md5sum", "-c", "/home/chrome-bot/bb.html.md5"
]),
name=("Chromium '%s' tests" % test),
workdir=".",
descriptionDone=("'%s' tests" % test),
description=("run '%s' tests" % test)))
# Chromium tests
for test in ['googleurl', 'printing', 'sql', 'crypto', 'remoting',
'ipc', 'media', 'base', 'browser', 'net', 'unit']:
if test in ('ipc', 'unit', 'browser'):
binary = test + "_tests"
else:
binary = test + "_unittests"
cmd = [
"xvfb-run", "-a",
"./dynamorio/build/bin64/drrun",
"./chromium/src/out/Release/%s" % binary
]
if test == 'browser':
cmd += ['--gtest_filter=AutofillTest.BasicFormFill']
elif test == 'net':
cmd += ['--gtest_filter=-CertDatabaseNSSTest.ImportCACertHierarchy*']
ret.addStep(
Test(command=cmd,
name=("Chromium '%s' tests" % test),
workdir=".",
descriptionDone=("'%s' tests" % test),
description=("run '%s' tests" % test)))
return ret
c['builders'].append(
BuilderConfig(name="linux-cr",
slavename="linux_lucid_x64_bot",
factory=CreateLinuxChromeFactory(),
builddir="linux_lucid_x64_chromium_checkout"))
####### STATUS TARGETS
# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
# including web pages, email senders, and IRC bots.
c['status'] = []
# Use allowForce=True (boolean, not a string. ie: not 'True') to allow
# Forcing Builds in the Web User Interface. The default is False.
# from buildbot.status import html
# c['status'].append(html.WebStatus(http_port=8010,allowForce=True))
from buildbot.status import html
c['status'].append(html.WebStatus(http_port=9010,allowForce=False))
c['status'].append(html.WebStatus(http_port=9011,allowForce=True))
from buildbot.status.mail import MailNotifier
c['status'].append(MailNotifier(fromaddr="[email protected]",
lookup="gmail.com", # add @gmail.com if "@" is not in the commiter's ID
extraRecipients=['[email protected]'],
builders=STABLE_BUILDERS,
mode='problem'))
####### DEBUGGING OPTIONS
# if you set 'debugPassword', then you can connect to the buildmaster with
# the diagnostic tool in contrib/debugclient.py . From this tool, you can
# manually force builds and inject changes, which may be useful for testing
# your buildmaster without actually committing changes to your repository (or
# before you have a functioning 'sources' set up). The debug tool uses the
# same port number as the slaves do: 'slavePortnum'.
#c['debugPassword'] = "debugpassword"
# if you set 'manhole', you can ssh into the buildmaster and get an
# interactive python shell, which may be useful for debugging buildbot
# internals. It is probably only useful for buildbot developers. You can also
# use an authorized_keys file, or plain telnet.
#from buildbot import manhole
#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1",
# "admin", "password")
####### PROJECT IDENTITY
# the 'projectName' string will be used to describe the project that this
# buildbot is working on. For example, it is used as the title of the
# waterfall HTML page. The 'projectURL' string will be used to provide a link
# from buildbot HTML pages to your project's home page.
c['projectName'] = "Dr. Memory"
c['projectURL'] = "http://code.google.com/p/drmemory/"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.Waterfall page) is visible. This
# typically uses the port number set in the Waterfall 'status' entry, but
# with an externally-visible host name which the buildbot cannot figure out
# without some help.
c['buildbotURL'] = "http://build.chromium.org/p/client.drmemory/"
# vim: filetype=python