mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 04:34:24 -07:00
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:
parent
822f904aa6
commit
e8b1c4e14a
1 changed files with 49 additions and 0 deletions
|
@ -559,6 +559,55 @@
|
||||||
- "'newtag' in listoftags.stdout_lines"
|
- "'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
|
- name: clear checkout_dir
|
||||||
file: state=absent path={{ checkout_dir }}
|
file: state=absent path={{ checkout_dir }}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue