You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/hg/tasks/main.yml

53 lines
2.2 KiB
YAML

11 years ago
# test code for the hg module
# (c) 2014, James Tanner <tanner.jc@gmail.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
- name: determine if mercurial is already installed
command: which hg
register: has_hg
ignore_errors: yes
- name: warn if the underlying system is not capable of running these tests
debug:
msg: >-
The mercurial client is not able to check out Bitbucket repositories as per the changes mentioned here:
https://bitbucket.org/blog/deprecating-tlsv1-tlsv1-1-2018-12-01 . Therefore these tests are skipped.
when: (ansible_distribution == "Ubuntu" and ansible_distribution_version == "14.04") or ansible_python_version is version("2.7.9", "<")
- block:
- name: install mercurial
include_tasks: install.yml
when: has_hg is failed
- name: test mercurial
include_tasks: run-tests.yml
- name: uninstall mercurial
include_tasks: uninstall.yml
when: has_hg is failed
# As per the bitbucket changes in https://bitbucket.org/blog/deprecating-tlsv1-tlsv1-1-2018-12-01 , this
# test will fail under certain circumstances, to avoid false positives, we skip these tests under the following
# circumstances:
#
# - The ubuntu 14.04 image used on shippable runs python 2.7.6, so we skip explicitly for this image.
# - When ansible_python_version is not 2.7.9 or higher, mercurial is likely to also run using this same (old)
# python version, which causes issues as per the link above.
when:
- not (ansible_distribution == "Ubuntu" and ansible_distribution_version == "14.04")
- ansible_python_version is version("2.7.9", ">=")