Compare commits

...

1 commit
v2.0 ... main

Author SHA1 Message Date
6f5f9a0bf8
feat: migrate from Forgejo to GitLab CI with test reporting
All checks were successful
Test pipeline / test (push) Successful in 16s
- Convert Forgejo workflow to GitLab CI/CD (.gitlab-ci.yml) - Add JUnit XML and coverage reporting
with pytest-cov - Configure caching and artifacts for better CI performance - Fix pytest.ini
configuration and enhance .coveragerc - Support GitLab v18.1.1 with comprehensive test visualization
2025-07-08 14:54:40 +02:00
6 changed files with 71 additions and 4 deletions

View file

@ -2,7 +2,11 @@
source = doi2dataset
omit =
*/tests/*
*/test_*
*/docs/*
*/__pycache__/*
*/venv/*
*/.venv/*
setup.py
conf.py
__init__.py
@ -11,13 +15,22 @@ omit =
exclude_lines =
pragma: no cover
def __repr__
def __str__
if self.debug:
raise NotImplementedError
raise AssertionError
if __name__ == .__main__.:
if TYPE_CHECKING:
@abstractmethod
pass
raise ImportError
except ImportError
def __str__
show_missing = true
precision = 2
[html]
directory = htmlcov
[xml]
output = coverage.xml

1
.gitignore vendored
View file

@ -59,6 +59,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
junit.xml
*.cover
*.py,cover
.hypothesis/

36
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,36 @@
# GitLab CI/CD pipeline for doi2dataset
# Compatible with GitLab v18.1.1
stages:
- test
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip/
- .venv/
test:
stage: test
image: python:3
before_script:
- python -m pip install --upgrade pip
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
script:
- pytest
artifacts:
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
paths:
- htmlcov/
expire_in: 1 week
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
only:
- branches
- merge_requests

15
pytest.ini Normal file
View file

@ -0,0 +1,15 @@
[pytest]
addopts =
--cov=doi2dataset
--cov-report=html
--cov-report=xml
--cov-report=term-missing
--junitxml=junit.xml
--verbose
--tb=short
testpaths = tests
python_files = test_*.py *_test.py
python_functions = test_*
python_classes = Test*

View file

@ -1,3 +1,4 @@
pytest>=8.3.5,<9.0
pytest-mock>=3.14.0,<4.0
pytest-cov>=6.0.0,<7.0
ruff>=0.11.1,<0.20

View file

@ -25,7 +25,8 @@ setup(
],
"dev": [
"pytest>=8.3.5,<9.0",
"pytest-mock>=3.14.0,4.0",
"pytest-mock>=3.14.0,<4.0",
"pytest-cov>=6.0.0,<7.0",
"ruff>=0.11.1,<0.20"
]
},