From 20b5bd446572dbe2c45322a0611ec2553809fa56 Mon Sep 17 00:00:00 2001 From: Sachin Prabhu Date: Sun, 17 May 2020 17:43:55 +0100 Subject: Allow users to specify a PR for test repo Allow users to pass variable test_repo_pr in EXTRA_VARS to test specific prs in the test repo. example: EXTRA_VARS="test_repo_pr=59" make client.test Signed-off-by: Sachin Prabhu --- vagrant/ansible/roles/client.test.prep/tasks/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vagrant/ansible/roles/client.test.prep/tasks/main.yml b/vagrant/ansible/roles/client.test.prep/tasks/main.yml index 3e95c97..98abe1d 100644 --- a/vagrant/ansible/roles/client.test.prep/tasks/main.yml +++ b/vagrant/ansible/roles/client.test.prep/tasks/main.yml @@ -1,4 +1,21 @@ --- +- block: + - name: Fetch repo/switch to master branch + git: + repo: "{{ test_repo }}" + version: "master" + dest: /root/samba-integration-tests + + - name: Fetching PR + git: + repo: "{{ test_repo }}" + refspec: +pull/{{ test_repo_pr }}/head:pr{{ test_repo_pr }} + dest: /root/samba-integration-tests + + - set_fact: + test_repo_branch: "pr{{ test_repo_pr }}" + when: test_repo_pr is defined + - debug: msg: "Preparing to checkout from test repo: {{ test_repo }}, branch {{test_repo_branch}}" -- cgit