tobiko/roles/tobiko-compile-python/tests/test_py38.yaml
Federico Ressi 293430cd65 Test Tobiko against Python 3.8.2
Change-Id: I3ffb8ddc33f2f72a0e34c6bbc84452ecdcebff04
2020-05-14 07:30:26 +02:00

84 lines
1.9 KiB
YAML

---
- hosts: all
tasks:
- name: install default system python and pip packages
become: yes
yum:
state: present
name:
- python
- python-pip
- name: check default command paths
command: "which '{{ item.command }}'"
register: which_command
changed_when: false
failed_when: 'which_command.stdout != item.path'
loop:
- command: python
path: /usr/bin/python
- command: pip
path: /usr/bin/pip
- hosts: all
roles:
- role: "{{ playbook_dir }}/../../python"
vars:
python_version: "3.8"
python_release: "3.8.0"
pip_install_packages:
- virtualenv
- tox
- hosts: all
tasks:
- name: check command paths
command: "which '{{ item.command }}'"
register: which_command
changed_when: false
failed_when: 'which_command.stdout != item.path'
loop:
- command: python
path: /usr/bin/python
- command: pip
path: /usr/bin/pip
- command: python3
path: /usr/local/bin/python3
- command: python3.8
path: /usr/local/bin/python3.8
- command: pip3
path: /usr/local/bin/pip3
- command: pip3.8
path: /usr/local/bin/pip3.8
- name: run Tobiko test cases
shell:
cmd: tox -e py38 2>&1
chdir: /vagrant
register: run_test_cases
ignore_errors: true
- name: produce test reports
shell:
cmd: tox -e report 2>&1
chdir: /vagrant
- name: get test reports
fetch:
src: "/vagrant/tobiko_results.html"
dest: "{{ playbook_dir }}/test_py38/test_results.html"
flat: yes
- name: check test cases result
assert:
that: run_test_cases.rc == 0
fail_msg: |
Test cases failed:
{{ run_test_cases.stdout }}
success_msg: |
Test cases passed