Source full path
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Reproduce the generated build/test-results/python.xml using the pytest.ini and .coveragerc configurations shown, then inspect how pytest-cov handles the source path in the XML report. Compare the reported absolute path with the desired project-relative src/main/python path; done means the report no longer includes the Jenkins workspace prefix.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Team,
I'm trying to set up Python build in a project which is 'governed' by Gradle.
I'm also trying to use Gradle/Maven-conventional source path for Python files (src/main/python, src/test/python).
In general, everything works fine and as expected with one caveat (for me, specifically).
I'm using pytest with pytest.ini where I set pytest-cov configuration with the following:
[pytest]
norecursedirs = .gradle/** gradle/** build/** out/** **/src/main/python/**
python_files = *_spec.py
python_functions = feature_*
pythonpath = src/main/python
addopts = --cov=src/main/python --cov-config=.coveragerc --cov-report xml:build/test-results/python.xml --cov-report html:build/reports/tests/python src/test/python
and corresponding .coveragerc:
[run]
omit = **/test/**
source = src/test/python
The problem I'm having is the path to the source files in the python.xml test coverage report.
It seems to prefix the src/main/python with the output of the pwd command and I'm effectively getting stuff like
<sources>
<source>/home/jenkins/workspace/pipeline-name-here/application/src/main/python</source>
</sources>
where /home/jenkins/workspace/pipeline-name-here/application/ is that annoying prefix I'm need to get rid of.
My Gradle folder structure (w/service folders omitted) is like
|-- Git-name-of-the-project
|--- ansible
|--- ansible files
|--- application
|--- <temp build-related folders>
|--- src
|--- main
|--- python
|--- python-file.py
|--- gradlew <etc>
|--- .coveragerc
|--- pytest.ini
Any suggestions?
- Lenguaje dominante
- Python
- Estrellas
- 2.1k
- Forks
- 253
- Merge medio
- 12 d 4 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytest-dev/pytest-cov
-
Celery tests require package; test blows up if Celery not installed instead of skipping the tests gracefullyPosiblemente ocupada @dchaudhari7177 la tomó hace 98 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pytest-dev/pytest-cov#750 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pytest-dev/pytest-cov#617 · 1 comentario ·
-
Only set dynamic context on coveragepy cores supporting it, perhaps?Posiblemente ocupada @terminalchai la tomó hace 13 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
pytest-dev/pytest-cov#755 · 3 comentarios ·
-
INTERNALERROR when generating html report using pytest-cov 7.1.0 with jinjaPosiblemente ocupada @daleselaji-dev la tomó hace 84 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
pytest-dev/pytest-cov#748 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
pytest-dev/pytest-cov#747 · 1 reacción ·
Todos los issues de pytest-dev/pytest-cov
Issues similares
-
breaking change
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
check-skill-pages: show fixture build errors when a build failsPosiblemente ocupada @ShahadatTest la tomó hoy. Abiertogood first issue P2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
coco-research/coco#439 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
esphome/home-assistant-addon#274 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
endurain-project/endurain#882 ·
Los mantenedores suelen responder en 1 día
-
Add unit tests for metrics.pyAbiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100