author | Ted Mielczarek <ted@mielczarek.org> |
Tue, 08 Jan 2019 15:14:51 +0000 | |
changeset 452957 | d591851c88240323eedf457c5f58fbc3a2267519 |
parent 452956 | c5f89e53d636d57680224b2f29c76919c207cf18 |
child 452958 | 0eb0c348396bce080ba91a102c23c7e651bad6e2 |
push id | 75654 |
push user | tmielczarek@mozilla.com |
push date | Tue, 08 Jan 2019 19:32:23 +0000 |
treeherder | autoland@d591851c8824 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | sheehan |
bugs | 1517712 |
milestone | 66.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/python/mach/mach/test/test_telemetry.py +++ b/python/mach/mach/test/test_telemetry.py @@ -9,16 +9,23 @@ import subprocess import sys import buildconfig import mozunit import pytest from mozboot.bootstrap import update_or_create_build_telemetry_config +TELEMETRY_LOAD_ERROR = ''' +Error loading telemetry. mach output: +========================================================= +%s +========================================================= +''' + @pytest.fixture def run_mach(tmpdir): """Return a function that runs mach with the provided arguments and then returns a list of the data contained within any telemetry entries generated during the command. """ # Use tmpdir as the mozbuild state path, and enable telemetry in # a machrc there. @@ -27,25 +34,26 @@ def run_mach(tmpdir): env[b'MOZBUILD_STATE_PATH'] = str(tmpdir) env[b'MACH_TELEMETRY_NO_SUBMIT'] = b'1' # Let whatever mach command we invoke from tests believe it's the main command. del env['MACH_MAIN_PID'] mach = os.path.join(buildconfig.topsrcdir, 'mach') def run(*args, **kwargs): # Run mach with the provided arguments - subprocess.check_output([sys.executable, mach] + list(args), - stderr=subprocess.STDOUT, - env=env, - **kwargs) + out = subprocess.check_output([sys.executable, mach] + list(args), + stderr=subprocess.STDOUT, + env=env, + **kwargs) # Load any telemetry data that was written path = tmpdir.join('telemetry', 'outgoing') try: return [json.load(f.open('rb')) for f in path.listdir()] except EnvironmentError: + print(TELEMETRY_LOAD_ERROR % out, file=sys.stderr) for p in path.parts(reverse=True): if not p.check(dir=1): print('Path does not exist: "%s"' % p, file=sys.stderr) raise return run def test_simple(run_mach, tmpdir):