From ff8a129225bfea0d9f6afbd13a37255cbc6bbee0 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Thu, 9 Jul 2020 15:36:35 -0500 Subject: [PATCH] migrate to victoria testing runtime As per victoria cycle testing runtime and community goal[1] we need to migrate upstream CI/CD to Ubuntu Focal(20.04) and Node.js 10. Tox is not anymore pre-installed on the OpenDev CI images. The file package.json needs tox, install it to fix the nodejs-job. Install it via a pre-run playbook so that this is run in addition to all of the playbooks of the parent. This patch also update python version to py38 in package.json[2] as py36 is not available on focal. Note: Before this patch We used nodejs8-jobs from openstack-zuul-jobs which consumes npm jobs from zuul-jobs. We would like to install tox in the 'pre-run' phase in each npm job, so this patch also defines npm job defination here. Story: #2007865 Task: #40212 [1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal.html [2] https://opendev.org/openstack/stackviz/src/branch/master/package.json#L73 Co-Author: manchandavishal Change-Id: I116ea1609f88496c599a8285d33350104067c517 --- .zuul.yaml | 30 +++++++++++++++++++++++++++++- package.json | 2 +- playbooks/nodejs/pre.yaml | 6 ++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 playbooks/nodejs/pre.yaml diff --git a/.zuul.yaml b/.zuul.yaml index cdf2547..dd0f35f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,3 +1,25 @@ +- job: + name: stackviz-nodejs10-run-lint + parent: nodejs-run-lint + description: | + Run lint using Node 10. + vars: + node_version: 10 + nodeset: ubuntu-focal + pre-run: playbooks/nodejs/pre.yaml + required-projects: + - openstack/stackviz + +- job: + name: stackviz-nodejs10-run-test-browser + parent: nodejs-run-test-browser + vars: + node_version: 10 + nodeset: ubuntu-focal + pre-run: playbooks/nodejs/pre.yaml + required-projects: + - openstack/stackviz + - job: name: tempest-full-rocky parent: tempest-full-py3 @@ -6,12 +28,13 @@ - project: templates: - - nodejs8-jobs - publish-openstack-docs-pti - openstack-python35-jobs - openstack-python3-victoria-jobs check: jobs: + - stackviz-nodejs10-run-lint + - stackviz-nodejs10-run-test-browser - tempest-full-py3: irrelevant-files: &irrelevant-files - ^.*\.rst$ @@ -27,6 +50,11 @@ irrelevant-files: *irrelevant-files - tempest-full-rocky: irrelevant-files: *irrelevant-files + gate: + jobs: + - stackviz-nodejs10-run-lint + - stackviz-nodejs10-run-test-browser + post: jobs: - publish-openstack-stackviz-element diff --git a/package.json b/package.json index 726ab7c..d8ccf4c 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "watchify": "3.7.0" }, "scripts": { - "postinstall": "if [ ! -d .venv ]; then tox -epy36 --notest; fi", + "postinstall": "if [ ! -d .venv ]; then tox -epy38 --notest; fi", "test": "gulp unit", "lint": "eslint ./", "prod": "gulp prod; python setup.py sdist" diff --git a/playbooks/nodejs/pre.yaml b/playbooks/nodejs/pre.yaml new file mode 100644 index 0000000..b346b04 --- /dev/null +++ b/playbooks/nodejs/pre.yaml @@ -0,0 +1,6 @@ +- hosts: all + roles: + # package.json needs to run 'tox' as command, ensure that it's + # installed and can be used globally. + - role: ensure-tox + ensure_global_symlinks: True