From 62c8a8f6483e948324e6971d3abd318751f0bbca Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Thu, 5 Jan 2023 01:38:59 +0000 Subject: [PATCH] Bug 1808609 - Improve error message in 'test_site_compatibility.py', r=ahochheiden This should make it a little easier to understand what's happening. Differential Revision: https://phabricator.services.mozilla.com/D165998 --- .../mach/mach/test/test_site_compatibility.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/python/mach/mach/test/test_site_compatibility.py b/python/mach/mach/test/test_site_compatibility.py index dcb23f440addf..25ae16280f14e 100644 --- a/python/mach/mach/test/test_site_compatibility.py +++ b/python/mach/mach/test/test_site_compatibility.py @@ -6,6 +6,7 @@ import subprocess import sys from pathlib import Path +from textwrap import dedent import mozunit from buildconfig import topsrcdir @@ -154,7 +155,7 @@ def test_sites_compatible(tmpdir: str): # Attempt to install combined set of dependencies (global Mach + current # command) - subprocess.check_call( + proc = subprocess.run( [ virtualenv.python_path, "-m", @@ -165,6 +166,20 @@ def test_sites_compatible(tmpdir: str): ], cwd=topsrcdir, ) + if proc.returncode != 0: + print( + dedent( + f""" + Error: The '{name}' site contains dependencies that are not + compatible with the 'mach' site. Check the following files for + any conflicting packages mentioned in the prior error message: + + python/sites/mach.txt + python/sites/{name}.txt + """ + ) + ) + assert False if __name__ == "__main__":