pytests: add html report

parent 6ba5f839
......@@ -287,7 +287,15 @@ pytests:run:
except:
- master
script:
- PATH="$PREFIX/sbin:$PATH" ./ci/pytests/run.sh
- PATH="$PREFIX/sbin:$PATH" ./ci/pytests/run.sh &> pytests.log.txt
after_script:
- tail -1 pytests.log.txt
- echo "See pytests.html or pytests.log.txt for full report."
artifacts:
when: always
expire_in: 1 week
paths:
- pytest*
tags:
- docker
- linux
......
#!/bin/bash
python3 -m pytest -ra -n 24 tests/pytests
python3 -m pytest --html pytests.html --self-contained-html -dn 24 tests/pytests
......@@ -18,7 +18,7 @@ Tests can be executed with the pytest framework.
$ pytest-3 # sequential, all tests (with exception of few special tests)
$ pytest-3 test_conn_mgmt.py::test_ignore_garbage # specific test only
$ pytest-3 -s # turn on verbose logs even for successfull tests
$ pytest-3 --html pytests.html --self-contained-html # html report
It's highly recommended to run these tests in parallel, since lot of them
wait for kresd timeout. This can be don with `python-xdist`:
......
......@@ -49,3 +49,15 @@ def kresd_sock(make_kresd_sock):
])
def sock_family(request):
return request.param
@pytest.mark.optionalhook
def pytest_metadata(metadata): # filter potentially sensitive data from GitLab CI
keys_to_delete = []
for key in metadata.keys():
key_lower = key.lower()
if 'password' in key_lower or 'token' in key_lower or \
key_lower.startswith('ci') or key_lower.startswith('gitlab'):
keys_to_delete.append(key)
for key in keys_to_delete:
del metadata[key]
dnspython
jinja2
pytest
pytest-html
pytest-xdist
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment