diff --git a/.zuul.yaml b/.zuul.yaml index 5a04f41..2c36179 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -27,6 +27,13 @@ - openstack/requirements roles: - zuul: openstack/devstack + vars: + zuul_copy_output: + "{{ zuul.projects['opendev.org/osf/refstack-client'].src_dir }}/etc/accounts.yaml": logs + "{{ zuul.projects['opendev.org/osf/refstack-client'].src_dir }}/etc/tempest.conf": logs + "{{ zuul.projects['opendev.org/osf/refstack-client'].src_dir }}/.tempest/.stestr/1.json": logs + "{{ zuul.projects['opendev.org/osf/refstack-client'].src_dir }}/.tempest/.stestr/1": logs + "{{ zuul.projects['opendev.org/osf/refstack-client'].src_dir }}/.tempest/tempest.log": logs run: playbooks/refstack-client-devstack.yaml irrelevant-files: - ^.*\.md$ diff --git a/defaults/main.yaml b/defaults/main.yaml index a7c5d1c..41a8404 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -3,6 +3,8 @@ # there, otherwise the role assumes that's the refstack-client a user wanna # execute (mainly used in CI for Zuul jobs to test the changes) refstack_client_source: "~/.refstack-client" +# default refstack-client version used is the master +refstack_client_version: "HEAD" # it will upload the result of the refstack-client to the server # (refstack server by default, see server variable) @@ -10,14 +12,11 @@ upload_results: false server: "https://refstack.openstack.org/api" download_artifacts: false -url_cirros_image: "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img" - # Local directory where the files will be stored dest_dir: "{{ lookup('env', 'PWD') }}" + # the latest guideline by default guideline: "2020.06" -# default refstack-client version used is the master -refstack_client_version: "HEAD" - +url_cirros_image: "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img" # a concurrency accounts.yaml file is generated with by tempest tempest_account_concurrency: 3 diff --git a/tasks/generate-accounts.yaml b/tasks/generate-accounts.yaml index d490771..deac8a6 100644 --- a/tasks/generate-accounts.yaml +++ b/tasks/generate-accounts.yaml @@ -31,6 +31,14 @@ chdir: "{{ refstack_client_source }}" when: additional_tempestconf_params is defined +- name: Cat generated tempest.conf file + shell: | + cat ./etc/tempest.conf + args: + executable: /bin/bash + chdir: "{{ refstack_client_source }}" + changed_when: false + - name: Generate tempest accounts.yaml file shell: | set -ex diff --git a/tasks/generate-tempestconf.yaml b/tasks/generate-tempestconf.yaml index d763ed6..b080608 100644 --- a/tasks/generate-tempestconf.yaml +++ b/tasks/generate-tempestconf.yaml @@ -13,6 +13,14 @@ executable: /bin/bash changed_when: tempest_config_path is not defined +- name: Cat generated tempest.conf file + shell: | + cat ./etc/tempest.conf + args: + executable: /bin/bash + chdir: "{{ refstack_client_source }}" + changed_when: false + - name: Set path to newly generated tempest.conf set_fact: path_to_tempest_config: "./etc/tempest.conf" diff --git a/tasks/post-tasks.yaml b/tasks/post-tasks.yaml index 93d8188..766fccb 100644 --- a/tasks/post-tasks.yaml +++ b/tasks/post-tasks.yaml @@ -2,14 +2,10 @@ # The task finds the latest result file in case there are more of them # e.g. refstack-client was already executed in the current env - name: Find the test result json file - shell: | - set -o pipefail -ex - ls | grep "\.json" | tail -1 + find: + path: "{{ refstack_client_source }}/.tempest/.stestr" + patterns: '*.json' register: ls_out - args: - chdir: "{{ refstack_client_source }}/.tempest/.stestr" - executable: /bin/bash - changed_when: false - when: upload_results | bool block: @@ -30,7 +26,7 @@ shell: | set -ex source .venv/bin/activate - refstack-client upload -y ".tempest/.stestr/{{ ls_out.stdout }}" \ + refstack-client upload -y "{{ ls_out.files[-1].path }}" \ --url {{ server }} \ -i {{ private_key_path }} register: upload_out @@ -50,13 +46,13 @@ block: - name: Download results file in .json fetch: - src: "{{ refstack_client_source }}/.tempest/.stestr/{{ ls_out.stdout }}" + src: "{{ ls_out.files[-1].path }}" dest: "{{ dest_dir }}/test_results.json" flat: true - name: Download results file in subunit fetch: - src: "{{ refstack_client_source }}/.tempest/.stestr/{{ ls_out.stdout | splitext | first }}" + src: "{{ ls_out.files[-1].path | splitext | first }}" dest: "{{ dest_dir }}/test_results_subunit" flat: true @@ -66,7 +62,7 @@ dest: "{{ dest_dir }}/upload_output.txt" mode: '0644' delegate_to: localhost - when: upload_out is defined + when: upload_results | bool - name: Download tempest.conf file fetch: