add test for git with both depth and version arguments (#15471)

* add test for ansible/ansible-modules-core#3456

combination of options version and depth

* add test of switching to older branch
This commit is contained in:
Robin Roth 2016-04-19 16:00:45 +02:00 committed by Toshio Kuratomi
parent 822f904aa6
commit e8b1c4e14a

View file

@ -559,6 +559,55 @@
- "'newtag' in listoftags.stdout_lines"
- name: clear checkout_dir
file: state=absent path={{ checkout_dir }}
# Test for https://github.com/ansible/ansible-modules-core/issues/3456
# clone a repo with depth and version specified
- name: clone repo with both version and depth specified
git:
repo: '{{ repo_depth_url }}'
dest: '{{ checkout_dir }}'
depth: 1
version: master
- name: run a second time (now fetch, not clone)
git:
repo: '{{ repo_depth_url }}'
dest: '{{ checkout_dir }}'
depth: 1
version: master
register: git_fetch
- name: ensure the fetch succeeded
assert:
that: git_fetch|success
- name: clear checkout_dir
file: state=absent path={{ checkout_dir }}
- name: clone repo with both version and depth specified
git:
repo: '{{ repo_depth_url }}'
dest: '{{ checkout_dir }}'
depth: 1
version: master
- name: switch to older branch with depth=1 (uses fetch)
git:
repo: '{{ repo_depth_url }}'
dest: '{{ checkout_dir }}'
depth: 1
version: earlybranch
register: git_fetch
- name: ensure the fetch succeeded
assert:
that: git_fetch|success
- name: clear checkout_dir
file: state=absent path={{ checkout_dir }}