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

report.html is created at the start of pytest run instead of after in v4

Open thenu97 opened this issue 1 year ago • 2 comments
trafficstars

We run two containers in one pod. One container runs a bash script that checks the existence of the report.html then shuts the pods down after uploading the html file to azure blob storage. The second container runs the pytest command.

Due to the change in report.html being created at the start of the pytest run now, it no longer waits for the test on the second container to finish. It uploads the unfinished version of the report instead.

As this is a breaking change, could you please make a note of this in the release notes or maybe fix this by making a temporary file in /tmp then move it to the report directory at the end of the test

Part of the script:

while [ ! -f /tmp/report.html ]; do
    sleep 2
done

thenu97 avatar Jan 24 '24 14:01 thenu97

Can you try using the master branch?

That was fixed in: https://github.com/pytest-dev/pytest-html/pull/754

And released in 4.1.0.

BeyondEvil avatar Feb 02 '24 07:02 BeyondEvil

@BeyondEvil are you sure it was fixed correctly? I updated to 4.1.1 and report file is still generated at the beginning but isn't updated until the end image

Mmajonez avatar Mar 04 '24 14:03 Mmajonez