<commit_before>language: php

php:
  - 5.5

env:
  global:
    - HOST=www.ocr-correction.local
    - BROWSER=firefox

before_install:
  # Selenium
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - "wget http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar"
  # - "java -jar selenium-server-standalone-2.39.0.jar -Dwebdriver.chrome.driver=/usr/bin/chromedriver > /dev/null &"
  - "java -jar selenium-server-standalone-2.39.0.jar > /dev/null &"
  - sleep 10

install:
  # Install dependencies
  - sh -e .travis/scripts/apt-get.sh

before_script:

  # Apache config
  # enable php-fpm because Travis doesn't do libapache2-mod-php5
  - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  - sh -e .travis/scripts/apache2-configure.sh
  - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm

  # Apache web server config for vhosts
  - sh -e .travis/scripts/apache2-vhost.sh "$HOST"

  # PHP config
  - phpenv config-add .travis/travis.php.ini

  # Restart Apache
  - sudo service apache2 restart
  
  # CouchDB configuration
  - curl -X PUT "http://localhost:5984/ocr"
  - curl -X PUT "http://localhost:5984/ocr/_design/page" -H "Content-Type:application/json" -d@.travis/couchdb/page.json
  - curl -X PUT "http://localhost:5984/ocr/_design/textDiff" -H "Content-Type:application/json" -d@.travis/couchdb/textDiff.json

script:
  # - phpunit -c Tests/chrome.phpunit.xml --stderr
  - phpunit -c Tests/$BROWSER.phpunit.xml --stderr<commit_msg>Would help to start CouchDB on Travis<commit_after>language: php

php:
  - 5.5

env:
  global:
    - HOST=www.ocr-correction.local
    - BROWSER=firefox

before_install:
  # Selenium
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - "wget http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar"
  # - "java -jar selenium-server-standalone-2.39.0.jar -Dwebdriver.chrome.driver=/usr/bin/chromedriver > /dev/null &"
  - "java -jar selenium-server-standalone-2.39.0.jar > /dev/null &"
  - sleep 10

install:
  # Install dependencies
  - sh -e .travis/scripts/apt-get.sh

before_script:

  # Apache config
  # enable php-fpm because Travis doesn't do libapache2-mod-php5
  - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  - sh -e .travis/scripts/apache2-configure.sh
  - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm

  # Apache web server config for vhosts
  - sh -e .travis/scripts/apache2-vhost.sh "$HOST"

  # PHP config
  - phpenv config-add .travis/travis.php.ini

  # Restart Apache
  - sudo service apache2 restart
  
  # CouchDB configuration
  - sudo service couchdb start
  - curl -X PUT "http://localhost:5984/ocr"
  - curl -X PUT "http://localhost:5984/ocr/_design/page" -H "Content-Type:application/json" -d@.travis/couchdb/page.json
  - curl -X PUT "http://localhost:5984/ocr/_design/textDiff" -H "Content-Type:application/json" -d@.travis/couchdb/textDiff.json

script:
  # - phpunit -c Tests/chrome.phpunit.xml --stderr
  - phpunit -c Tests/$BROWSER.phpunit.xml --stderr
{'fraction_non_alphanumeric': 0.15588673621460505, 'fraction_numerical': 0.022056631892697468, 'mean_word_length': 3.1077111383108935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, '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': '1137194', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1298, 'n_words': 231}