From 08126209de3cfdb8b60bd074e00365717cde69e3 Mon Sep 17 00:00:00 2001 From: shaleijie Date: Tue, 24 Aug 2021 10:48:38 +0800 Subject: [PATCH] feature: Add ZUUL JOBs 1. Add `skyline-tox-functional-py38` job to execute unit tests 2. Add `skyline-tox-lint-py38` job to execute code static analysis Change-Id: I6ee8e89e72b3769a2803f8dc2a7b7a434f16e16f --- .zuul.yaml | 28 ++++++++++++++++++++++++++-- Makefile | 5 +++++ bindep.txt | 4 ++++ tox.ini | 29 +++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 bindep.txt create mode 100644 tox.ini diff --git a/.zuul.yaml b/.zuul.yaml index e7c200a..89264aa 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,3 +1,27 @@ +- job: + name: skyline-tox-functional-py38 + parent: openstack-tox-functional-py38 + description: | + Skyline py38 functional tests + vars: + python_version: 3.8 + tox_envlist: functional-py38 + +- job: + name: skyline-tox-lint-py38 + parent: openstack-tox-functional-py38 + description: | + Skyline code static analysis + vars: + python_version: 3.8 + tox_envlist: lint + - project: - templates: - - noop-jobs + check: + jobs: + - skyline-tox-functional-py38 + - skyline-tox-lint-py38 + gate: + jobs: + - skyline-tox-functional-py38 + - skyline-tox-lint-py38 diff --git a/Makefile b/Makefile index fb97295..488c8d7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ PYTHON ?= python3 +IGNORE_JS ?= false +ifeq ($(IGNORE_JS), $(filter $(IGNORE_JS), true True TRUE)) +LIBS := $(shell \ls -I skyline-console libs) +else LIBS := $(shell \ls libs) +endif LIB_PATHS := $(addprefix libs/,$(LIBS)) ROOT_DIR ?= $(shell git rev-parse --show-toplevel) diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 0000000..152e352 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,4 @@ +# This is a cross-platform list tracking distribution packages needed by tests; +# see http://docs.openstack.org/infra/bindep/ for additional information. + +make diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..28d42ca --- /dev/null +++ b/tox.ini @@ -0,0 +1,29 @@ +[tox] +minversion = 3.18.0 +# python runtimes: https://governance.openstack.org/tc/reference/runtimes/ussuri.html +envlist = functional-py38,lint +skipsdist=true +# this allows tox to infer the base python from the environment name +# and override any basepython configured in this file +ignore_basepython_conflict=true +isolated_build=true + +[testenv] +# Set default python version +basepython = python3 +whitelist_externals = + make +setenv = + IGNORE_JS = True +passenv = IGNORE_JS +deps = poetry != 1.1.8 + +[testenv:functional-py38] +commands = + make install + make test + +[testenv:lint] +commands = + make install + make lint