<commit_before>language: php

php:
  - "5.4"
  - "5.3"

env:
  global:
    #set these here becuase they get pullout by the behat SaucelabsFactory driver
    SAUCE_USERNAME="ilios"
    SAUCE_ACCESS_KEY="<KEY>"

addons:
  hosts:
    - precise64
  # sauce_connect addon is current disabled for pull requests so we can't use this
  # very simple way, instead we need to download sauce_connect manually
  #sauce_connect: true

# This is only necessary while sauce_connect is being disabled in pull requests
before_script:
  - curl -L https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash

before_install:
  - composer self-update
  - sudo apt-get update

install:
  # Install composer packages in the app root. This will set up phing.
  - composer install

# Provision web server for Behat tests
  - "sudo apt-get install -y --force-yes mysql-server apache2 libapache2-mod-php5 php5-mysql php5-ldap sendmail expect > /dev/null"
  - "sudo /usr/sbin/a2enmod rewrite && sudo /usr/sbin/a2enmod headers && sudo /usr/sbin/a2enmod ssl"
  - "sudo /bin/ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl"
  - "(cd /etc/apache2/sites-enabled && sudo /usr/bin/find . -! -type d -exec /bin/sed -i '/<Directory \\/var\\/www\\/>/,/<\\/Directory>/ { s,AllowOverride None,AllowOverride All,}' {} \\;)"
  - "sudo /usr/bin/find /etc/apache2/sites-enabled -! -type d -exec /bin/sed -i \"s,/var/www,${PWD}/web,g\" {} \\;"
  - sudo sed -i -e "/DocumentRoot/i\ServerName precise64" /etc/apache2/sites-available/default
  - "sudo /etc/init.d/apache2 restart"

# Install Behat
  - composer install -d tests/behat

# Install PHPUnit
  - composer install -d tests/phpunit

  # Start Selenium standalone server for Behat tests
  - "java -jar ${PWD}/tests/behat/bin/selenium-server.jar -role hub > /dev/null &"

# Install the Ilios PHP app locally for PHPUnit testing
  - bin/phing -q -propertyfile build.properties.sample -Dskip-prompt=true -Dskip-db-backup=true -Ddb.username=root -Ddb.password= -Ddb.group=ilios_test -Dencryption_key=lorem_ipsum -Ddeploydir=${PWD}/web -Dbackupdir=${PWD}/backup -Dwebuser=${USER} -Dwebgroup="`id -g -n`"

# Start Phantom for headless Behat tests
  - "phantomjs --webdriver=8080 --webdriver-selenium-grid-hub=http://127.0.0.1:4444 --ignore-ssl-errors=true > /dev/null &"



script:
# Run Jasmine tests
  - phantomjs tests/jasmine/run-jasmine.js tests/jasmine/SpecRunner.html
# Run PHPUnit tests
  - "${PWD}/tests/phpunit/bin/phpunit -c ${PWD}/tests/phpunit/default.phpunit.xml --include-path ${PWD}/tests/phpunit --exclude-group integration tests/phpunit/Ilios"

# Because the PHPUnit tests unfortunately pollute the database, do a clean reinstall before running Behat tests.
  - bin/phing db-install -q -propertyfile build.properties.sample -Dskip-prompt=true -Dskip-db-backup=true -Ddb.username=root -Ddb.password= -Ddb.group=ilios_test -Dencryption_key=lorem_ipsum -Ddeploydir=${PWD}/web -Dbackupdir=${PWD}/backup -Dwebuser=${USER} -Dwebgroup="`id -g -n`"

# Run Behat tests on headless browsers
  - "(cd tests/behat && bin/behat --tags ~@ignore -p travis)"

# Ensure we have a fresh DB between behat runs
  - bin/phing db-install -q -propertyfile build.properties.sample -Dskip-prompt=true -Dskip-db-backup=true -Ddb.username=root -Ddb.password= -Ddb.group=ilios_test -Dencryption_key=lorem_ipsum -Ddeploydir=${PWD}/web -Dbackupdir=${PWD}/backup -Dwebuser=${USER} -Dwebgroup="`id -g -n`"

# Run Behat tests on GUI browsers via Sauce against the default Firefox on windows 7
  - "(cd tests/behat && bin/behat --tags ~@ignore -c sauce.yml)"

# Run Behat tests on GUI browsers via Sauce against IE 9 on windows
  - "(cd tests/behat && bin/behat --tags ~@ignore -c sauce.yml --profile win7ie9)"
<commit_msg>Use a fresh database for each behat run<commit_after>language: php

php:
  - "5.4"
  - "5.3"

env:
  global:
    #set these here becuase they get pullout by the behat SaucelabsFactory driver
    SAUCE_USERNAME="ilios"
    SAUCE_ACCESS_KEY="<KEY>"

addons:
  hosts:
    - precise64
  # sauce_connect addon is current disabled for pull requests so we can't use this
  # very simple way, instead we need to download sauce_connect manually
  #sauce_connect: true

# This is only necessary while sauce_connect is being disabled in pull requests
before_script:
  - curl -L https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash

before_install:
  - composer self-update
  - sudo apt-get update

install:
  # Install composer packages in the app root. This will set up phing.
  - composer install

# Provision web server for Behat tests
  - "sudo apt-get install -y --force-yes mysql-server apache2 libapache2-mod-php5 php5-mysql php5-ldap sendmail expect > /dev/null"
  - "sudo /usr/sbin/a2enmod rewrite && sudo /usr/sbin/a2enmod headers && sudo /usr/sbin/a2enmod ssl"
  - "sudo /bin/ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl"
  - "(cd /etc/apache2/sites-enabled && sudo /usr/bin/find . -! -type d -exec /bin/sed -i '/<Directory \\/var\\/www\\/>/,/<\\/Directory>/ { s,AllowOverride None,AllowOverride All,}' {} \\;)"
  - "sudo /usr/bin/find /etc/apache2/sites-enabled -! -type d -exec /bin/sed -i \"s,/var/www,${PWD}/web,g\" {} \\;"
  - sudo sed -i -e "/DocumentRoot/i\ServerName precise64" /etc/apache2/sites-available/default
  - "sudo /etc/init.d/apache2 restart"

# Install Behat
  - composer install -d tests/behat

# Install PHPUnit
  - composer install -d tests/phpunit

  # Start Selenium standalone server for Behat tests
  - "java -jar ${PWD}/tests/behat/bin/selenium-server.jar -role hub > /dev/null &"

# Install the Ilios PHP app locally for PHPUnit testing
  - bin/phing -q -propertyfile build.properties.sample -Dskip-prompt=true -Dskip-db-backup=true -Ddb.username=root -Ddb.password= -Ddb.group=ilios_test -Dencryption_key=lorem_ipsum -Ddeploydir=${PWD}/web -Dbackupdir=${PWD}/backup -Dwebuser=${USER} -Dwebgroup="`id -g -n`"

# Start Phantom for headless Behat tests
  - "phantomjs --webdriver=8080 --webdriver-selenium-grid-hub=http://127.0.0.1:4444 --ignore-ssl-errors=true > /dev/null &"



script:
# Run Jasmine tests
  - phantomjs tests/jasmine/run-jasmine.js tests/jasmine/SpecRunner.html
# Run PHPUnit tests
  - "${PWD}/tests/phpunit/bin/phpunit -c ${PWD}/tests/phpunit/default.phpunit.xml --include-path ${PWD}/tests/phpunit --exclude-group integration tests/phpunit/Ilios"

# Because the PHPUnit tests unfortunately pollute the database, do a clean reinstall before running Behat tests.
  - bin/phing db-install -q -propertyfile build.properties.sample -Dskip-prompt=true -Dskip-db-backup=true -Ddb.username=root -Ddb.password= -Ddb.group=ilios_test -Dencryption_key=lorem_ipsum -Ddeploydir=${PWD}/web -Dbackupdir=${PWD}/backup -Dwebuser=${USER} -Dwebgroup="`id -g -n`"

# Run Behat tests on headless browsers
  - "(cd tests/behat && bin/behat --tags ~@ignore -p travis)"

# Ensure we have a fresh DB between behat runs
  - bin/phing db-install -q -propertyfile build.properties.sample -Dskip-prompt=true -Dskip-db-backup=true -Ddb.username=root -Ddb.password= -Ddb.group=ilios_test -Dencryption_key=lorem_ipsum -Ddeploydir=${PWD}/web -Dbackupdir=${PWD}/backup -Dwebuser=${USER} -Dwebgroup="`id -g -n`"

# Run Behat tests on GUI browsers via Sauce against the default Firefox on windows 7
  - "(cd tests/behat && bin/behat --tags ~@ignore -c sauce.yml)"

# Ensure we have a fresh DB between behat runs
  - bin/phing db-install -q -propertyfile build.properties.sample -Dskip-prompt=true -Dskip-db-backup=true -Ddb.username=root -Ddb.password= -Ddb.group=ilios_test -Dencryption_key=lorem_ipsum -Ddeploydir=${PWD}/web -Dbackupdir=${PWD}/backup -Dwebuser=${USER} -Dwebgroup="`id -g -n`"

# Run Behat tests on GUI browsers via Sauce against IE 9 on windows
  - "(cd tests/behat && bin/behat --tags ~@ignore -c sauce.yml --profile win7ie9)"

{'fraction_non_alphanumeric': 0.13869537682077265, 'fraction_numerical': 0.01266624445851805, 'mean_word_length': 3.672189349112426, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 2, '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': '442948', 'n_tokens_mistral': 2893, 'n_tokens_neox': 2753, 'n_words': 729}