Source full path
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- Python
- Stelle
- 2.1k
- Fork
- 253
- Merge medio
- 12g 4h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pytest-cov
-
Celery tests require package; test blows up if Celery not installed instead of skipping the tests gracefullyForse già presa @dchaudhari7177 l’ha presa 98 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pytest-cov#750 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pytest-cov#617 · 1 commento ·
-
Only set dynamic context on coveragepy cores supporting it, perhaps?Forse già presa @terminalchai l’ha presa 13 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
pytest-dev/pytest-cov#755 · 3 commenti ·
-
INTERNALERROR when generating html report using pytest-cov 7.1.0 with jinjaForse già presa @daleselaji-dev l’ha presa 85 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
pytest-dev/pytest-cov#748 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
pytest-dev/pytest-cov#747 · 1 reazione ·
Tutte le issue di pytest-dev/pytest-cov
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pyfakefs#1367 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
IFEvalG exclude_word_harder misses the keyword next to punctuation, at the start or end of the text, and in other letter caseForse già presa @damienen l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
allenai/open-instruct#2151 ·
I maintainer di solito rispondono entro 1 giorno
-
feat(plan): support convertorLabels and convertorAffinity in Plan resourceForse già presa @AmenB l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
RedHatQE/openshift-python-wrapper#2849 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 25 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
libnativeapi/nativeapi#21 ·