Open ahemwe opened 10 months ago
Hi @ahemwe, did you manage to solve this? If you did please let me know how to fix, I encountered the same issue.
Unfortunately I didn't manage to fix it.
I have the same problem. And did not find a solution.
However i solved the access to the htmlcov folder by docker run ... sh -c "pytest && chrown -R "$(id -u):$(id -g)" htmlcov"
I have the same issue and did not find a solution either. I tried to run the tests in a container job and in a docker container with the same result. It seems like the coverage html is written after the plugin is searching for it. In addition I tried to run the tests twice in two steps and deactivate the upload in the first one with –no-coverage-upload flag, but still the same result.
collecting ... collected 7 items
app/backend/tests/test_hubo.py::test_read_users_no_access_token PASSED [ 14%]
app/backend/tests/test_hubo.py::test_read_users_wrong_approle PASSED [ 28%]
app/backend/tests/test_hubo.py::test_read_users_correct_approle PASSED [ 42%]
app/backend/tests/test_users.py::test_users_get_app_roles_no_access_token PASSED [ 57%]
app/backend/tests/test_users.py::test_users_get_app_roles_no_approle PASSED [ 71%]
app/backend/tests/test_users.py::test_users_get_app_roles_user_approle PASSED [ 85%]
Result Attachments will be stored in LogStore
Run Attachments will be stored in LogStore
##[warning]Failed to inline CSS styles in coverage reports. Error: [Errno 2] No such file or directory: '/home/vsts/work/1/s/htmlcov'
Reading code coverage summary from '/home/vsts/work/1/s/coverage.xml'
-------------- generated Nunit xml file: /__w/1/s/test-output.xml --------------
---------- coverage: platform linux, python 3.12.2-final-0 -----------
Coverage HTML written to dir /__w/1/s/htmlcov
Coverage XML written to file /__w/1/s/coverage.xml
============================== 7 passed in 2.83s ===============================
I want to run pytests on a docker container by means of Azure Pipelines.
Given this pipeline snippet:
I get this warning during build:
##[warning]Failed to inline CSS styles in coverage reports. Error: [Errno 2] No such file or directory: '/home/foo/myagent/_work/3/s/reports/coverage_html'
The full output is
Due to missing inlining of css, the coverage report is broken in AzureDevOps:![image](https://github.com/Azure/pytest-azurepipelines/assets/7727144/87ab0928-8f84-4d89-ade1-4d2d7549adf7)
I've tried for hours, but can't find a way to fix this warning.
Any help is highly appreciated. Thanks.