ansible/test/integration/targets/git/tasks/formats.yml
Robin Roth cd02d0ca1d Cleanup git tests (#19737)
* Cleanup git tests
* Split git tests in seperate files
* Remove use of repo_depth_url
* Use native yaml
* Remove unnecessary remote/local clones
* Fix newlines for yamllint
* If the hash is valid (full-length) but doesn't exist, git returns 128 instead of 1.
* Ensure git doesn't use hardlinks for shallow clones
2017-01-06 14:38:53 -08:00

42 lines
872 B
YAML

---
- name: initial checkout
git:
repo: "{{ repo_format1 }}"
dest: "{{ repo_dir }}/format1"
register: git_result
- name: verify information about the initial clone
assert:
that:
- "'before' in git_result"
- "'after' in git_result"
- "not git_result.before"
- "git_result.changed"
- name: repeated checkout
git:
repo: "{{ repo_format1 }}"
dest: "{{ repo_dir }}/format1"
register: git_result2
- name: check for tags
stat:
path: "{{ repo_dir }}/format1/.git/refs/tags"
register: tags
- name: check for HEAD
stat:
path: "{{ repo_dir }}/format1/.git/HEAD"
register: head
- name: assert presence of tags/trunk/branches
assert:
that:
- "tags.stat.isdir"
- "head.stat.isreg"
- name: verify on a reclone things are marked unchanged
assert:
that:
- "not git_result2.changed"