From 210ea49c102b86414b12b0b82ccaa81ed831d1b0 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 23 Nov 2022 10:08:48 -0800 Subject: [PATCH] Add support for nodejs testing on Debian This updates the nodejs-test-dependencies role to install packages on Debian as well as Ubuntu. The main driver for this is Ubuntu Jammy has updated firefox to run out of a snap and getting selenium to operate in that environment has been difficult. It is theoretically possible, but rather than force users to sort it out offer Debian as an alternative. Change-Id: I51cc95046520597a02c307c5d368f492933ed263 --- .../tasks/Debian.yaml | 7 ++ .../tasks/Ubuntu.yaml | 7 ++ .../nodejs-test-dependencies/tasks/main.yaml | 24 +++---- zuul-tests.d/js-roles-jobs.yaml | 65 +++++++++++++++++++ 4 files changed, 89 insertions(+), 14 deletions(-) create mode 100644 roles/nodejs-test-dependencies/tasks/Debian.yaml create mode 100644 roles/nodejs-test-dependencies/tasks/Ubuntu.yaml diff --git a/roles/nodejs-test-dependencies/tasks/Debian.yaml b/roles/nodejs-test-dependencies/tasks/Debian.yaml new file mode 100644 index 000000000..017b64747 --- /dev/null +++ b/roles/nodejs-test-dependencies/tasks/Debian.yaml @@ -0,0 +1,7 @@ +- name: Install browsers and xvfb + apt: + name: + - chromium + - firefox-esr + - xvfb + become: true diff --git a/roles/nodejs-test-dependencies/tasks/Ubuntu.yaml b/roles/nodejs-test-dependencies/tasks/Ubuntu.yaml new file mode 100644 index 000000000..a3fb4d4ad --- /dev/null +++ b/roles/nodejs-test-dependencies/tasks/Ubuntu.yaml @@ -0,0 +1,7 @@ +- name: Install browsers and xvfb + apt: + name: + - chromium-browser + - firefox + - xvfb + become: true diff --git a/roles/nodejs-test-dependencies/tasks/main.yaml b/roles/nodejs-test-dependencies/tasks/main.yaml index b837cd516..7d46096d6 100644 --- a/roles/nodejs-test-dependencies/tasks/main.yaml +++ b/roles/nodejs-test-dependencies/tasks/main.yaml @@ -1,17 +1,13 @@ -- name: Install chromium-brower - apt: - name: chromium-browser - become: true - -- name: Install firefox - apt: - name: firefox - become: true - -- name: Install xvfb - apt: - name: xvfb - become: true +- name: Install distro specific packages + include_tasks: "{{ zj_distro_pkgs }}" + vars: + params: + files: + - "{{ ansible_facts.distribution }}.yaml" + - "{{ ansible_facts.os_family }}.yaml" + loop: "{{ query('first_found', params, errors='ignore') }}" + loop_control: + loop_var: zj_distro_pkgs - name: Run Xvfb shell: "/usr/bin/Xvfb :99 -screen 0 '1280x1024x24' -ac +extension GLX +render -noreset 2>&1 > /dev/null &" diff --git a/zuul-tests.d/js-roles-jobs.yaml b/zuul-tests.d/js-roles-jobs.yaml index d7a0097a9..bca9eaa73 100644 --- a/zuul-tests.d/js-roles-jobs.yaml +++ b/zuul-tests.d/js-roles-jobs.yaml @@ -38,11 +38,71 @@ vars: zuul_use_fetch_output: false +- job: + name: zuul-jobs-test-nodejs-test-dependencies + description: Test the installation of nodejs test dependencies + tags: debuntu-platforms + files: + - roles/nodejs-test-dependencies/.* + run: test-playbooks/simple-role-test.yaml + vars: + role_name: nodejs-test-dependencies + # -* AUTOGENERATED *- # The following project section is autogenerated by # tox -e update-test-platforms # Please re-run to generate new job lists +- job: + name: zuul-jobs-test-nodejs-test-dependencies-debian-bullseye + description: Test the installation of nodejs test dependencies on debian-bullseye + parent: zuul-jobs-test-nodejs-test-dependencies + tags: auto-generated + nodeset: + nodes: + - name: debian-bullseye + label: debian-bullseye + +- job: + name: zuul-jobs-test-nodejs-test-dependencies-debian-buster + description: Test the installation of nodejs test dependencies on debian-buster + parent: zuul-jobs-test-nodejs-test-dependencies + tags: auto-generated + nodeset: + nodes: + - name: debian-buster + label: debian-buster + +- job: + name: zuul-jobs-test-nodejs-test-dependencies-ubuntu-bionic + description: Test the installation of nodejs test dependencies on ubuntu-bionic + parent: zuul-jobs-test-nodejs-test-dependencies + tags: auto-generated + nodeset: + nodes: + - name: ubuntu-bionic + label: ubuntu-bionic + +- job: + name: zuul-jobs-test-nodejs-test-dependencies-ubuntu-focal + description: Test the installation of nodejs test dependencies on ubuntu-focal + parent: zuul-jobs-test-nodejs-test-dependencies + tags: auto-generated + nodeset: + nodes: + - name: ubuntu-focal + label: ubuntu-focal + +- job: + name: zuul-jobs-test-nodejs-test-dependencies-ubuntu-jammy + description: Test the installation of nodejs test dependencies on ubuntu-jammy + parent: zuul-jobs-test-nodejs-test-dependencies + tags: auto-generated + nodeset: + nodes: + - name: ubuntu-jammy + label: ubuntu-jammy + - project: check: jobs: &id001 @@ -50,6 +110,11 @@ - zuul-jobs-test-ensure-yarn - zuul-jobs-test-fetch-javascript-tarball - zuul-jobs-test-fetch-javascript-tarball-synchronize + - zuul-jobs-test-nodejs-test-dependencies-debian-bullseye + - zuul-jobs-test-nodejs-test-dependencies-debian-buster + - zuul-jobs-test-nodejs-test-dependencies-ubuntu-bionic + - zuul-jobs-test-nodejs-test-dependencies-ubuntu-focal + - zuul-jobs-test-nodejs-test-dependencies-ubuntu-jammy gate: jobs: *id001 periodic-weekly: