Merge "check-plugins job: convert the job to tox"

This commit is contained in:
Zuul 2019-09-11 04:50:39 +00:00 committed by Gerrit Code Review
commit 32ef09e8ad
5 changed files with 35 additions and 31 deletions

View File

@ -1,9 +1,10 @@
# from o-z-j/zuul.d/zuul-legacy-jobs.yaml # from o-z-j/zuul.d/zuul-legacy-jobs.yaml
- job: - job:
name: openstackclient-check-plugins name: openstackclient-check-plugins
parent: unittests parent: openstack-tox
run: playbooks/openstackclient-check-plugins/run.yaml
timeout: 1800 timeout: 1800
vars:
tox_envlist: osc_plugins
required-projects: required-projects:
- openstack/openstackclient - openstack/openstackclient
- x/pbrx - x/pbrx

View File

@ -1,19 +0,0 @@
- hosts: all
name: Run openstackclient plugin check
tasks:
- shell:
cmd: |
echo "------------------------------------------------------------"
virtualenv osc_plugins
osc_plugins/bin/pip install -e ../../x/pbrx
echo "------------------------------------------------------------"
osc_plugins/bin/pip install -c ../requirements/upper-constraints.txt -r requirements.txt
echo "------------------------------------------------------------"
osc_plugins/bin/pbrx install-siblings -c ../requirements/upper-constraints.txt $(find ../.. -mindepth 2 -maxdepth 2)
echo "------------------------------------------------------------"
osc_plugins/bin/pbr freeze
echo "------------------------------------------------------------"
osc_plugins/bin/openstack --version
osc_plugins/bin/python tests/check_osc_commands.py
chdir: /home/zuul/src/opendev.org/openstack/openstackclient

View File

@ -18,6 +18,7 @@ plugins with the purpose of detecting duplicate commands.
""" """
import pkg_resources import pkg_resources
import pprint
import traceback import traceback
@ -96,26 +97,29 @@ def find_duplicates():
if duplicate_cmds: if duplicate_cmds:
print("Duplicate commands found...") print("Duplicate commands found...")
print(duplicate_cmds) pprint.pprint(duplicate_cmds)
return True return True
if failed_cmds: if failed_cmds:
print("Some commands failed to load...") print("Some commands failed to load...")
print(failed_cmds) pprint.pprint(failed_cmds)
return True return True
overlap_cmds = _check_command_overlap(valid_cmds) overlap_cmds = _check_command_overlap(valid_cmds)
print("Final set of commands...")
pprint.pprint(valid_cmds)
if overlap_cmds: if overlap_cmds:
print("WARNING: Some commands overlap...") print("WARNING: Some commands overlap...")
print(overlap_cmds) pprint.pprint(overlap_cmds)
# FIXME(stevemar): when we determine why commands are overlapping # FIXME(stevemar): when we determine why commands are overlapping
# we can uncomment the line below. # we can uncomment the line below. We return False until then.
# return True # return True
return False
# Safely return False here with the full set of commands else:
print("Final set of commands...") # Safely return False here with the full set of commands
print(valid_cmds) print("Found no duplicate or overlapping commands, OK to merge!")
print("Found no duplicate or overlapping commands, OK to merge!") return False
return False
def _check_command_overlap(valid_cmds): def _check_command_overlap(valid_cmds):

View File

@ -0,0 +1,3 @@
#/bin/bash
pbrx install-siblings -c ../requirements/upper-constraints.txt $(find ../.. -mindepth 2 -maxdepth 2)

15
tox.ini
View File

@ -22,6 +22,21 @@ deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
[testenv:osc_plugins]
basepython = python2.7
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/requirements.txt
../../x/pbrx
whitelist_externals =
bash
commands =
# bash wrapper is required to handle a subshell of find.
bash ./tests/install-siblings.sh
pbr freeze
openstack --version
python tests/check_osc_commands.py
[flake8] [flake8]
ignore = E123,H405 ignore = E123,H405
show-source = True show-source = True