mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 21:25:43 -05:00
gitlab-ci: generate test coverage
This commit is contained in:
parent
70c4799385
commit
97d3f05968
2 changed files with 7 additions and 4 deletions
|
@ -27,16 +27,19 @@ pytest:
|
|||
image: archlinux
|
||||
before_script:
|
||||
- pacman -Sy --noconfirm --needed archlinux-keyring && pacman -Su --noconfirm python python-pip sudo git base-devel
|
||||
- pip install pytest -r requirements.txt
|
||||
- pip install pytest pytest-cov -r requirements.txt
|
||||
- 'echo "kupfer ALL = (ALL) NOPASSWD: ALL" > /etc/sudoers.d/kupfer_all'
|
||||
- useradd -m kupfer
|
||||
- chmod 777 .
|
||||
script:
|
||||
- script -e -c 'su kupfer -s /bin/bash -c ./pytest.sh'
|
||||
- script -e -c 'su kupfer -s /bin/bash -c "./pytest.sh --cov=. --cov-branch --cov-report=term --cov-report=xml:coverage.xml"'
|
||||
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
|
||||
artifacts:
|
||||
reports:
|
||||
junit: pytest-report.xml
|
||||
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: coverage.xml
|
||||
build_docker:
|
||||
stage: build
|
||||
image: docker:latest
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo -v
|
||||
python -m pytest --junit-xml=pytest-report.xml -v ./*/test_*.py
|
||||
python -m pytest --junit-xml=pytest-report.xml -v "$@" ./*/test_*.py
|
||||
|
|
Loading…
Add table
Reference in a new issue