<commit_before>language: python

sudo: false

env:
    - TARGET=client
    - TARGET=server
    - TARGET=server_ldap
    - TARGET=e2e_chrome
#    - TARGET=e2e_firefox

python:
    - "3.4"

matrix:
    allow_failures:
        - env: TARGET=e2e_firefox

services:
    - mongodb
    - elasticsearch
    - redis-server

before_install:
    - if [ "${TARGET}" = "client" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        npm install -g grunt-cli bower ;
      fi
    - if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        chromium-browser --version ;
        export CHROME_BIN=chromium-browser &&
        export DISPLAY=:99.0 &&
        /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x16 ;
      fi

install:
    - if [ "${TARGET}" = "server" ] || [ "${TARGET}" = "server_ldap" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd server &&
        pip install -r requirements.txt &&
        cd .. ;
      fi
    - if [ "${TARGET}" = "client" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd client && npm install && cd .. ;
      fi
    - if [ "${TARGET}" = "client" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd client && bower install && cd .. ;
      fi
    - if [ "${TARGET}" = "e2e_chrome" ]; then
        (cd client && npm install "actionless/protractor#1.6.1-old" && cd .. );
      fi

before_script:
    - if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd server ;
        (env SUPERDESK_URL='http://127.0.0.1:5000/api' SUPERDESK_CLIENT_URL='http://127.0.0.1:9000' SUPERDESK_TESTING='True' honcho start &) ;
        cd ../client ;
        grunt build --server='http://127.0.0.1:5000/api' --ws='ws://127.0.0.1:5100' ;
        cd dist ;
        while [ ! -f index.html ]; do sleep .5; done ;
        (python3 -m http.server 9000 &) ;
        cd ../.. ;
      fi

script:
    - if [ "${TARGET}" = "server" ]; then
        cd server && nosetests && cd .. ;
      fi
    - if [ "${TARGET}" = "server" ]; then
        cd server &&
        behave --format progress2 --logging-level ERROR &&
        cd .. ;
      fi
    - if [ "${TARGET}" = "server_ldap" ]; then
        cd server &&
        LDAP_SERVER="ldap://sourcefabric.org" LDAP_BASE_FILTER="OU=Superdesk Users,dc=sourcefabric,dc=org" behave --format progress2 --logging-level ERROR &&
        cd .. ;
      fi
    - if [ "${TARGET}" = "server" ]; then
        cd server && flake8 && cd .. ;
      fi
    - if [ "${TARGET}" = "client" ]; then
        cd client && npm test && cd .. ;
      fi
    - if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd server &&
        python3 manage.py users:create -u admin -p admin -e '<EMAIL>' --admin=true 2>&1 ;
        cd ../client &&
        ./node_modules/.bin/webdriver-manager update &&
        ./node_modules/.bin/protractor protractor-conf.js
          --stackTrace --verbose
          --baseUrl 'http://127.0.0.1:9000'
          --params.baseBackendUrl 'http://127.0.0.1:5000/api'
          --params.username 'admin'
          --params.password '<PASSWORD>'
          --capabilities.browserName "${TARGET/e2e_/}"
        ;
      fi

after_success:
    - if [ "${TARGET}" = "client" ]; then
        cd client && grunt coveralls && cd .. ;
      fi
<commit_msg>quickfix(travis): kill python after script to prevent hanging<commit_after>language: python

sudo: false

env:
    - TARGET=client
    - TARGET=server
    - TARGET=server_ldap
    - TARGET=e2e_chrome
#    - TARGET=e2e_firefox

python:
    - "3.4"

matrix:
    allow_failures:
        - env: TARGET=e2e_firefox

services:
    - mongodb
    - elasticsearch
    - redis-server

before_install:
    - if [ "${TARGET}" = "client" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        npm install -g grunt-cli bower ;
      fi
    - if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        chromium-browser --version ;
        export CHROME_BIN=chromium-browser &&
        export DISPLAY=:99.0 &&
        /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x16 ;
      fi

install:
    - if [ "${TARGET}" = "server" ] || [ "${TARGET}" = "server_ldap" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd server &&
        pip install -r requirements.txt &&
        cd .. ;
      fi
    - if [ "${TARGET}" = "client" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd client && npm install && cd .. ;
      fi
    - if [ "${TARGET}" = "client" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd client && bower install && cd .. ;
      fi
    - if [ "${TARGET}" = "e2e_chrome" ]; then
        (cd client && npm install "actionless/protractor#1.6.1-old" && cd .. );
      fi

before_script:
    - if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd server ;
        (env SUPERDESK_URL='http://127.0.0.1:5000/api' SUPERDESK_CLIENT_URL='http://127.0.0.1:9000' SUPERDESK_TESTING='True' honcho start &) ;
        cd ../client ;
        grunt build --server='http://127.0.0.1:5000/api' --ws='ws://127.0.0.1:5100' ;
        cd dist ;
        while [ ! -f index.html ]; do sleep .5; done ;
        (python3 -m http.server 9000 &) ;
        cd ../.. ;
      fi

script:
    - if [ "${TARGET}" = "server" ]; then
        cd server && nosetests && cd .. ;
      fi
    - if [ "${TARGET}" = "server" ]; then
        cd server &&
        behave --format progress2 --logging-level ERROR &&
        cd .. ;
      fi
    - if [ "${TARGET}" = "server_ldap" ]; then
        cd server &&
        LDAP_SERVER="ldap://sourcefabric.org" LDAP_BASE_FILTER="OU=Superdesk Users,dc=sourcefabric,dc=org" behave --format progress2 --logging-level ERROR &&
        cd .. ;
      fi
    - if [ "${TARGET}" = "server" ]; then
        cd server && flake8 && cd .. ;
      fi
    - if [ "${TARGET}" = "client" ]; then
        cd client && npm test && cd .. ;
      fi
    - if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
        cd server &&
        python3 manage.py users:create -u admin -p admin -e '<EMAIL>' --admin=true 2>&1 ;
        cd ../client &&
        ./node_modules/.bin/webdriver-manager update &&
        ./node_modules/.bin/protractor protractor-conf.js
          --stackTrace --verbose
          --baseUrl 'http://127.0.0.1:9000'
          --params.baseBackendUrl 'http://127.0.0.1:5000/api'
          --params.username 'admin'
          --params.password '<PASSWORD>'
          --capabilities.browserName "${TARGET/e2e_/}"
        ;
      fi
      
after_script:
    - killall -9 python

after_success:
    - if [ "${TARGET}" = "client" ]; then
        cd client && grunt coveralls && cd .. ;
      fi

{'fraction_non_alphanumeric': 0.18797553334327913, 'fraction_numerical': 0.03207519021333731, 'mean_word_length': 1.8996539792387543, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, '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': '2515738', 'n_tokens_mistral': 2380, 'n_tokens_neox': 2260, 'n_words': 509}