<commit_before>---
dist: trusty
sudo: false
language: node_js
matrix:
    fast_finish: true
    include:
        - os: linux
          node_js: 6
          env: CXX=g++-4.8
        - os: linux
          node_js: 7
          env: CXX=g++-4.8
        - os: osx
          node_js: 6
env:
    global:
        - COZY_DESKTOP_DIR=/tmp/cozy-desktop
        - COZY_URL="http://localhost:8080"
        - COZY_PASSPHRASE="CozyTest_1"
        - GOPATH="$HOME"
        - NODE_ENV=test
        - NPM_CONFIG_PROGRESS=false
services:
    - docker
cache:
    directories:
        - /Library/Caches/Homebrew
addons:
    apt:
        sources:
            - ubuntu-toolchain-r-test
        packages:
            - gcc-4.8
            - g++-4.8

# install cozy stack for integration test
before_install:
    # CouchDB 2
    - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
        travis_retry docker run -d -p 5984:5984 --name couch klaemo/couchdb:2.0.0;
      fi
    - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
        travis_retry brew cask install apache-couchdb;
        (/Applications/Apache\ CouchDB.app/Contents/Resources/couchdbx-core/bin/couchdb &);
      fi

    # Go 1.8
    - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
        travis_retry brew install gimme;
      fi
    - travis_retry gimme 1.8;
    - source ~/.gimme/envs/go1.8.env;

    # Yarn
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.24.6;
    - export PATH=$HOME/.yarn/bin:$PATH;


    # Cozy stack v3
    - travis_retry go get -u github.com/cozy/cozy-stack
    - curl -X PUT http://127.0.0.1:5984/{_users,_replicator,_global_changes}
    - $GOPATH/bin/cozy-stack serve &
    - sleep 1
    - $GOPATH/bin/cozy-stack instances add --dev --passphrase "$CO<PASSWORD>" localhost:8080
    - export COZY_CLIENT_ID=$($GOPATH/bin/cozy-stack instances client-oauth localhost:8080 http://localhost/ test github.com/cozy-labs/cozy-desktop)
    - export COZY_STACK_TOKEN=$($GOPATH/bin/cozy-stack instances token-oauth localhost:8080 "$COZY_CLIENT_ID" io.cozy.files)

    # COZY_DESKTOP_DIR
    - mkdir -p "$COZY_DESKTOP_DIR"

    # Dummy .env.test (all variables are already set)
    # env-cmd ignores the file when empty
    - echo "NODE_ENV=test" > "${TRAVIS_BUILD_DIR}/cli/.env.test"

script:
    - cd cli
    - travis_retry yarn
    - yarn build
    - yarn lint
    - yarn test:coverage
    - cd ../gui
    - travis_retry yarn
    - yarn lint
    - yarn build
    - cd ..

after_success:
    - bash <(curl -s https://codecov.io/bash)

after_failure:
    - $CXX --version
    - netstat -lntp
    - ls -alR cli/node_modules/pouchdb/node_modules/leveldown
<commit_msg>Initialize CouchDB as soon as possible<commit_after>---
dist: trusty
sudo: false
language: node_js
matrix:
    fast_finish: true
    include:
        - os: linux
          node_js: 6
          env: CXX=g++-4.8
        - os: linux
          node_js: 7
          env: CXX=g++-4.8
        - os: osx
          node_js: 6
env:
    global:
        - COZY_DESKTOP_DIR=/tmp/cozy-desktop
        - COZY_URL="http://localhost:8080"
        - COZY_PASSPHRASE="<PASSWORD>"
        - GOPATH="$HOME"
        - NODE_ENV=test
        - NPM_CONFIG_PROGRESS=false
services:
    - docker
cache:
    directories:
        - /Library/Caches/Homebrew
addons:
    apt:
        sources:
            - ubuntu-toolchain-r-test
        packages:
            - gcc-4.8
            - g++-4.8

# install cozy stack for integration test
before_install:
    # CouchDB 2
    - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
        travis_retry docker run -d -p 5984:5984 --name couch klaemo/couchdb:2.0.0;
      fi
    - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
        travis_retry brew cask install apache-couchdb;
        (/Applications/Apache\ CouchDB.app/Contents/Resources/couchdbx-core/bin/couchdb &);
      fi
    - sleep 3
    - curl -X PUT http://127.0.0.1:5984/{_users,_replicator,_global_changes}

    # Go 1.8
    - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
        travis_retry brew install gimme;
      fi
    - travis_retry gimme 1.8;
    - source ~/.gimme/envs/go1.8.env;

    # Yarn
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.24.6;
    - export PATH=$HOME/.yarn/bin:$PATH;


    # Cozy stack v3
    - travis_retry go get -u github.com/cozy/cozy-stack
    - $GOPATH/bin/cozy-stack serve &
    - sleep 1
    - $GOPATH/bin/cozy-stack instances add --dev --passphrase "$CO<PASSWORD>" localhost:8080
    - export COZY_CLIENT_ID=$($GOPATH/bin/cozy-stack instances client-oauth localhost:8080 http://localhost/ test github.com/cozy-labs/cozy-desktop)
    - export COZY_STACK_TOKEN=$($GOPATH/bin/cozy-stack instances token-oauth localhost:8080 "$COZY_CLIENT_ID" io.cozy.files)

    # COZY_DESKTOP_DIR
    - mkdir -p "$COZY_DESKTOP_DIR"

    # Dummy .env.test (all variables are already set)
    # env-cmd ignores the file when empty
    - echo "NODE_ENV=test" > "${TRAVIS_BUILD_DIR}/cli/.env.test"

script:
    - cd cli
    - travis_retry yarn
    - yarn build
    - yarn lint
    - yarn test:coverage
    - cd ../gui
    - travis_retry yarn
    - yarn lint
    - yarn build
    - cd ..

after_success:
    - bash <(curl -s https://codecov.io/bash)

after_failure:
    - $CXX --version
    - netstat -lntp
    - ls -alR cli/node_modules/pouchdb/node_modules/leveldown

{'fraction_non_alphanumeric': 0.13015633829346393, 'fraction_numerical': 0.02335656432473159, 'mean_word_length': 2.0729166666666665, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5119473', 'n_tokens_mistral': 2122, 'n_tokens_neox': 1993, 'n_words': 411}