1. holger krekel
  2. py-trunk
Issue #136 new

1.3.4: INTERNALERROR - junit plugin - IOError: [Errno 2] No such file or directory

Sridhar Ratnakumar
created an issue

I am running py.test with junit xml enabled (for Hudson and toxbootstrap). This used to pass until today, when the Hudson job failed for all combinations with the following internal error:

{{{ [TOX] /tmp/workspace/applib/TOXENV/py26/label/linux32$ .tox/py26/bin/py.test -x -v applib/test/all.py --junitxml=tmp/testreport.xml ============================= test session starts ============================== platform linux2 -- Python 2.6.6 -- pytest-1.3.4 -- /tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/bin/python2.6 test path 1: applib/test/all.py

applib/test/all.py:8: test_import PASS applib/test/all.py:17: test_console_width_detection PASS applib/test/all.py:22: test_colprint PASS applib/test/all.py:38: test_compression_ensure_read_access['u-x on dirs'] PASS applib/test/all.py:38: test_compression_ensure_read_access['u-w on .setup.py'] PASS INTERNALERROR> self = <py._test.session.Session object at 0xb79631cc> INTERNALERROR> colitems = [<Module 'all.py'>] INTERNALERROR> INTERNALERROR> def main(self, colitems): INTERNALERROR> """ main loop for running tests. """ INTERNALERROR> self.shouldstop = False INTERNALERROR> self.sessionstarts() INTERNALERROR> exitstatus = EXIT_OK INTERNALERROR> try: INTERNALERROR> self._mainloop(colitems) INTERNALERROR> if self._testsfailed: INTERNALERROR> exitstatus = EXIT_TESTSFAILED INTERNALERROR> > self.sessionfinishes(exitstatus=exitstatus) INTERNALERROR> INTERNALERROR> colitems = [<Module 'all.py'>] INTERNALERROR> exitstatus = 0 INTERNALERROR> self = <py._test.session.Session object at 0xb79631cc> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_test/session.py:116: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> self = <py._test.session.Session object at 0xb79631cc>, exitstatus = 0 INTERNALERROR> INTERNALERROR> def sessionfinishes(self, exitstatus): INTERNALERROR> """ teardown any resources after a test run. """ INTERNALERROR> self.config.hook.pytest_sessionfinish( INTERNALERROR> session=self, INTERNALERROR> > exitstatus=exitstatus, INTERNALERROR> INTERNALERROR> exitstatus = 0 INTERNALERROR> self = <py._test.session.Session object at 0xb79631cc> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_test/session.py:104: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> self = <HookCaller 'pytest_sessionfinish'> INTERNALERROR> INTERNALERROR> def call(self, kwargs): INTERNALERROR> methods = self.hookrelay.registry.listattr(self.name) INTERNALERROR> mc = MultiCall(methods, kwargs, firstresult=self.firstresult) INTERNALERROR> > return self.hookrelay._performcall(self.name, mc) INTERNALERROR> INTERNALERROR> kwargs = {'exitstatus': 0, 'session': <py._test.session.Session object at 0xb79631cc>} INTERNALERROR> mc = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> methods = [<function pytest_sessionfinish at 0xb7bb84c4>, <bound method LogXML.pytest_sessionfinish of <py._plugin.pytest_junitx... method TerminalReporter.pytest_sessionfinish of <py._plugin.pytest_terminal.TerminalReporter instance at 0xb79f8e8c>>] INTERNALERROR> self = <HookCaller 'pytest_sessionfinish'> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py:349: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> self = <py._test.pluginmanager.HookRelay instance at 0xb7b9732c> INTERNALERROR> name = 'pytest_sessionfinish' INTERNALERROR> multicall = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> INTERNALERROR> def _performcall(self, name, multicall): INTERNALERROR> > return multicall.execute() INTERNALERROR> INTERNALERROR> multicall = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> name = 'pytest_sessionfinish' INTERNALERROR> self = <py._test.pluginmanager.HookRelay instance at 0xb7b9732c> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py:335: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> self = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> INTERNALERROR> def execute(self): INTERNALERROR> while self.methods: INTERNALERROR> method = self.methods.pop() INTERNALERROR> kwargs = self.getkwargs(method) INTERNALERROR> > res = method(kwargs) INTERNALERROR> INTERNALERROR> kwargs = {'multicall': <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}>, 'exitstatus': 0} INTERNALERROR> method = <bound method TerminalReporter.pytest_sessionfinish of <py._plugin.pytest_terminal.TerminalReporter instance at 0xb79f8e8c>> INTERNALERROR> self = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py:244: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> self = <py._plugin.pytest_terminal.TerminalReporter instance at 0xb79f8e8c> INTERNALERROR> exitstatus = 0 INTERNALERROR> multicall = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> INTERNALERROR> def pytest_sessionfinish(self, exitstatus, multicall): INTERNALERROR> > multicall.execute() INTERNALERROR> INTERNALERROR> multicall = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> exitstatus = 0 INTERNALERROR> self = <py._plugin.pytest_terminal.TerminalReporter instance at 0xb79f8e8c> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_plugin/pytest_terminal.py:239: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> self = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> INTERNALERROR> def execute(self): INTERNALERROR> while self.methods: INTERNALERROR> method = self.methods.pop() INTERNALERROR> kwargs = self.getkwargs(method) INTERNALERROR> > res = method(kwargs) INTERNALERROR> INTERNALERROR> kwargs = {'__multicall__': <MultiCall 0 results, 1 meths, kwargs={'__multicall__': <MultiCall 0 results, 1 meths, kwargs={...}>... object at 0xb79631cc>, 'exitstatus': 0}>, 'exitstatus': 0, 'session': <py.test.session.Session object at 0xb79631cc>} INTERNALERROR> method = <bound method LogXML.pytest_sessionfinish of <py._plugin.pytest_junitxml.LogXML object at 0xb79f866c>> INTERNALERROR> self = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py:244: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> self = <py._plugin.pytest_junitxml.LogXML object at 0xb79f866c> INTERNALERROR> session = <py._test.session.Session object at 0xb79631cc>, exitstatus = 0 INTERNALERROR> multicall = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> INTERNALERROR> def pytest_sessionfinish(self, session, exitstatus, multicall): INTERNALERROR> if py.std.sys.version_info[0] < 3: INTERNALERROR> > logfile = py.std.codecs.open(self.logfile, 'w', encoding='utf-8') INTERNALERROR> INTERNALERROR> multicall = <MultiCall 0 results, 1 meths, kwargs={'multicall': <MultiCall 0 results, 1 meths, kwargs={...}>, 'session': <py._test.session.Session object at 0xb79631cc>, 'exitstatus': 0}> INTERNALERROR> exitstatus = 0 INTERNALERROR> self = <py._plugin.pytest_junitxml.LogXML object at 0xb79f866c> INTERNALERROR> session = <py._test.session.Session object at 0xb79631cc> INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/site-packages/py/_plugin/pytest_junitxml.py:151: INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ INTERNALERROR> INTERNALERROR> filename = 'tmp/testreport.xml', mode = 'wb', encoding = 'utf-8' INTERNALERROR> errors = 'strict', buffering = 1 INTERNALERROR> INTERNALERROR> def open(filename, mode='rb', encoding=None, errors='strict', buffering=1): INTERNALERROR>
INTERNALERROR> """ Open an encoded file using the given mode and return INTERNALERROR> a wrapped version providing transparent encoding/decoding. INTERNALERROR>
INTERNALERROR> Note: The wrapped version will only accept the object format INTERNALERROR> defined by the codecs, i.e. Unicode objects for most builtin INTERNALERROR> codecs. Output is also codec dependent and will usually be INTERNALERROR> Unicode as well. INTERNALERROR>
INTERNALERROR> Files are always opened in binary mode, even if no binary mode INTERNALERROR> was specified. This is done to avoid data loss due to encodings INTERNALERROR> using 8-bit values. The default file mode is 'rb' meaning to INTERNALERROR> open the file in binary read mode. INTERNALERROR>
INTERNALERROR> encoding specifies the encoding which is to be used for the INTERNALERROR> file. INTERNALERROR>
INTERNALERROR> errors may be given to define the error handling. It defaults INTERNALERROR> to 'strict' which causes ValueErrors to be raised in case an INTERNALERROR> encoding error occurs. INTERNALERROR>
INTERNALERROR> buffering has the same meaning as for the builtin open() API. INTERNALERROR> It defaults to line buffered. INTERNALERROR>
INTERNALERROR> The returned wrapped file object provides an extra attribute INTERNALERROR> .encoding which allows querying the used encoding. This INTERNALERROR> attribute is only available if an encoding was specified as INTERNALERROR> parameter. INTERNALERROR>
INTERNALERROR> """ INTERNALERROR> if encoding is not None: INTERNALERROR> if 'U' in mode: INTERNALERROR> # No automatic conversion of '\n' is done on reading and writing INTERNALERROR> mode = mode.strip().replace('U', '') INTERNALERROR> if mode[:1] not in set('rwa'): INTERNALERROR> mode = 'r' + mode INTERNALERROR> if 'b' not in mode: INTERNALERROR> # Force opening of the file in binary mode INTERNALERROR> mode = mode + 'b' INTERNALERROR> > file = builtin.open(filename, mode, buffering) INTERNALERROR> E IOError: [Errno 2] No such file or directory: 'tmp/testreport.xml' INTERNALERROR> INTERNALERROR> buffering = 1 INTERNALERROR> encoding = 'utf-8' INTERNALERROR> errors = 'strict' INTERNALERROR> filename = 'tmp/testreport.xml' INTERNALERROR> mode = 'wb' INTERNALERROR> INTERNALERROR> .tox/py26/lib/python2.6/codecs.py:881: IOError Traceback (most recent call last): File ".tox/py26/bin/py.test", line 9, in <module> load_entry_point('py==1.3.4', 'console_scripts', 'py.test')() File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_cmdline/pytest.py", line 5, in main raise SystemExit(py.test.cmdline.main(args)) File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_test/cmdline.py", line 17, in main exitstatus = session.main(colitems) File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_test/session.py", line 126, in main self.sessionfinishes(exitstatus=exitstatus) File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_test/session.py", line 104, in sessionfinishes exitstatus=exitstatus, File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py", line 349, in call return self.hookrelay._performcall(self.name, mc) File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py", line 335, in _performcall return multicall.execute() File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py", line 244, in execute res = method(
kwargs) File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_plugin/pytest_terminal.py", line 239, in pytest_sessionfinish multicall.execute() File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_test/pluginmanager.py", line 244, in execute res = method(**kwargs) File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/site-packages/py/_plugin/pytest_junitxml.py", line 151, in pytest_sessionfinish logfile = py.std.codecs.open(self.logfile, 'w', encoding='utf-8') File "/tmp/workspace/applib/TOXENV/py26/label/linux32/.tox/py26/lib/python2.6/codecs.py", line 881, in open file = builtin.open(filename, mode, buffering) IOError: [Errno 2] No such file or directory: 'tmp/testreport.xml' _____ [tox summary] ______ [TOX] ERROR: py26: commands failed ERROR:root:tox exited with error code 1 }}}

Let me know if you need any more information. The project being tested is available here with tox configuration: https://github.com/ActiveState/applib. Hudson Python script is: {{{ import sys sys.path.insert(0, '.')

import toxbootstrap toxbootstrap.cmdline() }}}

Comments (2)

  1. holger krekel repo owner

    can you try to specify an absolute path name to the junitxml option and see if it works again?

    (this may be caused by toxbootstrap changing directories differently than before, maybe)

  2. holger krekel repo owner

    can you try to specify an absolute path name to the junitxml option and see if it works again?

    (this may be caused by toxbootstrap changing directories differently than before, maybe)

  3. Log in to comment