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

Patch 1 #29

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Patch 1 #29

wants to merge 7 commits into from

Conversation

doyou89
Copy link

@doyou89 doyou89 commented Mar 23, 2018

xml.dom use too much memory, so converting big lcov file may result in memory error on memory limitated environment like jenkins.
xml.etree will reduce memory usage to under 10~20% than xml.dom.
But xml.etree not support prettyxml, so if you want to generate pretty xml, use xmllint.

xml.dom use too much memory, so converting big lcov file may result in memory error on memory limitated environment like jenkins.
xml.etree will reduce memory usage to under 10~20% than xml.dom.
But xml.etree not support prettyxml, so if you want to generate pretty xml, use xmllint.
@doyou89 doyou89 closed this Mar 24, 2018
@doyou89 doyou89 reopened this Mar 24, 2018
@doyou89
Copy link
Author

doyou89 commented Sep 24, 2020

If this is useless, let me know.

@sarnold
Copy link
Contributor

sarnold commented Mar 31, 2022

I was also having issues with a large sample file (~128 MBs or so) which makes me want to test this...

@sarnold
Copy link
Contributor

sarnold commented Mar 31, 2022

I rebased on master but now the diff tests are failing:

$ tox -e py39-linux
py39-linux create: /home/nerdboy/src/lcov-to-cobertura-xml.work/.tox/py39-linux
py39-linux installdeps: pip>=20.3, -e.[test,cov]
py39-linux installed: attrs==21.4.0,coverage==6.3.2,iniconfig==1.1.1,-e git+ssh://[email protected]/sarnold/lcov-to-cobertura-xml.git@39d9a61e2ffc6d1101dd9a3df363e2f14f7daed0#egg=lcov_cobertura,lxml==4.8.0,packaging==21.3,pluggy==1.0.0,py==1.11.0,pyparsing==3.0.7,pytest==7.1.1,pytest-cov==3.0.0,six==1.16.0,tomli==2.0.1,xmldiff==2.4
py39-linux run-test-pre: PYTHONHASHSEED='2106106915'
py39-linux run-test: commands[0] | pytest -v . --capture=no --doctest-modules --cov lcov_cobertura --cov-branch --cov-report term-missing
============================= test session starts ==============================
platform linux -- Python 3.9.7, pytest-7.1.1, pluggy-1.0.0 -- /home/nerdboy/src/lcov-to-cobertura-xml.work/.tox/py39-linux/bin/python
cachedir: .tox/py39-linux/.pytest_cache
rootdir: /home/nerdboy/src/lcov-to-cobertura-xml.work, configfile: pyproject.toml
plugins: cov-3.0.0
collected 8 items                                                              

lcov_cobertura/lcov_cobertura.py::lcov_cobertura.LcovCobertura FAILED
test/test_lcov_cobertura.py::Test::test_demangle PASSED
test/test_lcov_cobertura.py::Test::test_exclude_package_from_parser PASSED
test/test_lcov_cobertura.py::Test::test_generate_cobertura_xml FAILED
test/test_lcov_cobertura.py::Test::test_parse PASSED
test/test_lcov_cobertura.py::Test::test_parse_with_functions PASSED
test/test_lcov_cobertura.py::Test::test_support_function_names_with_commas PASSED
test/test_lcov_cobertura.py::Test::test_treat_non_integer_line_execution_count_as_zero PASSED

@doyou89 Please rebase your branch against master and try again? The tools are a bit nicer now; just install tox and run tox -e py. I didn't try my test file yet, but LLVM source coverage seems to contain 4 different metrics, namely Branch, Line, Function, and Region coverage. It does work with a small-ish LLVM lcov file, just not the big one.

@sarnold
Copy link
Contributor

sarnold commented Apr 1, 2022

Well, it does work on the large file, and the coverage.xml file is 248MB:

$ time tox -e big
big installed: lcov-cobertura==2.0.1
big run-test-pre: PYTHONHASHSEED='4002387385'
big runtests: commands[0] | lcov_cobertura test/lcov.info --output coverage.xml
___________________________________ summary ____________________________________
  big: commands succeeded
  congratulations :)

real    5m45.614s
user    5m39.118s
sys     0m6.074s

@doyou89
Copy link
Author

doyou89 commented Apr 22, 2022

@sarnold thank you for check. Conflicts resolved, merge plz.

@doyou89
Copy link
Author

doyou89 commented Aug 5, 2022

@sarnold I had rebased my branch. merge plz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants