<commit_before>os: linux
dist: xenial
language: python

branches:
  only:
    - master
    - /^v[0-9]+\.[0-9]+$/

env:
  global:
    - IS_NIGHTLY_BUILD=$([ "${TRAVIS_EVENT_TYPE}" = "cron" ] && echo "yes" || echo "no")
    # NOTE: We only enable coverage for master builds and not pull requests
    # since it has huge performance overhead (tests are 50% or so slower)
    - ENABLE_COVERAGE=$([ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${IS_NIGHTLY_BUILD}" = "no" ] && echo "yes" || echo "no")
    # We need to explicitly specify terminal width otherwise some CLI tests fail on container
    # environments where small terminal size is used.
    - COLUMNS=120
    - PYLINT_CONCURRENCY=2
    # We only run tests with "--with-timer" flag on master and not for PRs since it adds 1-2
    # # minutes of overhead to each build.
    - NOSE_TIME=$([ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${IS_NIGHTLY_BUILD}" = "no" ] && echo "yes" || echo "no")
    # Travis-specific st2.conf (with travis user instead of stanley)
    - ST2_CONF=conf/st2.travis.conf
jobs:
  include:
    # NOTE: We combine builds because Travis offers a maximum of 5 concurrent
    # builds and having 6 tasks / builds means 1 tasks will need to wait for one
    # of the other 5 tasks to finish before it can start
    # NOTE: Thresholds only apply to the make target and not to the whole build
    # job which also includes "make requirements" and other steps
    # "make requirements" can take substantially lower if the cache is purged
    # and this would cause too many intermediate failures / false positives
    # NOTE: TASK is inspected in commands below and other travis scripts.
    # For example, ci-py3* targets trigger an alternate virtualenv build method.
    # If you rename or reorder make targets in TASK, you may need to adjust:
    # scripts/travis/install-requirements.sh
    # scripts/travis/run-nightly-make-task-if-exists.sh
    - env: TASK=ci-unit CACHE_NAME=py2 COMMAND_THRESHOLD=700
      python: 2.7
      name: "Unit Tests (Python 2.7 MongoDB 3.4)"
    - env: TASK=ci-integration CACHE_NAME=py2 COMMAND_THRESHOLD=700
      python: 2.7
      name: "Integration Tests (Python 2.7)"
    - env: TASK="ci-checks ci-packs-tests" CACHE_NAME=py2 COMMAND_THRESHOLD=430
      python: 2.7
      name: "Lint Checks, Packs Tests (Python 2.7)"
    - env: TASK="compilepy3 ci-py3-unit ci-py3-packs-tests" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=750
      python: 3.6
      name: "Unit Tests, Pack Tests (Python 3.6)"
    - env: TASK="ci-py3-integration" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=770
      python: 3.6
      name: "Integration Tests (Python 3.6)"

addons:
  apt:
    sources:
      - sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse'
        key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc'
    packages:
      - mongodb-org-server=3.4.*
      - mongodb-org-shell=3.4.*
      - rabbitmq-server
      - libffi-dev

cache:
  pip: true
  directories:
    # NOTE: If using a custom "install" step aka overriding "install" step, "cache.pip: true" doesn't work
    # and directory needs to be explicitly added to the cache.
    # See https://github.com/travis-ci/travis-ci/issues/3239, https://github.com/oppia/oppia/pull/5281 for details.
    - $HOME/.cache/pip
    - virtualenv/
    # NOTE: Caching .tox speeds up py3 build for 30-60 seconds, but causes issues when dependencies
    # are updated so it's disabled
    #- .tox/

before_install:
  # If you update these versions, make sure you update the versions in the .st2client-install-check
  # and the requirements targets in the Makefile to match
  - pip install --upgrade "pip>=19.3.1"
  - sudo pip install --upgrade "virtualenv==16.6.0"<commit_msg>[skip ci] Betterize Travis job descriptions<commit_after>os: linux
dist: xenial
language: python

branches:
  only:
    - master
    - /^v[0-9]+\.[0-9]+$/

env:
  global:
    - IS_NIGHTLY_BUILD=$([ "${TRAVIS_EVENT_TYPE}" = "cron" ] && echo "yes" || echo "no")
    # NOTE: We only enable coverage for master builds and not pull requests
    # since it has huge performance overhead (tests are 50% or so slower)
    - ENABLE_COVERAGE=$([ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${IS_NIGHTLY_BUILD}" = "no" ] && echo "yes" || echo "no")
    # We need to explicitly specify terminal width otherwise some CLI tests fail on container
    # environments where small terminal size is used.
    - COLUMNS=120
    - PYLINT_CONCURRENCY=2
    # We only run tests with "--with-timer" flag on master and not for PRs since it adds 1-2
    # # minutes of overhead to each build.
    - NOSE_TIME=$([ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${IS_NIGHTLY_BUILD}" = "no" ] && echo "yes" || echo "no")
    # Travis-specific st2.conf (with travis user instead of stanley)
    - ST2_CONF=conf/st2.travis.conf
jobs:
  include:
    # NOTE: We combine builds because Travis offers a maximum of 5 concurrent
    # builds and having 6 tasks / builds means 1 tasks will need to wait for one
    # of the other 5 tasks to finish before it can start
    # NOTE: Thresholds only apply to the make target and not to the whole build
    # job which also includes "make requirements" and other steps
    # "make requirements" can take substantially lower if the cache is purged
    # and this would cause too many intermediate failures / false positives
    # NOTE: TASK is inspected in commands below and other travis scripts.
    # For example, ci-py3* targets trigger an alternate virtualenv build method.
    # If you rename or reorder make targets in TASK, you may need to adjust:
    # scripts/travis/install-requirements.sh
    # scripts/travis/run-nightly-make-task-if-exists.sh
    - name: "Unit Tests (Python 2.7 MongoDB 3.4)"
      python: 2.7
      env: TASK=ci-unit CACHE_NAME=py2 COMMAND_THRESHOLD=700

    - name: "Integration Tests (Python 2.7)"
      python: 2.7
      env: TASK=ci-integration CACHE_NAME=py2 COMMAND_THRESHOLD=700

    - name: "Lint Checks, Packs Tests (Python 2.7)"
      python: 2.7
      env: TASK="ci-checks ci-packs-tests" CACHE_NAME=py2 COMMAND_THRESHOLD=430

    - name: "Unit Tests, Pack Tests (Python 3.6)"
      python: 3.6
      env: TASK="compilepy3 ci-py3-unit ci-py3-packs-tests" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=750

    - name: "Integration Tests (Python 3.6)"
      python: 3.6
      env: TASK="ci-py3-integration" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=770

addons:
  apt:
    sources:
      - sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse'
        key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc'
    packages:
      - mongodb-org-server=3.4.*
      - mongodb-org-shell=3.4.*
      - rabbitmq-server
      - libffi-dev

cache:
  pip: true
  directories:
    # NOTE: If using a custom "install" step aka overriding "install" step, "cache.pip: true" doesn't work
    # and directory needs to be explicitly added to the cache.
    # See https://github.com/travis-ci/travis-ci/issues/3239, https://github.com/oppia/oppia/pull/5281 for details.
    - $HOME/.cache/pip
    - virtualenv/
    # NOTE: Caching .tox speeds up py3 build for 30-60 seconds, but causes issues when dependencies
    # are updated so it's disabled
    #- .tox/

before_install:
  # If you update these versions, make sure you update the versions in the .st2client-install-check
  # and the requirements targets in the Makefile to match
  - pip install --upgrade "pip>=19.3.1"
  - sudo pip install --upgrade "virtualenv==16.6.0"
{'fraction_non_alphanumeric': 0.1102072946733141, 'fraction_numerical': 0.02676462870637628, 'mean_word_length': 3.1160907127429804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '5948853', 'n_tokens_mistral': 2672, 'n_tokens_neox': 2487, 'n_words': 822}