Skip to content

Commit

Permalink
CI: updated test job for code coverage and send coverage report to co…
Browse files Browse the repository at this point in the history
…dacy
  • Loading branch information
sebastientourbier committed Sep 1, 2020
1 parent 3ca0638 commit e53e248
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ jobs:
pigz -d --stdout /tmp/cache/docker.tar.gz | docker load
docker images
fi
run:
name: Create the data/test folder
no_output_timeout: 1h
command: |
mkdir -p /tmp/src/mialsuperresolutiontoolkit/data/test
- run:
name: Run super-resolution pipelines on sample testing dataset
no_output_timeout: 6h
Expand All @@ -136,33 +141,54 @@ jobs:
--param_file /bids_dir/code/participants_params.json \
--manual
# Rename partial coverage
mv /tmp/src/mialsuperresolutiontoolkit/data/code/coverage.xml /tmp/src/mialsuperresolutiontoolkit/data/test/test-01_coverage.xml
# - save_cache:
# key: ds-sample-derivatives-{{ .Branch }}-{{ epoch }}
# paths:
# - /tmp/data/ds-sample/derivatives
- run:
name: Checking outputs of MIALSRTK BIDS App run
command: |
mkdir -p /tmp/src/mialsuperresolutiontoolkit/data/test
# Get all files in derivatives except the _*.json interface hash generated by nipype (find) / remove the full path of the derivatives (sed) / sort the files and write it to a text file
sudo find /tmp/src/mialsuperresolutiontoolkit/data/derivatives -path */figures -prune -o -not -name "_*.json" -type f -print | sed s+/tmp/src/mialsuperresolutiontoolkit/data/derivatives/++ | sort > /tmp/src/mialsuperresolutiontoolkit/data/test/outputs.out
diff /home/circleci/src/mialsuperresolutiontoolkit/.circleci/test_outputs.txt /tmp/src/mialsuperresolutiontoolkit/data/test/outputs.out
exit $?
sudo find /tmp/src/mialsuperresolutiontoolkit/data/derivatives -path */figures -prune -o -not -name "_*.json" -type f -print | sed s+/tmp/src/mialsuperresolutiontoolkit/data/derivatives/++ | sort > /tmp/src/mialsuperresolutiontoolkit/data/test/test-01_outputs.out
# diff /home/circleci/src/mialsuperresolutiontoolkit/.circleci/test_outputs.txt /tmp/src/mialsuperresolutiontoolkit/data/test/test-01_outputs.out
# exit $?
- run:
name: Clean working directory
when: always
command: |
sudo chown $(id -un):$(id -gn) -R /tmp/src/mialsuperresolutiontoolkit/data
find /tmp/src/mialsuperresolutiontoolkit/data/derivatives -not -name "*.svg" -not -name "*.html" -not -name "*.rst" \
-not -name "*.mat" -not -name "*.gpickle" -not -name "*.lta" -not -name "*.json" -not -name "*.txt" -not -name "*.pklz" -type f -delete
- persist_to_workspace:
root: /tmp
paths:
- src/mialsuperresolutiontoolkit/data/test
- store_artifacts:
path: /tmp/src/mialsuperresolutiontoolkit/data/code
- store_artifacts:
path: /tmp/src/mialsuperresolutiontoolkit/data/test
- store_artifacts:
path: /tmp/src/mialsuperresolutiontoolkit/data/derivatives

codacy-coverage-report:
docker:
- image: 'circleci/openjdk:8-jdk'

working_directory: /tmp/src/mialsuperresolutiontoolkit/data/test

steps:
- attach_workspace:
at: /tmp
- coverage-reporter/send_report:
# With parcellation tests
coverage-reports: '/tmp/src/mialsuperresolutiontoolkit/data/test/test-01_coverage.xml'
# coverage-reports: '/tmp/src/mialsuperresolutiontoolkit/data/test/test-01_coverage.xml,//tmp/src/mialsuperresolutiontoolkit/data/test/test-01_coverage.xml'
project-token: ${CODACY_PROJECT_TOKEN}
# build_docs:
# machine:
# # Ubuntu 16.04, docker 18.09.3, docker-compose 1.23.1
Expand Down

0 comments on commit e53e248

Please sign in to comment.