<commit_before>language: python
sudo: false
cache:
  directories:
    - eggs
    - .npm
addons:
  apt_packages:
  - graphviz
env:
  global:
    - secure: "<KEY>="
    - secure: "<KEY>
    - PATH="/usr/share/elasticsearch/bin:/usr/lib/postgresql/9.4/bin:$PATH"
matrix:
  include:
    - python: "3.4"
      env: BROWSER=Chrome
    - python: "3.4"
      env: BROWSER=
before_install:
  - whereis elasticsearch
  - postgres --version
  - initdb --version
  - elasticsearch -v
install:
  - npm config set python /usr/bin/python2.7
  - python bootstrap.py -v 2.3.1 --setuptools-version 15.2
  - bin/buildout -c buildout-travis.cfg || (echo "Retrying buildout" && bin/buildout -c buildout-travis.cfg)
before_script:
  - >
    if test -n "$BROWSER"; then
      CONNECT_URL=https://saucelabs.com/downloads/sc-4.3.11-linux.tar.gz
      CONNECT_DOWNLOAD=sc.tar.gz
      SC_READYFILE=sauce-connect-ready-$RANDOM
      SC_LOGFILE=$HOME/sauce-connect.log
      SC_PIDFILE=$HOME/sauce-connect.pid
      curl $CONNECT_URL > $CONNECT_DOWNLOAD
      mkdir sc
      tar -zxf $CONNECT_DOWNLOAD --strip 1 --directory sc
      sc/bin/sc --readyfile $SC_READYFILE \
        --logfile $SC_LOGFILE \
        --pidfile $SC_PIDFILE \
        --tunnel-identifier $TRAVIS_JOB_NUMBER \
        --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY > /dev/null &
      while test -f "$SC_PIDFILE" && test ! -f "$SC_READYFILE"; do sleep 5; done
    fi
script:
  - if test -z "$BROWSER"; then npm test; fi
  - if test -z "$BROWSER"; then bin/test -v -v --timeout=1000 -m "not bdd"; fi
  - >
    if test -n "$BROWSER"; then
      test -f "$SC_PIDFILE" && bin/test -v -v --timeout=1000 -m "bdd" --tb=short \
        --splinter-implicit-wait 1000 \
        --splinter-webdriver remote \
        --splinter-remote-url "http://$SAUCE_USERNAME:$SAUCE_ACCESS_KEY@localhost:4445/wd/hub" \
        --splinter-socket-timeout 1000 \
        --browser-arg tunnel-identifier "$TRAVIS_JOB_NUMBER" \
        --browser-arg-int build  "$TRAVIS_BUILD_NUMBER" \
        --browser-arg-int idleTimeout 1000 \
        --browser-arg name "$TRAVIS_REPO_SLUG $TRAVIS_BRANCH $TRAVIS_COMMIT" \
        --browser-arg browser "$BROWSER"
    fi
after_script:
  - >
    if test -f "$SC_PIDFILE"; then
      # NOTE: Selenium Session ID/Sauce Connect Job ID is no longer stored in sauce-connect.log
      # SAUCE_JOB_ID=`grep -m 1 /session/ "$HOME/sauce-connect.log" | cut -d / -f 7`<commit_msg>check for tunnel readiness and pid<commit_after>language: python
sudo: false
cache:
  directories:
    - eggs
    - .npm
addons:
  apt_packages:
  - graphviz
env:
  global:
    - secure: "<KEY>
    - secure: "<KEY>
    - PATH="/usr/share/elasticsearch/bin:/usr/lib/postgresql/9.4/bin:$PATH"
matrix:
  include:
    - python: "3.4"
      env: BROWSER=Chrome
    - python: "3.4"
      env: BROWSER=
before_install:
  - whereis elasticsearch
  - postgres --version
  - initdb --version
  - elasticsearch -v
install:
  - npm config set python /usr/bin/python2.7
  - python bootstrap.py -v 2.3.1 --setuptools-version 15.2
  - bin/buildout -c buildout-travis.cfg || (echo "Retrying buildout" && bin/buildout -c buildout-travis.cfg)
before_script:
  - >
    if test -n "$BROWSER"; then
      CONNECT_URL=https://saucelabs.com/downloads/sc-4.3.11-linux.tar.gz
      CONNECT_DOWNLOAD=sc.tar.gz
      SC_READYFILE=sauce-connect-ready-$RANDOM
      SC_LOGFILE=$HOME/sauce-connect.log
      SC_PIDFILE=$HOME/sauce-connect.pid
      curl $CONNECT_URL > $CONNECT_DOWNLOAD
      mkdir sc
      tar -zxf $CONNECT_DOWNLOAD --strip 1 --directory sc
      sc/bin/sc --readyfile $SC_READYFILE \
        --logfile $SC_LOGFILE \
        --pidfile $SC_PIDFILE \
        --tunnel-identifier $TRAVIS_JOB_NUMBER \
        --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY > /dev/null &
      while test -f "$SC_PIDFILE" && test ! -f "$SC_READYFILE"; do sleep 5; done
      echo "SC_PIDFILE = $(cat $SC_PIDFILE) , SC_READYFILE = $(cat $SC_READYFILE)"
    fi
script:
  - if test -z "$BROWSER"; then npm test; fi
  - if test -z "$BROWSER"; then bin/test -v -v --timeout=1000 -m "not bdd"; fi
  - >
    if test -n "$BROWSER"; then
      test -s "$SC_PIDFILE" && test -f "$SC_READYFILE" && bin/test -v -v --timeout=1000 -m "bdd" --tb=short \
        --splinter-implicit-wait 1000 \
        --splinter-webdriver remote \
        --splinter-remote-url "http://$SAUCE_USERNAME:$SAUCE_ACCESS_KEY@localhost:4445/wd/hub" \
        --splinter-socket-timeout 1000 \
        --browser-arg tunnel-identifier "$TRAVIS_JOB_NUMBER" \
        --browser-arg-int build  "$TRAVIS_BUILD_NUMBER" \
        --browser-arg-int idleTimeout 1000 \
        --browser-arg name "$TRAVIS_REPO_SLUG $TRAVIS_BRANCH $TRAVIS_COMMIT" \
        --browser-arg browser "$BROWSER"
    fi
after_script:
  - >
    if test -f "$SC_PIDFILE"; then
      # NOTE: Selenium Session ID/Sauce Connect Job ID is no longer stored in sauce-connect.log
      # SAUCE_JOB_ID=`grep -m 1 /session/ "$HOME/sauce-connect.log" | cut -d / -f 7`
{'fraction_non_alphanumeric': 0.13993174061433447, 'fraction_numerical': 0.018470186709496086, 'mean_word_length': 2.447750865051903, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '3158429', 'n_tokens_mistral': 1940, 'n_tokens_neox': 1850, 'n_words': 410}