Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOError when writing --junitxml report #466

Closed
pytestbot opened this issue Feb 20, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@pytestbot
Copy link

commented Feb 20, 2014

Originally reported by: Steven R (BitBucket: Iodine, GitHub: Iodine)


#!python


Traceback (most recent call last):
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\pytest.py", line 10, in <module>
    raise SystemExit(pytest.main())
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\config.py", line 19, in main
    exitstatus = config.hook.pytest_cmdline_main(config=config)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\core.py", line 368, in __call__
    return self._docall(methods, kwargs)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\core.py", line 379, in _docall
    res = mc.execute()
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\core.py", line 297, in execute
    res = method(**kwargs)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\main.py", line 111, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\main.py", line 104, in wrap_session
    exitstatus=session.exitstatus)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\core.py", line 368, in __call__
    return self._docall(methods, kwargs)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\core.py", line 379, in _docall
    res = mc.execute()
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\core.py", line 297, in execute
    res = method(**kwargs)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\terminal.py", line 325, in pytest_sessionfinish
    __multicall__.execute()
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\core.py", line 297, in execute
    res = method(**kwargs)
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\site-packages\pytest-2.4.2-py2.7.egg\_pytest\junitxml.py", line 209, in pytest_sessionfinish
    logfile = py.std.codecs.open(self.logfile, 'w', encoding='utf-8')
  File "C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\tools\win32\python\275\lib\codecs.py", line 881, in open
    file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory:  'C:\\Jenkins\\workspace\\Test-Stress-ServerRegression\\Logs\\project_stress_test_results.xml'

@pytestbot

This comment has been minimized.

Copy link
Author

commented Mar 26, 2014

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


how is py.test invoked?

@pytestbot

This comment has been minimized.

Copy link
Author

commented Mar 26, 2014

Original comment by Steven R (BitBucket: Iodine, GitHub: Iodine):


C:\Jenkins\workspace\Test-Stress-ServerRegression\sw\gcomp\dev\src\regression>python -m pytest regression_test.py --junitxml C:\Jenkins\workspace\Test-Stress-ServerRegression\Logs\regression_test_results_18135974.0.xml

@pytestbot

This comment has been minimized.

Copy link
Author

commented Apr 2, 2014

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


Please retry with pytest-2.5.2 - we had a couple of fixes between 2.4.2 and 2.5.2 related to junitxml.

@pytestbot pytestbot added the type: bug label Jun 15, 2015

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

commented Jul 25, 2015

@lodine is this still an issue,

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Jul 28, 2015

I think so, now the directory is automatically created if needed:

    def pytest_sessionfinish(self):
        dirname = os.path.dirname(os.path.abspath(self.logfile))
        if not os.path.isdir(dirname):
            os.makedirs(dirname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.