I am attempting to test PR1401 on the ansible-modules-extras submodule. I’ve followed the directions at http://docs.ansible.com/ansible/developing_test_pr.html and https://help.github.com/articles/checking-out-pull-requests-locally/ with no success. I think it’s the submodule that is tripping me up. But I’m hoping for some guidance. I’m running git and ansible on mac os x. I be most grateful if someone could show me the correct incantation to get that PR on a branch for testing.
Thanks in advance.
Brian_Coca
(Brian Coca)
December 28, 2015, 7:47pm
2
I do the following:
cd ansible/lib/ansible/modules/extras
git fetch origin pull/<pr number>/head:test_pr_branch
git checkout test_pr_branch
and now ansible will be 'seeing' the specific code, to reset just do
cd ..
git submodule update
^ that will reset the submodules to the correct point for the current
ansible checkout.
you could also just cherry-pick or merge the changes in case your
tests involve more current versions of other modules also.
once in a while you might want to delete the extra pull branches or
`git branch` takes up lots of screen
sivel
(sivel)
December 28, 2015, 7:47pm
3
I believe these are the steps you want to take, from start, to finish:
git clone https://github.com/ansible/ansible.git
cd ansible
git submodule init
git submodule update --recursive
cd lib/ansible/modules/extras
git fetch origin pull/1412/head:pr/1412
git checkout pr/1412
[ DO YOUR TESTING HERE ]
cd /path/to/ansible/clone
git submodule update --recursive
I’m going to assume by PR 1401, you were referencing Issue 1401, which has a PR at 1412.
Thank you!
I screwed up step 6. Indeed, the PR is 1412 for Issue 1401. Somehow I failed to discern the difference and was attempting to pull the wrong numerical ID.
IMO, the ansible documentation topic, “Finding A Pull Request and Checking It Out On A Branch” would be better by including your steps than the ‘someuser’ and ‘featurebranchname’ semantics currently recommended.
I’m off to test.
Best regards,
Jim
Thanks. I agree. I’ll work on this.