Skip to content

junit xml results #100

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

Closed
pytestbot opened this issue Dec 11, 2011 · 6 comments
Closed

junit xml results #100

pytestbot opened this issue Dec 11, 2011 · 6 comments
Labels
type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: anomt, GitHub: anomt


I thought it would be nicer and better for long-running tests that the junit results won't be written only at the end of the entire test run, but after each test finishes.

I made the changes in
https://bitbucket.org/anomt/pytest-hacks

hope it'll be okay and to get your feedback


@pytestbot
Copy link
Contributor Author

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


as far as i can tell, this patch will rewrite the entire junit output after every test

it would be interesting to change the behaviour from that to only rewriting the values in the header of the file
plus rewriting the tail of the file (replacing the by $nextresult

in order to make the changes in the head possible, something like non-significant whitespace can be used to "preallocate" the bytes that will later filled by more digits

however please wait with those experiments till holger gives a comment

@pytestbot
Copy link
Contributor Author

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


Is there anything apart form "I thought it was nicer" that motivated you to go for streaming XML?
Note that the resultlog plugin and --resultlog=PATH option provides streaming of test progress.
I am closing the issue until some concrete use cases pops up, e.g. a real-life consumer of streaming XML junit data.

@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: anomt, GitHub: anomt:


The problematic use-case was very long tests that run from a ci server that gets aborted in the middle because of a job timeout, the job gets aborted, no junitxml is found (it is written only at the end of a test run), and no results are shown.

I'd like to hear any suggestions.

@pytestbot
Copy link
Contributor Author

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


do you have a traceback from the aborted process and/or can send the console output? Maybe we get a chance to write out the junitxml before the process goes away.

@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: anomt, GitHub: anomt:


Nothing fancy happens, I am using Jenkins as the CI server.

This is a poc Jenkins build, it has two tests, first one succeeds immediately, the second one waits for a long time.
I abort the build, and the xml file is not written.
{{{

  • py.test --junitxml=a.xml
    ============================= test session starts ==============================
    platform linux2 -- Python 2.7.1 -- pytest-2.2.2.dev2
    collecting ... collected 2 items

test_module.py .Build was aborted
Recording test results
No test report files were found. Configuration error?
Finished: ABORTED

}}}

@pytestbot
Copy link
Contributor Author

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


doing this with junitxml itself is a bit fragile and messy

better solutions would be using a streaming format like subunit or xdist/boxed

there are some WIP there

@pytestbot pytestbot added the type: enhancement new feature or API change, should be merged into features branch label Jun 15, 2015
fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
In raw strings, a single backslash means a literal backslash. It is also used to escape quotes if it precedes them. This means it is impossible to change the quote type for strings that contain an unescaped version of the other quote type.
Fixes pytest-dev#100
mgorny pushed a commit to mgorny/pytest that referenced this issue May 27, 2023
----
ci: Test against Python 3.7

----
ci: Skip Coveralls submission if COVERALLS_REPO_TOKEN env. var is empty

----
ci: Update circleci image to allow install of python 3.7
See https://circleci.com/docs/2.0/configuration-reference/#machine

----
pytest-server-fixture: Fix rethinkdb tests requiring rethinkdb < 2.4.0

The current implementation needs to be refactored to support the latest
release of rethinkdb-python package. See pytest-dev#132

----
wheels: Generate universal wheels installable with both python 2.x and 3.x
See pytest-dev#125

Fix DeprecationWarning warnings using "logger.warning()" function

----
pytest-virtualenv: Add virtualenv as install requirement. Fixes pytest-dev#122

Remove requirement for pytest<4.0.0
See pytest-dev#100

----
pytest-webdriver: Fix RemovedInPytest4Warning using getfixturevalue

This commit fixes the following error:

  >           root_uri.append(request.getfuncargvalue('pyramid_server').uri)
  E           RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue

  pytest_webdriver.py:62: RemovedInPytest4Warning

See pytest-dev#100

----
pytest-verbose-parametrize: Add support for revamped marker infrastructure

This commit fixes tests failing with pytest > 4.0.0

----
pytest-verbose-parametrize: Fix integration tests to support pytest >= 4.1.0

This commit updates tests to support version of pytest with
pytest-dev/pytest@e9b2475e2 (Display actual test ids in `--collect-only`)

----
dist: Remove support for building and distributing *.egg files

Wheel is currently considered the standard for built and binary
packaging for Python

See https://packaging.python.org/discussions/wheel-vs-egg/

See pytest-dev#125

----
VagrantFile: Install python 3.7 and initialize python 3.7 by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

1 participant