From ab0b3abb75bdc6c4a1d86a59c08b87246cd2b025 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 6 Dec 2018 16:30:11 +0000 Subject: [PATCH] Zuul: Simplify the integrated test playbooks When using the integrated repo for testing, only the openstack-ansible repository can be used to kick off the tests - so if any other repo uses it, it will always be the same path. The existing implementation modeled from the openstack-ansible-tests repo which implemented a job and set of playbooks which would allow the tests to execute from any one of the other repositories - which is not the case here. There is therefore no reason to have this path be dynamic in any way, so we hard code it to where we know zuul has it. We also remove other unnecessary fact setting and ensure that bash is used when running gate-check-commit. Change-Id: I17780e48cac97b1f3888b8cb264c284d8ece44a1 --- zuul.d/playbooks/post.yml | 20 ++++---------------- zuul.d/playbooks/run.yml | 24 +++++------------------- 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/zuul.d/playbooks/post.yml b/zuul.d/playbooks/post.yml index 96bf5e8faa..f08cc326dd 100644 --- a/zuul.d/playbooks/post.yml +++ b/zuul.d/playbooks/post.yml @@ -15,18 +15,6 @@ - hosts: all tasks: - - name: Set current test repo (cross-repo) - set_fact: - current_test_repo: "git.openstack.org/{{ osa_test_repo }}" - when: - - osa_test_repo is defined - - - name: Set current test repo (non-cross-repo) - set_fact: - current_test_repo: "{{ zuul.project.canonical_name }}" - when: - - osa_test_repo is not defined - - name: Run log collection script shell: | source scripts/scripts-library.sh @@ -34,18 +22,18 @@ become: yes become_user: root args: - chdir: "{{ ansible_user_dir }}/src/{{ current_test_repo }}" + chdir: "src/git.openstack.org/openstack/openstack-ansible" executable: /bin/bash environment: # ZUUL_PROJECT is used by the log collection functions to enable # log collection configuration specific to OpenStack CI ZUUL_PROJECT: "{{ zuul.project.short_name }}" TEST_EXIT_CODE: "{{ zuul_success | lower }}" - GATE_LOG_DIR: "{{ ansible_user_dir }}/src/{{ current_test_repo }}/logs" + GATE_LOG_DIR: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/openstack-ansible/logs" - name: Check whether a logs folder exists stat: - path: "{{ ansible_user_dir }}/src/{{ current_test_repo }}/logs" + path: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/openstack-ansible/logs" get_attributes: no get_checksum: no get_md5: no @@ -54,7 +42,7 @@ - name: Copy logs back to the executor synchronize: - src: "{{ ansible_user_dir }}/src/{{ current_test_repo }}/logs" + src: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/openstack-ansible/logs" dest: "{{ zuul.executor.log_root }}/" mode: pull rsync_opts: diff --git a/zuul.d/playbooks/run.yml b/zuul.d/playbooks/run.yml index 2a69cdc6db..4ac10db5f8 100644 --- a/zuul.d/playbooks/run.yml +++ b/zuul.d/playbooks/run.yml @@ -1,29 +1,15 @@ - hosts: all tasks: - - name: Set the Zuul sources path - set_fact: - zuul_src_path: "{{ ansible_user_dir }}/src" - - - name: Set current test repo (cross-repo) - set_fact: - current_test_repo: "git.openstack.org/{{ osa_test_repo }}" - when: - - osa_test_repo is defined - - - name: Set current test repo (non-cross-repo) - set_fact: - current_test_repo: "{{ zuul.project.canonical_name }}" - when: - - osa_test_repo is not defined - - name: Run gate-check-commit.sh script become: yes become_user: root - command: "scripts/gate-check-commit.sh {{ scenario }} {{ action }} {{ install_method }}" + shell: >- + scripts/gate-check-commit.sh {{ scenario }} {{ action }} {{ install_method }} args: - chdir: "src/{{ current_test_repo }}" + chdir: "src/git.openstack.org/openstack/openstack-ansible" + executable: /bin/bash environment: # ZUUL_SRC_PATH is used by tests/get-ansible-role-requirements to # where the CI provided git sources were cloned. - ZUUL_SRC_PATH: "{{ zuul_src_path }}" + ZUUL_SRC_PATH: "{{ ansible_user_dir }}/src" ANSIBLE_PACKAGE: "{{ ansible_package | default('') }}"