<commit_before>machine:
  environment:
    SCRATCH: "$HOME/scratch"
    TEST_DATA_NAME: "circle-tests"
    TEST_DATA_URL: "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/589241339ad5a101fad8c474"
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"
    - "~/data"

  pre:
    # Download test data
    - mkdir -p ~/data/ ~/docker
    # Create scratch folder and force group permissions
    - mkdir -p $SCRATCH && sudo setfacl -d -m group:ubuntu:rwx $SCRATCH && sudo setfacl -m group:ubuntu:rwx $SCRATCH
    - if [[ ! -d ~/data/${TEST_DATA_NAME} ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O ${TEST_DATA_NAME}.tar.gz "${TEST_DATA_URL}" && tar xzf ${TEST_DATA_NAME}.tar.gz -C ~/data/; fi
  override:
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - for i in $(seq 1 5); do docker build -f docker/Dockerfile_py35 -t mriqc:py35 . && break || sleep 15; done
    - docker save mriqc:py35 > ~/docker/image.tar

test:
  override:
    # Test mriqcp
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ${CIRCLE_TEST_REPORTS}:/scratch -w /root/src/mriqc --entrypoint="/usr/bin/run_tests" mriqc:py35 :
        timeout: 2600
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/data:/data:ro -v $SCRATCH:/scratch -w /scratch mriqc:py35 /data/${TEST_DATA_NAME} out/ participant -w work/ --testing --verbose-reports :
        timeout: 3200
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/data:/data:ro -v $SCRATCH/func:/scratch -w /scratch mriqc:py35 /data/${TEST_DATA_NAME} out/ group -d func -w work/
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/data:/data:ro -v $SCRATCH/anat:/scratch -w /scratch mriqc:py35 /data/${TEST_DATA_NAME} out/ group -d anat -w work/

general:
  artifacts:
    - "~/scratch"
  branches:
    ignore:
      - gh-pages # ignore gh-pages

# deployment:
#   codecov:
#     branch: /.*/
#     commands:
#       - bash <(curl -s https://codecov.io/bash)
<commit_msg>remove unused -w flag<commit_after>machine:
  environment:
    SCRATCH: "$HOME/scratch"
    TEST_DATA_NAME: "circle-tests"
    TEST_DATA_URL: "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/589241339ad5a101fad8c474"
  services:
    - docker

dependencies:
  cache_directories:
    - "~/docker"
    - "~/data"

  pre:
    # Download test data
    - mkdir -p ~/data/ ~/docker
    # Create scratch folder and force group permissions
    - mkdir -p $SCRATCH && sudo setfacl -d -m group:ubuntu:rwx $SCRATCH && sudo setfacl -m group:ubuntu:rwx $SCRATCH
    - if [[ ! -d ~/data/${TEST_DATA_NAME} ]]; then wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q -O ${TEST_DATA_NAME}.tar.gz "${TEST_DATA_URL}" && tar xzf ${TEST_DATA_NAME}.tar.gz -C ~/data/; fi
  override:
    - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
    - for i in $(seq 1 5); do docker build -f docker/Dockerfile_py35 -t mriqc:py35 . && break || sleep 15; done
    - docker save mriqc:py35 > ~/docker/image.tar

test:
  override:
    # Test mriqcp
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ${CIRCLE_TEST_REPORTS}:/scratch -w /root/src/mriqc --entrypoint="/usr/bin/run_tests" mriqc:py35 :
        timeout: 2600
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/data:/data:ro -v $SCRATCH:/scratch -w /scratch mriqc:py35 /data/${TEST_DATA_NAME} out/ participant --testing --verbose-reports :
        timeout: 3200
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/data:/data:ro -v $SCRATCH/func:/scratch -w /scratch mriqc:py35 /data/${TEST_DATA_NAME} out/ group -d func -w work/
    - docker run -i -v /etc/localtime:/etc/localtime:ro -v ~/data:/data:ro -v $SCRATCH/anat:/scratch -w /scratch mriqc:py35 /data/${TEST_DATA_NAME} out/ group -d anat -w work/

general:
  artifacts:
    - "~/scratch"
  branches:
    ignore:
      - gh-pages # ignore gh-pages

# deployment:
#   codecov:
#     branch: /.*/
#     commands:
#       - bash <(curl -s https://codecov.io/bash)

{'fraction_non_alphanumeric': 0.1617972010802848, 'fraction_numerical': 0.025042965872821017, 'mean_word_length': 2.789767441860465, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7263008', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1566, 'n_words': 375}