pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

upload json-formatted coverage reports

Open mattip opened this issue 3 years ago • 11 comments

As per this comment, add an upload of json-formatted coverage test reports so that this tool https://carreau.github.io/pytest-json-report-viewer/ can be used to analyze the time spent in tests

mattip avatar Jun 14 '22 18:06 mattip

The PR workflow needs approval to run

mattip avatar Jun 16 '22 16:06 mattip

Sorry about that, I hadn't gotten a notification for this. 🙇

BeyondEvil avatar Jul 02 '22 00:07 BeyondEvil

It seems something is off with all the windows runs. Any ideas?

mattip avatar Jul 02 '22 17:07 mattip

Unfortunately no. Searching for the error just brings up old issues that doesn't seem relevant.

And I'm not set up on any Windows machines to try and debug. :(

BeyondEvil avatar Jul 03 '22 11:07 BeyondEvil

Hey @mattip

Sorry for the delay, but I finally got the Windows tests to behave: https://github.com/pytest-dev/pytest-html/pull/522

As soon as that's merged, I would really appreciate if you would resume looking into this. 🙇

BeyondEvil avatar Jul 15 '22 23:07 BeyondEvil

Rebased off master to pull in the fixes for windows. The CI run needs approval to start.

mattip avatar Jul 17 '22 14:07 mattip

Note that the windows pypy-38 is deactivated. If you want that to be part of the report.

BeyondEvil avatar Jul 17 '22 18:07 BeyondEvil

I needed to add --durations=0 to actually get the test durations output. Duh. In any case, this seems to work: downloading the artifact, unzippping it, and uploading the files to https://carreau.github.io/pytest-json-report-viewer/ is starting to show something.

mattip avatar Jul 17 '22 20:07 mattip

Could you trigger the CI when you get a chance?

mattip avatar Jul 17 '22 20:07 mattip

This is working, there was an issue in the viewer which is on its way to being fixed. Although I am not sure currently of the added value over looking at the durations report, here for py37mac and here for pypy37mac. For instance, testing/test_pytest_html.py::TestHTML::test_collect_error (why are there two?) clocks in at 37 secs on PyPy, and 0.45secs on CPython.

mattip avatar Jul 18 '22 17:07 mattip

This is working, there was an issue in the viewer which is on its way to being fixed. Although I am not sure currently of the added value over looking at the durations report, here for py37mac and here for pypy37mac. For instance, testing/test_pytest_html.py::TestHTML::test_collect_error (why are there two?) clocks in at 37 secs on PyPy, and 0.45secs on CPython.

There are several tests that are reported twice.

I wonder if it's related to: https://github.com/pytest-dev/pytest-html/issues/508

Regardless, I have no clue why that happens.

The most interesting thing is, does the test really run twice or is it just reported twice? 🤔

BeyondEvil avatar Jul 18 '22 20:07 BeyondEvil

Care to revisit this @mattip ?

If not, feel free close. 🙇

BeyondEvil avatar Nov 04 '23 16:11 BeyondEvil

I will continue this at some point in the weekly CI runs of PyPy + pytest-html. So I will close this, thanks.

mattip avatar Nov 04 '23 20:11 mattip