2017-06-28 16:20:15 +03:00
|
|
|
#!/usr/bin/env python2
|
|
|
|
|
2016-11-08 15:09:16 +03:00
|
|
|
import sys
|
|
|
|
sys.path.append("../slave")
|
|
|
|
|
|
|
|
import url_creator
|
|
|
|
|
2017-08-18 18:56:58 +03:00
|
|
|
BUILDTYPES = ('debug', 'nightly', 'opt', 'pgo')
|
|
|
|
|
2017-06-29 19:22:27 +03:00
|
|
|
PLATFORMS = [
|
2017-06-28 17:42:03 +03:00
|
|
|
"Windows",
|
|
|
|
"Linux",
|
|
|
|
"Darwin"
|
|
|
|
]
|
|
|
|
|
2017-06-29 19:22:27 +03:00
|
|
|
REPOS = [
|
2017-06-28 16:20:15 +03:00
|
|
|
"mozilla-inbound",
|
2017-08-24 13:01:25 +03:00
|
|
|
"mozilla-autoland",
|
2017-06-28 16:20:15 +03:00
|
|
|
"mozilla-central",
|
2017-06-28 17:42:03 +03:00
|
|
|
"mozilla-beta",
|
|
|
|
"mozilla-release",
|
2017-06-28 16:20:15 +03:00
|
|
|
"chrome",
|
2017-06-28 17:42:03 +03:00
|
|
|
"webkit"
|
2017-06-28 16:20:15 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
archs = [
|
|
|
|
'32bits',
|
|
|
|
'64bits'
|
2016-11-08 15:09:16 +03:00
|
|
|
]
|
|
|
|
|
2017-06-28 17:42:03 +03:00
|
|
|
KNOWN_FAILURES = [
|
|
|
|
('Darwin', 'mozilla-release', '64bits') # 403 unauthorized
|
|
|
|
]
|
|
|
|
|
2017-08-18 18:56:58 +03:00
|
|
|
def skip(platform, repo, arch, buildtype):
|
2017-06-28 17:42:03 +03:00
|
|
|
"""
|
|
|
|
Returns true if a configuration (triplet of platform/repo/arch) must be
|
|
|
|
skipped, false otherwise.
|
|
|
|
"""
|
2017-08-18 18:56:58 +03:00
|
|
|
if (platform == 'Darwin' and arch != '64bits') or \
|
|
|
|
(platform == 'Darwin' and buildtype == 'pgo') or \
|
|
|
|
(platform == 'Windows' and 'release' in repo and buildtype == 'nightly') or \
|
|
|
|
(repo != 'mozilla-central' and buildtype == 'nightly'):
|
2017-06-28 17:42:03 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
if repo == 'webkit' and platform != 'Darwin':
|
|
|
|
return True
|
|
|
|
|
|
|
|
for fplatform, frepo, farch in KNOWN_FAILURES:
|
|
|
|
if platform == fplatform and repo == frepo and arch == farch:
|
|
|
|
print "(skipping known failure {} {} {})".format(platform, repo, arch)
|
|
|
|
return True
|
|
|
|
|
|
|
|
return False
|
2017-06-28 16:20:15 +03:00
|
|
|
|
2017-06-29 19:22:27 +03:00
|
|
|
|
2017-08-18 18:56:58 +03:00
|
|
|
def test_configuration(repo, platform, arch=None, buildtype=None, cset='latest'):
|
|
|
|
if skip(platform, repo, arch, buildtype):
|
|
|
|
return []
|
|
|
|
|
|
|
|
print("Testing download for (repo={},platform={},arch={},buildtype={},cset={})".format(
|
|
|
|
repo,
|
|
|
|
platform,
|
|
|
|
arch,
|
|
|
|
buildtype,
|
|
|
|
cset))
|
2017-06-29 19:22:27 +03:00
|
|
|
try:
|
2017-08-18 18:56:58 +03:00
|
|
|
assert platform in PLATFORMS
|
2017-08-21 16:40:55 +03:00
|
|
|
urls = url_creator.get(arch, repo, platform).find(cset, buildtype=buildtype)
|
2017-06-29 19:22:27 +03:00
|
|
|
assert len(urls) > 0
|
|
|
|
print "PASSED\n"
|
|
|
|
return []
|
|
|
|
except:
|
|
|
|
print "FAILED\n"
|
2017-08-18 18:56:58 +03:00
|
|
|
return [(repo, platform, arch, buildtype, cset)]
|
2017-06-29 19:22:27 +03:00
|
|
|
|
|
|
|
|
2017-06-28 20:28:27 +03:00
|
|
|
def main():
|
|
|
|
failures = []
|
|
|
|
|
2017-06-29 19:22:27 +03:00
|
|
|
for repo in REPOS:
|
|
|
|
for platform in PLATFORMS:
|
2017-06-28 20:28:27 +03:00
|
|
|
for arch in archs:
|
2017-08-18 18:56:58 +03:00
|
|
|
for bt in BUILDTYPES:
|
|
|
|
failures += test_configuration(repo, platform, arch, bt)
|
|
|
|
|
|
|
|
# The artifacts of this revision will expire after 2018-08-18
|
|
|
|
cset = "952c576fdcd6cc3e0b0b452ac247b0aeaf097646"
|
|
|
|
for p in PLATFORMS:
|
|
|
|
for arch in archs:
|
|
|
|
failures += test_configuration('mozilla-inbound', p, arch, 'pgo', cset)
|
2017-06-28 20:28:27 +03:00
|
|
|
|
|
|
|
if len(failures) > 0:
|
|
|
|
print "FAILURES:"
|
2017-08-18 18:56:58 +03:00
|
|
|
for f in failures:
|
|
|
|
print f
|
2017-06-28 20:28:27 +03:00
|
|
|
exit(1)
|
|
|
|
else:
|
|
|
|
exit(0)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|