<commit_before>language: python
python:
  - 2.7

services:
  - mongodb

env:
  matrix:
    - SERVICE_CONFIG_FILE=./config/services.mongodb.conf

before_install:
  - pip install pymongo
  - pip install bottle
  - pip install httplib2
  - pip install voluptuous

install:
  - python setup.py install
  - .travis-data/run_dbservice_daemon.sh

script:
  - nosetests -v<commit_msg>updated TravisCI recipe with elasticsearch<commit_after>language: python
python:
  - 2.7

env:
  matrix:
    - DB_ENGINE=mongodb
    - DB_ENGINE=elasticsearch

before_install:
  # start proper service
  - if [[ "$DB_ENGINE" == "mongodb" ]]; then sudo service mongodb start; fi
  - if [[ "$DB_ENGINE" == "elasticsearch" ]]; then sudo service elasticsearch start; fi
  # install Python dependencies
  - if [[ "$DB_ENGINE" == "mongodb" ]]; then pip install pymongo; fi
  - if [[ "$DB_ENGINE" == "elasticsearch" ]]; then pip install elasticsearch; fi
  - pip install bottle
  - pip install httplib2
  - pip install voluptuous
  # export proper configuration file
  - if [[ "$DB_ENGINE" == "mongodb" ]]; then export SERVICE_CONFIG_FILE=./config/services.mongodb.conf; fi
  - if [[ "$DB_ENGINE" == "elasticsearch" ]]; then export SERVICE_CONFIG_FILE=./config/services.elasticsearch.conf; fi
  - pip install nose-exclude

install:
  - python setup.py install
  - .travis-data/run_dbservice_daemon.sh

before-script:
  - if [[ "$DB_ENGINE" == "mongodb" ]]; then export EXCLUDE_TEST_MODULE=test.openehr.ehr.services.dbmanager.drivers.test_elasticsearch.TestElasticSearchDriver; fi
  - if [[ "$DB_ENGINE" == "elasticsearch" ]]; then export EXCLUDE_TEST_MODULE=test.openehr.ehr.services.dbmanager.drivers.test_mongo.TestMongoDBDriver; fi
  
script:
  - nosetests -v -w test --exclude-test=$EXCLUDE_TEST_MODULE
{'fraction_non_alphanumeric': 0.12119503945885006, 'fraction_numerical': 0.0033821871476888386, 'mean_word_length': 4.0141242937853105, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2163051', 'n_tokens_mistral': 624, 'n_tokens_neox': 602, 'n_words': 138}