Skip to content

Add a mechanism for merging multiple html reports #48

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
ghost opened this issue May 31, 2016 · 10 comments
Closed

Add a mechanism for merging multiple html reports #48

ghost opened this issue May 31, 2016 · 10 comments

Comments

@ghost
Copy link

ghost commented May 31, 2016

Would it be possible to expose a flag that allows merging multiple html reports?
This is something that could probably be done with a separate script, but I think it makes sense to add this functionality to the plugin. Something like:
py.test --merge-html result1.html result2.html ... resultN.html

Cheers,
Goncalo

@davidedelvento
Copy link

Why would you like to do that? It looks like we want to go in the opposite direction, namely splitting the html file in multiple ones, see #33 and #39

@ghost
Copy link
Author

ghost commented Jun 3, 2016

I understand that this might not be needed by most of the people. In my case it is useful because I do a lot of functional testing with pytest, not necessarily testing python code, but tools that I wrap with subprocess and then parametrize and exercise with pytest. I test these against different platforms and have to kick separate runs for each one, ending up with several .html reports. It would be nice to be able to join them in a single report so that people would not have open reports separately (see image attached). I would put this more as a minor/cosmetic feature. This does not conflict with #33 or #39
pytest-html

Edit: the tabs are actually part of the jenkins plugin, but I believe you know what I mean.

@davehunt
Copy link
Collaborator

davehunt commented Jun 3, 2016

I think this is out of scope for the pytest plugin. You could create a new tool that takes multiple test outputs (such as the HTML report, or XML, etc) and generates a single report. This tool could probably even depend on pytest-html and reused some of the methods, though perhaps it would need some refactoring to expose them appropriately. I'm going to close this, but I'm happy to review any patches that refactor the plugin to support such a tool.

@davehunt davehunt closed this as completed Jun 3, 2016
@andb0t
Copy link

andb0t commented May 6, 2019

This feature would be really important for me, too!

My project consists of a series of subprojects each with their own virtual environment. Until now my CI goes through each subproject, enters the venv and executes pipenv run pytest --cov=runner --cov-report=html --cov-report=term. This creates an htmlcov folder in each subfolder. Now I want an overview of the code coverage of the entire project, consisting of n subprojects, but I find it inconvenient to parse the html files into a new one. Does anyone have a similar problem and a solution for me? Can this be achieved from within pytest?

@davehunt ?

@fenchu
Copy link

fenchu commented Jul 1, 2020

I have a test here where I need to run two pytest instances. If I run them in same instance browser will not clear its session. so this feature is needed. If I kill the browser/webdriver processes selenium just says socket is occupied.

@akavbathen
Copy link

Hi guys 👋

I have decided to develop a utility that is able to merge several pytest-html reports.
Very useful to those running pytest suites in parallel and want to combine the reports later.

Check it out:
https://github.com/akavbathen/pytest_html_merger

Please open an Issue or contribute directly by creating a PR

Enjoy!

@assadniang
Copy link

Hi guys 👋

I have decided to develop a utility that is able to merge several pytest-html reports. Very useful to those running pytest suites in parallel and want to combine the reports later.

Check it out: https://github.com/akavbathen/pytest_html_merger

Please open an Issue or contribute directly by creating a PR

Enjoy!

Thank you!!!
This is a very useful tool

@vikshaw-Nokia
Copy link

HI All
HI @akavbathen
Do you have anything similar for splitting the HTML as they are getting huge as the day passes.
That would be really helpful

@akavbathen
Copy link

Can you please elaborate on what exactly you are experiencing?

Files come split and the tool merges them. What do you mean by HTML files are getting huge?

@SandhyaJha
Copy link

pytest_html_merger -i reports -o merged.html works perfectly fine for reports generated using pytest-html.
Is there any tool for merging reports generated using pytest-html-reporter?

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

No branches or pull requests

8 participants