Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove ansible-examples.git repo #81600

Merged
merged 3 commits into from Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/integration/targets/git/tasks/setup-local-repos.yml
Expand Up @@ -56,6 +56,16 @@
args:
chdir: "{{ repo_dir }}/shallow_branches"

- name: SETUP-LOCAL-REPOS | get ref head for test_branch
shell: git checkout test_branch && git rev-parse HEAD
args:
chdir: "{{ repo_dir }}/shallow_branches"
register: ref_head_id

- name: SETUP-LOCAL-REPOS | store ref head for test_branch
set_fact:
test_branch_ref_head_id: "{{ ref_head_id.stdout }}"

# Make this a bare one, we need to be able to push to it from clones
# We make the repo here for consistency with the other repos,
# but we finish setting it up in forcefully-fetch-tag.yml.
Expand Down
25 changes: 9 additions & 16 deletions test/integration/targets/git/tasks/specific-revision.yml
Expand Up @@ -70,11 +70,11 @@
# Same as the previous test, but this time we specify which ref
# contains the SHA1
- name: SPECIFIC-REVISION | update to revision by specifying the refspec
git:
repo: https://github.com/ansible/ansible-examples.git
git: &git_ref_spec
repo: "{{ repo_dir }}/shallow_branches/.git"
dest: '{{ checkout_dir }}'
version: 5473e343e33255f2da0b160f53135c56921d875c
refspec: refs/pull/7/merge
version: "{{ test_branch_ref_head_id }}"
refspec: refs/heads/test_branch

- name: SPECIFIC-REVISION | check HEAD after update with refspec
command: git rev-parse HEAD
Expand All @@ -84,7 +84,7 @@

- assert:
that:
- 'git_result.stdout == "5473e343e33255f2da0b160f53135c56921d875c"'
- 'git_result.stdout == test_branch_ref_head_id'

# try out combination of refspec and depth
- name: SPECIFIC-REVISION | clear checkout_dir
Expand All @@ -94,11 +94,8 @@

- name: SPECIFIC-REVISION | update to revision by specifying the refspec with depth=1
git:
repo: https://github.com/ansible/ansible-examples.git
dest: '{{ checkout_dir }}'
version: 5473e343e33255f2da0b160f53135c56921d875c
refspec: refs/pull/7/merge
depth: 1
<<: *git_ref_spec

- name: SPECIFIC-REVISION | check HEAD after update with refspec
command: git rev-parse HEAD
Expand All @@ -108,7 +105,7 @@

- assert:
that:
- 'git_result.stdout == "5473e343e33255f2da0b160f53135c56921d875c"'
- 'git_result.stdout == test_branch_ref_head_id'

- name: SPECIFIC-REVISION | try to access other commit
shell: git checkout 0ce1096
Expand All @@ -130,11 +127,7 @@
path: "{{ checkout_dir }}"

- name: SPECIFIC-REVISION | clone to revision by specifying the refspec
git:
repo: https://github.com/ansible/ansible-examples.git
dest: "{{ checkout_dir }}"
version: 5473e343e33255f2da0b160f53135c56921d875c
refspec: refs/pull/7/merge
git: *git_ref_spec

- name: SPECIFIC-REVISION | check HEAD after update with refspec
command: git rev-parse HEAD
Expand All @@ -144,7 +137,7 @@

- assert:
that:
- 'git_result.stdout == "5473e343e33255f2da0b160f53135c56921d875c"'
- 'git_result.stdout == test_branch_ref_head_id'

# Test that a forced shallow checkout referincing branch only always fetches latest head

Expand Down