<commit_before>---
sudo: required

env:
    - distribution: centos
      version: 6
      init: /sbin/init
      run_opts: ""
    - distribution: centos
      version: 7
      init: /usr/lib/systemd/systemd
      run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
    - distribution: ubuntu
      version: 14.04
      init: /sbin/init
      run_opts: ""
    - distribution: ubuntu
      version: 12.04
      init: /sbin/init
      run_opts: ""

services:
  - docker

before_install:
  - 'sudo docker pull ${distribution}:${version}'
  - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'

script:
  - container_id=$(mktemp)
  # Run container in detached state
  - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-role-selenium:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"'

  # Ansible syntax check.
  - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/ansible-role-selenium/tests/test.yml --syntax-check'

  # Test role.
  - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/ansible-role-selenium/tests/test.yml'

  # Test role idempotence.
  - >
    sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-role-selenium/tests/test.yml
    | grep -q 'changed=0.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)

  # Clean up
  - 'sudo docker stop "$(cat ${container_id})"'

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/

<commit_msg>Fix test for validation install<commit_after>---
sudo: required

env:
    - distribution: centos
      version: 6
      init: /sbin/init
      run_opts: ""
    - distribution: centos
      version: 7
      init: /usr/lib/systemd/systemd
      run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
    - distribution: ubuntu
      version: 14.04
      init: /sbin/init
      run_opts: ""
    - distribution: ubuntu
      version: 12.04
      init: /sbin/init
      run_opts: ""

services:
  - docker

before_install:
  - 'sudo docker pull ${distribution}:${version}'
  - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'

script:
  - container_id=$(mktemp)
  # Run container in detached state
  - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-role-selenium:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"'

  # Ansible syntax check.
  - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/ansible-role-selenium/tests/test.yml --syntax-check'

  # Test role.
  - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/ansible-role-selenium/tests/test.yml'

  # Test role idempotence.
  - >
    sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-role-selenium/tests/test.yml
    | grep -q 'failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)

  # Clean up
  - 'sudo docker stop "$(cat ${container_id})"'

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/


{'fraction_non_alphanumeric': 0.16251830161054173, 'fraction_numerical': 0.00849194729136164, 'mean_word_length': 3.1862745098039214, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '3978173', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1157, 'n_words': 254}