Skip to content

stdout and stderr not compatible with Jenkins #59

Closed

Description

@pytestbot

Originally reported by: Anonymous


When using the junitxml flag, it outputs all the traceback, stderr and stdout into Jenkins' stacktrace. The stderr and stdout should be put into and respectively instead of everything in . This will make the xml output more compatible with Jenkins and plugins.


Activity

  1. pytestbot commented on Jul 6, 2011

    @pytestbot
    ContributorAuthor

    Original comment by Brian O'Neill (BitBucket: sfbrian, GitHub: sfbrian):


    This is who reported the bug in case you have more questions.

  2. pytestbot commented on Jul 8, 2011

    @pytestbot
    ContributorAuthor

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


    i see.

    curious, can you point to a Jenkins page that makes use of system-out/system-err?

  3. pytestbot commented on Jul 11, 2011

    @pytestbot
    ContributorAuthor

    Original comment by Brian O'Neill (BitBucket: sfbrian, GitHub: sfbrian):


    Here is an example of Jenkins using stdout. We made a hack to put all the stdout and stderr into Jenkins' stdout to get a quick fix: https://skitch.com/boneill428/fj8q2/stdout

    Our hack was:

    sed -i -e 's###g'
    -e 's#------------------------------- Captured stdout --------------------------------##g'
    results.xml

  4. pytestbot commented on Jul 12, 2011

    @pytestbot
    ContributorAuthor

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


    fix #59: provide better Jenkins stdout and stderr sections

  5. pytestbot commented on Jul 12, 2011

    @pytestbot
    ContributorAuthor

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


    could you verify it works for you by installing:

    pip install -i http://pypi.testrun.org -U pytest

    ? should give you pytest-2.1.1.dev2 at least (see py.test -v) and better xml files. I wasn't 100% sure how the xml format looks like - if there are issues, please provide an exmaple xml file.

    thanks,
    holger

  6. pytestbot commented on Jul 12, 2011

    @pytestbot
    ContributorAuthor

    Original comment by Brian O'Neill (BitBucket: sfbrian, GitHub: sfbrian):


    Thanks for the fix Holger. One minor change is needed. The format should be:
    {{{

    _Traceback_

    **_System Out**_ **_System Error**_

    }}}

    Currently the format is wrapped in the failure tag instead at the same level as failure:
    {{{

    **_Trackback**_ **_System Out**_
    <system-err>
    ***System Error***
    </system-err>
    
    }}}

    Example:

    {{{
    self = <general.GeneralTest testMethod=test_help_page>

    def test_help_page(self):
        self.navigate_to_help_page()
    

    > exit()

    general.py:84:


    self = Use exit() or Ctrl-D (i.e. EOF) to exit, code = None

    def __call__(self, code=None):
        # Shells like IDLE catch the SystemExit, but listen when their
        # stdin wrapper is closed.
        try:
            sys.stdin.close()
        except:
            pass
    

    > raise SystemExit(code)
    E SystemExit: None

    /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.py:334: SystemExit
    SauceOnDemandSessionID=null job-name=foo

    2011-07-12 15:20:49,608 - logger - INFO - Sauce Labs Video: https://saucelabs.com/jobs/null
    2011-07-12 15:20:49,608 - logger - INFO - test_help_page Started
    2011-07-12 15:20:53,392 - logger - INFO - test_help_page Finished

    }}}

  7. pytestbot commented on Jul 13, 2011

    @pytestbot
    ContributorAuthor

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


    thanks, i think i fixed it. See "pip install -i http://pypi.testrun.org -U pytest" (version dev3 now)

  8. pytestbot commented on Jul 13, 2011

    @pytestbot
    ContributorAuthor

    Original comment by Brian O'Neill (BitBucket: sfbrian, GitHub: sfbrian):


    Looks great! Thanks for the fix. You rock!

  9. added
    type: enhancementnew feature or API change, should be merged into features branch
    on Jun 15, 2015
  10. added 2 commits that reference this issue on Oct 27, 2018
    a970a20
    584d51a
  11. added a commit that references this issue on May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions