diff --git a/reproducer.yml b/reproducer.yml index f5433b3544..96c40f2529 100644 --- a/reproducer.yml +++ b/reproducer.yml @@ -120,6 +120,7 @@ dest: "zuul@controller-0:{{ sync_dir }}" archive: true recursive: true + ignore_errors: true # NOTE(dpawlik): After calling reproducer role using ZIronic tool, # when the bootstrap phase has been completed, it generates a file @@ -143,9 +144,24 @@ ansible.builtin.command: cmd: "$HOME/deploy-architecture.sh {{ cifmw_deploy_architecture_args | default('') }}" + - name: Ensure ci-framework-data logs are writable on controller-0 + when: + - cifmw_run_post_deployment | default(false) | bool + - not cifmw_deploy_reproducer_env | default(true) | bool + delegate_to: controller-0 + become: true + ansible.builtin.shell: + cmd: >- + chown -R zuul:zuul {{ ansible_user_dir }}/ci-framework-data/logs && + chmod -R u+rwX {{ ansible_user_dir }}/ci-framework-data/logs + changed_when: false + ignore_errors: true + - name: Run post deployment if instructed to when: - - cifmw_deploy_architecture | default(false) | bool + - >- + (cifmw_deploy_architecture | default(false) | bool) or + (cifmw_run_post_deployment | default(false) | bool) - cifmw_post_deployment | default(true) | bool no_log: "{{ cifmw_nolog | default(true) | bool }}" async: "{{ 7200 + cifmw_test_operator_timeout | default(3600) }}" # 2h should be enough to deploy EDPM and rest for tests. diff --git a/roles/test_operator/tasks/run-test-operator-job.yml b/roles/test_operator/tasks/run-test-operator-job.yml index 66e8adaec9..a1383d2fa6 100644 --- a/roles/test_operator/tasks/run-test-operator-job.yml +++ b/roles/test_operator/tasks/run-test-operator-job.yml @@ -69,10 +69,37 @@ ignore_errors: true register: testpod + - name: Wait for all workflow pods to reach terminal state - {{ run_test_fw }} + when: + - test_operator_workflow | length > 1 + kubernetes.core.k8s_info: + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" + api_key: "{{ cifmw_openshift_token | default(omit) }}" + context: "{{ cifmw_openshift_context | default(omit) }}" + namespace: "{{ stage_vars_dict.cifmw_test_operator_namespace }}" + kind: Pod + label_selectors: + - "instanceName={{ test_operator_instance_name }}" + retries: "{{ (cifmw_test_operator_timeout / 10) | round | int }}" + delay: 10 + until: > + _all_wf_pods.resources | length > 0 and + _all_wf_pods.resources | + map(attribute='status.phase') | + reject('in', ['Succeeded', 'Failed']) | + list | length == 0 + ignore_errors: true + register: _all_wf_pods + - name: Check whether timed out - {{ run_test_fw }} + vars: + _last_step_timed_out: >- + {{ testpod.attempts == (cifmw_test_operator_timeout / 10) | round | int }} + _all_wf_timed_out: >- + {{ (_all_wf_pods.attempts | default(0)) == (cifmw_test_operator_timeout / 10) | round | int }} ansible.builtin.set_fact: testpod_timed_out: >- - {{ testpod.attempts == (cifmw_test_operator_timeout / 10) | round | int }} + {{ _last_step_timed_out or _all_wf_timed_out }} - name: Collect logs when: