From 432d11e19d5ca1dc4a65a96a3f8a7236025d8adb Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Tue, 30 Jul 2019 22:51:23 +0300 Subject: [PATCH] [ci] Fail gracefuly in case of wrong path for task file Change-Id: I942667988e2cd76a599ffb3d9773a757c6a512df --- .../playbooks/roles/prepare-for-rally-task/tasks/main.yaml | 5 +++++ tests/ci/playbooks/run-rally-tox.yaml | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/ci/playbooks/roles/prepare-for-rally-task/tasks/main.yaml b/tests/ci/playbooks/roles/prepare-for-rally-task/tasks/main.yaml index cc0ae806..f4161de4 100644 --- a/tests/ci/playbooks/roles/prepare-for-rally-task/tasks/main.yaml +++ b/tests/ci/playbooks/roles/prepare-for-rally-task/tasks/main.yaml @@ -198,6 +198,11 @@ path: '{{ zuul.project.src_dir }}/{{ rally_task }}' register: rally_task_file_stat +- name: Fail if Rally task file is missed. + fail: + msg: "'{{ rally_task }}' Rally task file is missed." + when: rally_task_file_stat.stat.exists != True + - name: Copy task file become: True become_user: stack diff --git a/tests/ci/playbooks/run-rally-tox.yaml b/tests/ci/playbooks/run-rally-tox.yaml index 5088c939..faa8c105 100644 --- a/tests/ci/playbooks/run-rally-tox.yaml +++ b/tests/ci/playbooks/run-rally-tox.yaml @@ -9,7 +9,9 @@ rally_use_existing_users: false rally_existing_users_config: '{{ rally_home_dir }}/with-existing-users-config' rally_task_args_file: "100-percent-not-exist-file" - rally_task: "100-percent-not-exist-file" + # this task will not be launched, but we need to specify something real to + # pass a check at 'prepare-for-rally-task' role. + rally_task: "rally-jobs/simple-job.yaml" roles: - prepare-for-rally-task - run-rally-tox \ No newline at end of file