Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/test/test_endpoint_buildDiff.py
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | def test_buildDiff(self): | ||||
"runOnDiff": True, | "runOnDiff": True, | ||||
}, | }, | ||||
}) | }) | ||||
call_buildDiff(builds) | call_buildDiff(builds) | ||||
# With matching file regex | # With matching file regex | ||||
set_build_configuration({ | set_build_configuration({ | ||||
"build-1": { | "build-1": { | ||||
"runOnDiffRegex": "dir/subdir/.*", | "runOnDiffRegex": ["dir/subdir/.*"], | ||||
}, | }, | ||||
}) | }) | ||||
call_buildDiff(builds) | call_buildDiff(builds) | ||||
# With non-matching file regex | # With non-matching file regex | ||||
set_build_configuration({ | set_build_configuration({ | ||||
"build-1": { | "build-1": { | ||||
"runOnDiffRegex": "dir/nonmatching/.*", | "runOnDiffRegex": ["dir/nonmatching/.*"], | ||||
}, | }, | ||||
}) | }) | ||||
call_buildDiff([]) | call_buildDiff([]) | ||||
# Some builds match the file regex | # Some builds match the file regex | ||||
builds.append(Build(1, BuildStatus.Queued, "build-2")) | builds.append(Build(1, BuildStatus.Queued, "build-2")) | ||||
set_build_configuration({ | set_build_configuration({ | ||||
"build-1": { | "build-1": { | ||||
"runOnDiffRegex": "dir/nonmatching/.*", | "runOnDiffRegex": ["dir/nonmatching/.*"], | ||||
}, | }, | ||||
"build-2": { | "build-2": { | ||||
"runOnDiffRegex": "someotherdir/file2.txt", | "runOnDiffRegex": ["someotherdir/file2.txt"], | ||||
}, | }, | ||||
}) | }) | ||||
call_buildDiff([builds[1]]) | call_buildDiff([builds[1]]) | ||||
# Lot of builds | # Lot of builds | ||||
builds = [Build(i, BuildStatus.Queued, "build-{}".format(i)) | builds = [Build(i, BuildStatus.Queued, "build-{}".format(i)) | ||||
for i in range(10)] | for i in range(10)] | ||||
buildConfig = {} | buildConfig = {} | ||||
Show All 10 Lines |