~/src/lakitu2/src/third_party/autotest/files (split ✔) ᐅ ./bin/test_lucifer
========================================================================== test session starts ===========================================================================
platform linux2 -- Python 2.7.13, pytest-3.1.3, py-1.4.34, pluggy-0.4.0
rootdir: /usr/local/google/home/wonderfly/src/lakitu2/src/third_party/autotest/files/venv, inifile: pytest.ini
plugins: cov-2.5.1, catchlog-1.2.2
collected 26 items
lucifer/autotest_unittest.py F........
lucifer/eventlib_unittest.py .....
lucifer/leasing_unittest.py ..........
lucifer/loglib_unittest.py ..
---------- coverage: platform linux2, python 2.7.13-final-0 ----------
Name Stmts Miss Branch BrPart Cover Missing
--------------------------------------------------------------------------
lucifer/autotest.py 73 12 6 0 85% 66, 92-108, 149-154
lucifer/autotest_unittest.py 32 1 0 0 97% 26
lucifer/cmd/job_aborter.py 78 51 18 0 28% 56-70, 74-82, 98-108, 116-119, 127-130, 137, 146-148, 156-157, 170-171, 184-188, 192, 196, 200
lucifer/cmd/job_reporter.py 97 69 16 0 25% 41-48, 52-80, 88-93, 102-109, 113-114, 119, 136-147, 156-159, 167-190, 194-197, 201, 205
lucifer/handlers.py 204 163 56 0 16% 42-47, 50-57, 61, 64-65, 70-71, 75-76, 80-82, 85-86, 89-90, 93-94, 97-102, 105-109, 112-114, 120-122, 129-150, 153-167, 171-174, 178-179, 187-189, 192-195, 198-204, 212-219, 228-234, 242-254, 258-268, 272-285, 289, 302-314, 319-331, 336-341
lucifer/handoffs.py 44 29 8 0 29% 32-38, 49-59, 63-68, 73-82, 90-94
lucifer/jobx.py 73 50 24 0 24% 35, 43-44, 55, 63, 76-77, 88, 96-97, 118, 123-124, 129-136, 142-155, 164-169, 180-183, 191-202
lucifer/leasing.py 69 4 6 0 95% 135-138
lucifer/results.py 25 15 2 0 37% 24-25, 35-42, 51-52, 57, 62, 67
--------------------------------------------------------------------------
TOTAL 979 394 148 0 54%
12 files skipped due to complete coverage.
======================================================================== slowest 5 test durations ========================================================================
0.51s call lucifer/autotest_unittest.py::test_monkeypatch
0.49s call lucifer/leasing_unittest.py::test_obtain_lease_with_error_removes_files
0.48s call lucifer/leasing_unittest.py::test_Lease__expired
0.36s call lucifer/leasing_unittest.py::test_obtain_lease_succesfully_removes_file
0.32s call lucifer/leasing_unittest.py::test_Job_abort_with_closed_socket
================================================================================ FAILURES ================================================================================
____________________________________________________________________________ test_monkeypatch ____________________________________________________________________________
@pytest.mark.slow
def test_monkeypatch():
"""Test monkeypatch()."""
common_file = subprocess32.check_output(
[sys.executable, '-m',
> 'lucifer.cmd.test.autotest_monkeypatcher'])
lucifer/autotest_unittest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (['/usr/local/google/home/wonderfly/.cache/cros_venv/venv-2.7.13-a234a83456f26d726445fc6c8e6ce271/bin/python', '-m', 'lucifer.cmd.test.autotest_monkeypatcher'],)
kwargs = {}, timeout = None, process = <subprocess32.Popen object at 0x7fba070533d0>, output = '', unused_err = None, retcode = 1
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The arguments are the same as for the Popen constructor. Example:
>>> check_output(["ls", "-l", "/dev/null"])
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c",
... "ls -l non_existent_file ; exit 0"],
... stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
"""
timeout = kwargs.pop('timeout', None)
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = Popen(stdout=PIPE, *popenargs, **kwargs)
try:
output, unused_err = process.communicate(timeout=timeout)
except TimeoutExpired:
process.kill()
output, unused_err = process.communicate()
raise TimeoutExpired(process.args, timeout, output=output)
retcode = process.poll()
if retcode:
> raise CalledProcessError(retcode, process.args, output=output)
E CalledProcessError: Command '['/usr/local/google/home/wonderfly/.cache/cros_venv/venv-2.7.13-a234a83456f26d726445fc6c8e6ce271/bin/python', '-m', 'lucifer.cmd.test.autotest_monkeypatcher']' returned non-zero exit status 1
../../../../../../../.cache/cros_venv/venv-2.7.13-a234a83456f26d726445fc6c8e6ce271/local/lib/python2.7/site-packages/subprocess32.py:638: CalledProcessError
-------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------
autotest_monkeypatcher: 2018-06-04 12:59:57,953:INFO:autotest:_monkeypatch_body:86:Could not find chromite; adding system packages and retrying (This should only happen on Moblab)
autotest_monkeypatcher: 2018-06-04 12:59:58,058:ERROR:autotest:_global_setup:63:Uncaught exception escaped Autotest setup
Traceback (most recent call last):
File "lucifer/autotest.py", line 59, in _global_setup
yield
File "lucifer/autotest.py", line 50, in monkeypatch
_monkeypatch_body()
File "lucifer/autotest.py", line 89, in _monkeypatch_body
importlib.import_module('chromite')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named chromite
================================================================== 1 failed, 25 passed in 3.98 seconds ===================================================================
Comment 1 by ayatane@chromium.org
, Jun 4 2018Owner: ayatane@chromium.org
Status: Assigned (was: Untriaged)