--- a/lib/python/kickoff/sanity.py
+++ b/lib/python/kickoff/sanity.py
@@ -154,38 +154,39 @@ class ReleaseSanitizerTestSuite(OpsMixin
def test_versions_repo_and_revision_check(self, result):
"""test_versions method
Tests if the indicated branch and revision repo exists
"""
log.info("Testing repo and revision in tree ...")
try:
make_hg_get_request(self.repo_path, self.revision).strip()
- except requests.HTTPError:
- err_msg = "{path} repo does not exist with {rev} revision".format(
- path=self.repo_path, rev=self.revision)
+ except requests.HTTPError as err:
+ err_msg = "{path} repo does not exist with {rev} revision. URL: {url}".format(
+ path=self.repo_path, rev=self.revision, url=err.request.url)
result.add_error(err_msg, sys.exc_info())
def test_versions_display_validation_in_tree(self, result):
"""test_versions method
Tests if the upstream display version exists and if it is the same
with the current one coming from release runner
"""
log.info("Testing version display validation in tree ...")
# esr-hack: ensure trimming the suffix before comparing
version = self.version.replace("esr", "")
try:
display_version = make_hg_get_request(self.repo_path, self.revision,
filename=VERSION_DISPLAY_CONFIG_URI).strip()
- except requests.HTTPError:
- err_msg = ("display version config file not found in {path} under"
- "{rev} revision").format(
+ except requests.HTTPError as err:
+ err_msg = ("display_version config file not found in {path} under"
+ " {rev} revision. URL: {url}").format(
path=self.repo_path,
- rev=self.revision)
+ rev=self.revision,
+ url=err.request.url)
result.add_error(err_msg, sys.exc_info())
return
err_msg = ("In-tree display version {tree_version} doesn't "
"match ship-it version {version}").format(
tree_version=display_version, version=version)
self.assertEqual(result, version, display_version, err_msg)
@@ -241,36 +242,38 @@ class ReleaseSanitizerTestSuite(OpsMixin
build_number=buildno)
candidate_sha = grab_partial_sha(_url)
# make sure partial has a shipped release under /releases
_url = RELEASES_SHA512_URL_TEMPLATE.format(version=pversion)
releases_sha = grab_partial_sha(_url)
err_msg = ("{version}-build{build_number} is a good candidate"
- " build but not the one we shipped!").format(
+ " build, but not the one we shipped! URL: {url}").format(
version=pversion,
- build_number=buildno)
+ build_number=buildno,
+ url=_url)
self.assertEqual(result, releases_sha, candidate_sha, err_msg)
def test_l10n_shipped_locales(self, result):
"""test_l10n method
Tests if the current locales coming from release runner are in fact
the same as the shipped locales.
"""
log.info("Testing l10n shipped locales ...")
try:
# TODO: mind that we will need something similar for Fennec
ret = make_hg_get_request(self.repo_path, self.revision,
filename=SHIPPED_LOCALES_CONFIG_URI).strip()
- except requests.HTTPError:
+ except requests.HTTPError as err:
err_msg = ("Shipped locale file not found in {path} repo under rev"
- "{revision}").format(
+ " {revision}. URL: {url}").format(
path=self.repo_path,
- revision=self.revision)
+ revision=self.revision,
+ url=err.request.url)
result.add_error(err_msg, sys.exc_info())
return
shipped_l10n = set([l.split()[0] for l in ret.splitlines()])
current_l10n = set(self.locales.keys())
err_msg = "Current l10n changesets and shipped locales differ!"
# we have en-US in shipped locales, but not in l10n changesets, because
@@ -289,22 +292,23 @@ class ReleaseSanitizerTestSuite(OpsMixin
to query that particular l10n release url, the single locale
config file from mozharness is grabbed first.
"""
log.info("Testing current l10n changesets ...")
try:
ret = get_single_locale_config(self.repo_path,
self.revision,
self.branch).strip()
- except requests.HTTPError:
+ except requests.HTTPError as err:
err_msg = ("Failed to retrieve single locale config file for"
- "{path}, revision {rev}, {branch} branch").format(
+ " {path}, revision {rev}. URL: {url}").format(
path=self.repo_path,
rev=self.revision,
- branch=self.branch)
+ branch=self.branch,
+ url=err.request.url)
result.add_error(err_msg, sys.exc_info())
return
locals_dict = dict()
exec(ret, {}, locals_dict)
single_locale_config = locals_dict.get('config')
for locale in sorted(self.locales.keys()):
@@ -313,36 +317,37 @@ class ReleaseSanitizerTestSuite(OpsMixin
hg_l10n_base=single_locale_config["hg_l10n_base"].strip('/'),
locale=locale,
revision=revision
)
try:
make_generic_head_request(locale_url)
except requests.HTTPError:
- err_msg = "{locale} not found".format(locale=locale_url)
+ err_msg = "Locale {locale} not found".format(locale=locale_url)
result.add_error(err_msg, sys.exc_info())
def test_l10n_dashboard(self, result):
"""test_l10n method
Tests if l10n dashboard changesets match the current l10n changesets
"""
log.info("Testing l10n dashboard changesets ...")
if not self.kwargs["dashboard_check"]:
log.info("Skipping l10n dashboard check")
return
try:
dash_changesets = get_l10_dashboard_changeset(self.version,
self.product)
- except requests.HTTPError:
+ except requests.HTTPError as err:
err_msg = ("Failed to retrieve l10n dashboard changes for"
- "{product} product, version {version}").format(
+ " {product} product, version {version}. URL: {url}").format(
product=self.product,
- version=self.version)
+ version=self.version,
+ url=err.request.url)
result.add_error(err_msg, sys.exc_info())
return
err_msg = ("Current ship-it changesets are not the same as the l10n"
" dashboard changesets")
self.assertEqual(result, self.locales, dash_changesets, err_msg)