From 126c397d6c28ec516eac1f9b47cf360dcda3f573 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 7 Jan 2021 11:53:40 +0530 Subject: [PATCH] hg: Re-enable tests (#1599) * Update license boilerplate * Change mercurial repository links Fixes: #840 Signed-off-by: Abhijeet Kasurde --- tests/integration/targets/hg/aliases | 1 - tests/integration/targets/hg/tasks/main.yml | 17 +------ .../targets/hg/tasks/run-tests.yml | 44 +++++++++---------- 3 files changed, 23 insertions(+), 39 deletions(-) diff --git a/tests/integration/targets/hg/aliases b/tests/integration/targets/hg/aliases index ef854afd0c..2f2db5bc12 100644 --- a/tests/integration/targets/hg/aliases +++ b/tests/integration/targets/hg/aliases @@ -1,4 +1,3 @@ shippable/posix/group2 skip/python3 skip/aix -disabled # tests use bitbucket, which dropped mercurial support on 2020-08-26 (https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket) diff --git a/tests/integration/targets/hg/tasks/main.yml b/tests/integration/targets/hg/tasks/main.yml index e90c2330f9..4d7efca5e2 100644 --- a/tests/integration/targets/hg/tasks/main.yml +++ b/tests/integration/targets/hg/tasks/main.yml @@ -4,22 +4,9 @@ #################################################################### # test code for the hg module -# (c) 2014, James Tanner - -# This file is part of Ansible +# Copyright: (c) 2014, James Tanner # -# 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 . +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: determine if mercurial is already installed command: which hg diff --git a/tests/integration/targets/hg/tasks/run-tests.yml b/tests/integration/targets/hg/tasks/run-tests.yml index 008eb32c50..775b297817 100644 --- a/tests/integration/targets/hg/tasks/run-tests.yml +++ b/tests/integration/targets/hg/tasks/run-tests.yml @@ -1,27 +1,16 @@ # test code for the hg module -# (c) 2018, Ansible Project - -# This file is part of Ansible +# Copyright: (c) 2018, Ansible Project # -# 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 . +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: set where to extract the repo - set_fact: checkout_dir={{ output_dir }}/epdb + set_fact: + checkout_dir: "{{ output_dir }}/hg_project_test" - name: set what repo to use - set_fact: repo=https://bitbucket.org/rpathsync/epdb + set_fact: + repo: "http://hg.pf.osdn.net/view/a/ak/akasurde/hg_project_test" - name: clean out the output_dir shell: rm -rf {{ output_dir }}/* @@ -30,7 +19,9 @@ shell: which hg - name: initial checkout - hg: repo={{ repo }} dest={{ checkout_dir }} + hg: + repo: "{{ repo }}" + dest: "{{ checkout_dir }}" register: hg_result - debug: var=hg_result @@ -46,17 +37,21 @@ - "hg_result.changed" - name: repeated checkout - hg: repo={{ repo }} dest={{ checkout_dir }} + hg: + repo: "{{ repo }}" + dest: "{{ checkout_dir }}" register: hg_result2 - debug: var=hg_result2 - name: check for tags - stat: path={{ checkout_dir }}/.hgtags + stat: + path: "{{ checkout_dir }}/.hgtags" register: tags - name: check for remotes - stat: path={{ checkout_dir }}/.hg/branch + stat: + path: "{{ checkout_dir }}/.hg/branch" register: branches - debug: var=tags @@ -68,13 +63,16 @@ - "tags.stat.isreg" - "branches.stat.isreg" -- name: verify on a reclone things are marked unchanged +- name: verify on a re-clone things are marked unchanged assert: that: - "not hg_result2.changed" - name: Checkout non-existent repo clone - hg: repo=https://bitbucket.org/pyro46/pythonscript_1 clone=no update=no + hg: + repo: "http://hg.pf.osdn.net/view/a/ak/akasurde/hg_project_test_1" + clone: no + update: no register: hg_result3 ignore_errors: true