From b73f595badc5a207d3fe9e0f048ed3b35725d770 Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Fri, 10 Jan 2025 10:37:02 +0100 Subject: [PATCH] Cleanup of infrared zuul jobs tobiko-infrared-ubuntu is removed. It always fails because infrared is not compatible with ubuntu-focal. Former tobiko-infrared is removed. It did not really test anything because there was no "primary" host in the inventory and essential ansible plays from this job need to be run on the "primary" host. Former tobiko-infrared-centos-9 is renamed to tobiko-infrared and it will only use one node. The aim of this job is just to validate the the tobiko infrared plugin works (it just executes tobiko unit and functional tests). Existing tobiko-check-collected-files ansible role has been removed. It was only used to test that results where properly generated when the tobiko infrared plugin was used, but it only work when no workflow was specify. Change-Id: I6e334014420757aafa436f42b189c932ed02ae56 --- playbooks/infrared/run.yaml | 1 - roles/tests/test_infrared_plugin.yaml | 7 --- .../meta/main.yaml | 4 -- .../tasks/main.yaml | 39 ----------------- .../vars/test-workflow-unit-functional.yaml | 10 +++++ tox.ini | 2 + zuul.d/infrared.yaml | 43 +++---------------- 7 files changed, 19 insertions(+), 87 deletions(-) delete mode 100644 roles/tobiko-check-collected-files/meta/main.yaml delete mode 100644 roles/tobiko-check-collected-files/tasks/main.yaml create mode 100644 roles/tobiko-run/vars/test-workflow-unit-functional.yaml diff --git a/playbooks/infrared/run.yaml b/playbooks/infrared/run.yaml index 377e8aa15..698e84ca1 100644 --- a/playbooks/infrared/run.yaml +++ b/playbooks/infrared/run.yaml @@ -3,4 +3,3 @@ - hosts: primary roles: - tox - - tobiko-check-collected-files diff --git a/roles/tests/test_infrared_plugin.yaml b/roles/tests/test_infrared_plugin.yaml index d574f508d..c28dbd0ed 100644 --- a/roles/tests/test_infrared_plugin.yaml +++ b/roles/tests/test_infrared_plugin.yaml @@ -50,10 +50,3 @@ debug: var=run_tox.stderr_lines when: run_tox is failed failed_when: yes - - -- hosts: primary - vars: - test_collect_dir: '{{ test_dir }}/test_results' - roles: - - tobiko-check-collected-files diff --git a/roles/tobiko-check-collected-files/meta/main.yaml b/roles/tobiko-check-collected-files/meta/main.yaml deleted file mode 100644 index 0d4361583..000000000 --- a/roles/tobiko-check-collected-files/meta/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -dependencies: - - role: tobiko-common diff --git a/roles/tobiko-check-collected-files/tasks/main.yaml b/roles/tobiko-check-collected-files/tasks/main.yaml deleted file mode 100644 index c3af73a98..000000000 --- a/roles/tobiko-check-collected-files/tasks/main.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- - -- name: "find for collected files in '{{ test_collect_dir }}'" - find: - paths: - - "{{ test_collect_dir }}" - patterns: - - "tobiko.conf" - - "tobiko.log" - - "{{ test_report_name }}*.log" - - "{{ test_report_name }}*.html" - - "{{ test_report_name }}*.xml" - register: find_collected_files - - -- name: "set collected_files fact" - set_fact: - collected_files: > - {{ find_collected_files.files | - map(attribute='path') | - map('basename') | - list }} - - -- block: - - name: "check collected files" - assert: - that: - - item in collected_files - loop: - - tobiko.log - - tobiko.conf - - '{{ test_report_name }}.log' - - '{{ test_report_name }}.html' - - '{{ test_report_name }}.xml' - - rescue: - - debug: var=collected_files - failed_when: yes diff --git a/roles/tobiko-run/vars/test-workflow-unit-functional.yaml b/roles/tobiko-run/vars/test-workflow-unit-functional.yaml new file mode 100644 index 000000000..66bfa1cbf --- /dev/null +++ b/roles/tobiko-run/vars/test-workflow-unit-functional.yaml @@ -0,0 +1,10 @@ +test_workflow_steps: + - tox_description: 'run unit tests using Python 3.9' + tox_envlist: py39 + python_version: '3.9' + bindep_profile: test py39 + test_flaky: true + + - tox_description: 'run functional test cases' + tox_envlist: functional + test_flaky: true diff --git a/tox.ini b/tox.ini index c8c07bcf5..ced2c57c2 100644 --- a/tox.ini +++ b/tox.ini @@ -393,6 +393,7 @@ setenv = IR_HOME = {env:IR_HOME:{envdir}/home/infrared} IR_TOBIKO_PLUGIN = {env:IR_TOBIKO_PLUGIN:{toxinidir}/infrared_plugin} IR_WORKSPACE_FILE = {env:IR_WORKSPACE_FILE:{toxinidir}/workspace.tgz} + IR_WORKFLOW = {env:IR_WORKFLOW:unit-functional} SETUPTOOLS_USE_DISTUTILS = stdlib commands_pre = @@ -401,6 +402,7 @@ commands_pre = commands = ir tobiko --tobiko-src-dir '{toxinidir}' \ --collect-dir '{env:TOX_REPORT_DIR}' \ + --workflow '{env:IR_WORKFLOW}' \ {posargs} diff --git a/zuul.d/infrared.yaml b/zuul.d/infrared.yaml index b38a9fc2e..621ee26a9 100644 --- a/zuul.d/infrared.yaml +++ b/zuul.d/infrared.yaml @@ -6,20 +6,19 @@ Infrared jobs intended to gate infrared Tobiko plugin changes check: jobs: - - tobiko-infrared-centos-9 + - tobiko-infrared gate: jobs: - tobiko-infrared periodic: jobs: - - tobiko-infrared-centos-9 - - tobiko-infrared-ubuntu + - tobiko-infrared - job: name: tobiko-infrared parent: tox - nodeset: centos-9-stream + nodeset: tobiko-infrared-single-node-centos-9 timeout: 3600 description: | Run test cases using tobiko infrared plugin @@ -32,7 +31,7 @@ ensure_pip_from_packages_with_python2: no test_collect_dir: '{{ zuul_output_dir }}/logs' test_inventory_file: '{{ zuul_work_dir }}/ansible_hosts' - test_inventory_groups: {undercloud: [secondary]} + test_inventory_groups: {undercloud: [primary]} tox_envlist: infrared tox_extra_args: -- --collect-dir {{ test_collect_dir | quote }} tox_environ: @@ -47,40 +46,12 @@ - ^tobiko/tests/scenario/ - ^tobiko/tests/faults/ -- job: - name: tobiko-infrared-centos-9 - parent: tobiko-infrared - nodeset: tobiko-infrared-centos-9 - voting: true - description: | - Run test cases using tobiko infrared plugin on CentOS 9 - - nodeset: - name: tobiko-infrared-centos-9 + name: tobiko-infrared-single-node-centos-9 nodes: - name: primary label: centos-9-stream - - name: secondary - label: centos-9-stream - groups: &NODESET_GROUPS + groups: - name: undercloud nodes: - - secondary - - -- job: - name: tobiko-infrared-ubuntu - parent: tobiko-infrared - nodeset: tobiko-infrared-ubuntu - voting: true - description: | - Run test cases using tobiko infrared plugin on Ubuntu - -- nodeset: - name: tobiko-infrared-ubuntu - nodes: - - name: primary - label: ubuntu-focal - - name: secondary - label: ubuntu-focal - groups: *NODESET_GROUPS + - primary