Skip to content

Commit

Permalink
CI: Run coverage commands in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jan 24, 2020
1 parent 56de024 commit 60ad35a
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 18 deletions.
74 changes: 59 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ jobs:
sudo setfacl -d -m group:$(id -gn):rwx /tmp/ds005/work && \
sudo setfacl -m group:$(id -gn):rwx /tmp/ds005/work
- run:
name: Install coverage and codecov
name: Install codecov
command: |
pyenv install 3.6.3
pyenv global 3.6.3
python --version
python -m pip install -U pip
python -m pip install -U coverage codecov
python -m pip install -U codecov
pyenv rehash
- run:
name: Set-up a Docker registry
Expand Down Expand Up @@ -428,18 +428,40 @@ jobs:
--ncpus 2 --omp-nthreads 2 -vv \
--fs-license-file /tmp/fslicense/license.txt \
--fs-subjects-dir /tmp/ds005/freesurfer
- run:
name: Combine coverage
no_output_timeout: 2h
command: |
# Combine coverage and convert to XML inside container because
# the file format is sensitive to changes in environment
docker run --rm=false -it \
-v /tmp/ds005:/tmp/ds005 \
-v /tmp/src/smriprep:/src/smriprep \
-w /src/smriprep \
-e FMRIPREP_DEV=1 -u $(id -u) \
-e COVERAGE_FILE=/tmp/ds005/work/.coverage \
-e COVERAGE_RCFILE=/src/smriprep/docker/multiproc.coveragerc \
--entrypoint=coverage \
poldracklab/smriprep:latest \
combine /tmp/ds005/work/.coverage.*
# Convert to XML to freeze
docker run --rm=false -it \
-v /tmp/ds005:/tmp/ds005 \
-v /tmp/src/smriprep:/src/smriprep \
-w /src/smriprep \
-e FMRIPREP_DEV=1 -u $(id -u) \
-e COVERAGE_FILE=/tmp/ds005/work/.coverage \
-e COVERAGE_RCFILE=/src/smriprep/docker/multiproc.coveragerc \
--entrypoint=coverage \
poldracklab/smriprep:latest \
xml
- run:
name: Combine coverage and submit
working_directory: /tmp/src/smriprep
command: |
pyenv local 3.6.3
which python
python --version
coverage combine \
--rcfile /tmp/src/smriprep/docker/multiproc.coveragerc \
/tmp/ds005/work/.coverage.*
coverage xml
coverage report
codecov --file coverage.xml --flags ds005 -e CIRCLE_JOB
- save_cache:
key: ds005-anat-v6-{{ .Branch }}-{{ epoch }}
Expand Down Expand Up @@ -507,13 +529,13 @@ jobs:
sudo setfacl -d -m group:$(id -gn):rwx /tmp/ds054/work && \
sudo setfacl -m group:$(id -gn):rwx /tmp/ds054/work
- run:
name: Install coverage and codecov
name: Install codecov
command: |
pyenv install 3.6.3
pyenv global 3.6.3
python --version
python -m pip install -U pip
python -m pip install -U coverage codecov
python -m pip install -U codecov
pyenv rehash
- run:
name: Set-up a Docker registry
Expand Down Expand Up @@ -564,17 +586,39 @@ jobs:
--mem-gb 4 --ncpus 2 --omp-nthreads 2 -vv \
--fs-license-file /tmp/fslicense/license.txt
- run:
name: Combine coverage and submit
name: Combine coverage
no_output_timeout: 2h
command: |
# Combine coverage and convert to XML inside container because
# the file format is sensitive to changes in environment
docker run --rm=false -it \
-v /tmp/ds054:/tmp/ds054 \
-v /tmp/src/smriprep:/src/smriprep \
-w /src/smriprep \
-e FMRIPREP_DEV=1 -u $(id -u) \
-e COVERAGE_FILE=/tmp/ds054/work/.coverage \
-e COVERAGE_RCFILE=/src/smriprep/docker/multiproc.coveragerc \
--entrypoint=coverage \
poldracklab/smriprep:latest \
combine /tmp/ds054/work/.coverage.*
# Convert to XML to freeze
docker run --rm=false -it \
-v /tmp/ds054:/tmp/ds054 \
-v /tmp/src/smriprep:/src/smriprep \
-w /src/smriprep \
-e FMRIPREP_DEV=1 -u $(id -u) \
-e COVERAGE_FILE=/tmp/ds054/work/.coverage \
-e COVERAGE_RCFILE=/src/smriprep/docker/multiproc.coveragerc \
--entrypoint=coverage \
poldracklab/smriprep:latest \
xml
- run:
name: Submit coverage
working_directory: /tmp/src/smriprep
command: |
pyenv local 3.6.3
which python
python --version
coverage combine \
--rcfile /tmp/src/smriprep/docker/multiproc.coveragerc \
/tmp/ds054/work/.coverage.*
coverage report
coverage xml
codecov --file coverage.xml --flags ds054 -e CIRCLE_JOB
- save_cache:
key: ds054-anat-v6-{{ .Branch }}-{{ epoch }}
Expand Down
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
fixes:
- "/src/smriprep/::"
ignore:
- "smriprep/_version.py"
4 changes: 1 addition & 3 deletions docker/multiproc.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ branch = True
source = smriprep
omit =
*/tests/*
relative_files = True
concurrency = multiprocessing

[paths]
source =
smriprep/
/tmp/src/smriprep/smriprep
/usr/local/miniconda/lib/python*/site-packages/smriprep
*/smriprep

0 comments on commit 60ad35a

Please sign in to comment.