<commit_before>dist: trusty
env:
  global:
    - BROKER_URL='amqp://guest:guest@localhost:5672//'
    - DATABASE_URL='mysql://root@localhost/test_treeherder'
    - ELASTICSEARCH_URL='http://127.0.0.1:9200'
    - TREEHERDER_DJANGO_SECRET_KEY='secretkey-of-at-50-characters-to-pass-check-deploy'
matrix:
  include:
    # Each entry here creates another sub-job.

    # Job 1: Linters
    - env: python-linters
      sudo: false
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      before_install:
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      script:
        - pip check
        - python lints/queuelint.py
        - flake8 --show-source
        - isort --check-only --diff --quiet

    # Job 2: Nodejs UI tests
    - env: ui-tests
      sudo: required
      language: node_js
      node_js: "7.10.0"
      cache:
        # Note: This won't re-use the same cache as the linters job,
        # since caches are tied to the language/version combination.
        directories:
          - node_modules
      addons:
        # Not using `latest` since the test run frequently times out with Firefox 55.
        firefox: "54.0.1"
      before_install:
        # Required due to: https://github.com/travis-ci/travis-ci/issues/7951
        - curl -sSfL https://yarnpkg.com/install.sh | bash
        - export PATH=$HOME/.yarn/bin:$PATH
      install:
        # `--frozen-lockfile` will catch cases where people have forgotten to update `yarn.lock`.
        # `--no-bin-links` is only necessary on Windows hosts, but we include here to ensure
        # that the package.json scripts aren't relying on symlinks that won't exist elsewhere.
        - yarn install --frozen-lockfile --no-bin-links
      before_script:
        # Required for Karma tests (http://docs.travis-ci.com/user/gui-and-headless-browsers/)
        - export DISPLAY=:99.0
        - sh -e /etc/init.d/xvfb start
      script:
        - yarn test
        - yarn build

    # Job 3: Python Tests Chunk A
    - env: python-tests-main
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
        # Create the test database for `manage.py check --deploy`.
        - mysql -u root -e 'create database test_treeherder;'
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
      script:
        # Several security features in settings.py (eg setting HSTS headers) are conditional on
        # 'https://' being in the site URL. In addition, we override the test environment's debug
        # value so the tests pass. The real environment variable will be checked during deployment.
        - SITE_URL='https://treeherder.dev' TREEHERDER_DEBUG='False' ./manage.py check --deploy --fail-level WARNING
        - py.test tests/ --runslow --ignore=tests/e2e/ --ignore=tests/etl/ --ignore=tests/log_parser/ --ignore=tests/webapp/ --ignore=tests/selenium/ --ignore=tests/jenkins/

    # Job 4: Python Tests Chunk B
    - env: python-tests-e2e-etl-logparser
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
      script:
        - py.test tests/e2e/ tests/etl/ tests/log_parser/ --runslow

    # Job 5: Python Tests Chunk C
    - env: python-tests-webapp
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
      script:
        - py.test tests/webapp/ --runslow

    # Job 6: Python Tests - Selenium integration
    - env: python-tests-selenium
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
          - node_modules
      addons:
        # Not using `latest` since the test run frequently times out with Firefox 55.
        firefox: "54.0.1"
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
        - mkdir -p $HOME/bin
        - curl -sSfL https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz | tar -zxC $HOME/bin
        - nvm install 7.10.0
        # Required until Travis makes yarn available in the base image,
        # since it only installs it for `language: nodejs` currently.
        - curl -sSfL https://yarnpkg.com/install.sh | bash
        - export PATH=$HOME/.yarn/bin:$PATH
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
        - yarn install --frozen-lockfile --no-bin-links
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
        - "export DISPLAY=:99.0"
        - "sh -e /etc/init.d/xvfb start"
      script:
        - yarn build
        - py.test tests/selenium/ --runselenium --driver Firefox

notifications:
  email:
    on_success: never
    on_failure: always<commit_msg>Bug 1390517 - Travis: Switch to the edge (latest) Trusty image<commit_after>dist: trusty
# Use the latest Travis images since they are more up to date than the stable release.
group: edge
env:
  global:
    - BROKER_URL='amqp://guest:guest@localhost:5672//'
    - DATABASE_URL='mysql://root@localhost/test_treeherder'
    - ELASTICSEARCH_URL='http://127.0.0.1:9200'
    - TREEHERDER_DJANGO_SECRET_KEY='secretkey-of-at-50-characters-to-pass-check-deploy'
matrix:
  include:
    # Each entry here creates another sub-job.

    # Job 1: Linters
    - env: python-linters
      sudo: false
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      before_install:
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      script:
        - pip check
        - python lints/queuelint.py
        - flake8 --show-source
        - isort --check-only --diff --quiet

    # Job 2: Nodejs UI tests
    - env: ui-tests
      sudo: required
      language: node_js
      node_js: "7.10.0"
      cache:
        # Note: This won't re-use the same cache as the linters job,
        # since caches are tied to the language/version combination.
        directories:
          - node_modules
      addons:
        # Not using `latest` since the test run frequently times out with Firefox 55.
        firefox: "54.0.1"
      install:
        # `--frozen-lockfile` will catch cases where people have forgotten to update `yarn.lock`.
        # `--no-bin-links` is only necessary on Windows hosts, but we include here to ensure
        # that the package.json scripts aren't relying on symlinks that won't exist elsewhere.
        - yarn install --frozen-lockfile --no-bin-links
      before_script:
        # Required for Karma tests (http://docs.travis-ci.com/user/gui-and-headless-browsers/)
        - export DISPLAY=:99.0
        - sh -e /etc/init.d/xvfb start
      script:
        - yarn test
        - yarn build

    # Job 3: Python Tests Chunk A
    - env: python-tests-main
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
        # Create the test database for `manage.py check --deploy`.
        - mysql -u root -e 'create database test_treeherder;'
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
      script:
        # Several security features in settings.py (eg setting HSTS headers) are conditional on
        # 'https://' being in the site URL. In addition, we override the test environment's debug
        # value so the tests pass. The real environment variable will be checked during deployment.
        - SITE_URL='https://treeherder.dev' TREEHERDER_DEBUG='False' ./manage.py check --deploy --fail-level WARNING
        - py.test tests/ --runslow --ignore=tests/e2e/ --ignore=tests/etl/ --ignore=tests/log_parser/ --ignore=tests/webapp/ --ignore=tests/selenium/ --ignore=tests/jenkins/

    # Job 4: Python Tests Chunk B
    - env: python-tests-e2e-etl-logparser
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
      script:
        - py.test tests/e2e/ tests/etl/ tests/log_parser/ --runslow

    # Job 5: Python Tests Chunk C
    - env: python-tests-webapp
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
      script:
        - py.test tests/webapp/ --runslow

    # Job 6: Python Tests - Selenium integration
    - env: python-tests-selenium
      # TODO: Investigate switching back to the container infra, by setting `sudo: false`.
      sudo: required
      language: python
      python: "2.7.13"
      cache:
        directories:
          - ~/venv
          - node_modules
      addons:
        # Not using `latest` since the test run frequently times out with Firefox 55.
        firefox: "54.0.1"
      services:
        - rabbitmq
      before_install:
        - curl -sSo ~/elasticsearch.deb https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb && sudo dpkg -i --force-confold ~/elasticsearch.deb
        - sudo service elasticsearch restart
        - sudo cp vagrant/mysql.cnf /etc/mysql/conf.d/treeherder.cnf
        - echo 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
        - sudo -E apt-get -yqq update
        - sudo -E apt-get -yqq install --no-install-recommends --allow-unauthenticated mysql-server libmysqlclient-dev
        # Create a clean virtualenv rather than using the one given to us,
        # to work around: https://github.com/travis-ci/travis-ci/issues/4873
        - if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
        - source ~/venv/bin/activate
        - curl -sSfL https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz | tar -zxC $HOME/bin
        - nvm install 7.10.0
      install:
        - pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
        - yarn install --frozen-lockfile --no-bin-links
      before_script:
        - while ! curl "$ELASTICSEARCH_URL" &> /dev/null; do sleep 1; done
        - "export DISPLAY=:99.0"
        - "sh -e /etc/init.d/xvfb start"
      script:
        - yarn build
        - py.test tests/selenium/ --runselenium --driver Firefox

notifications:
  email:
    on_success: never
    on_failure: always
{'fraction_non_alphanumeric': 0.1166379894676469, 'fraction_numerical': 0.013712915167631264, 'mean_word_length': 2.166061406404754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 27, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1394156', 'n_tokens_mistral': 6290, 'n_tokens_neox': 5987, 'n_words': 1639}