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
$ 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`:
])
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