Merge "check-plugins job: convert the job to tox"
This commit is contained in:
commit
32ef09e8ad
|
@ -1,9 +1,10 @@
|
|||
# from o-z-j/zuul.d/zuul-legacy-jobs.yaml
|
||||
- job:
|
||||
name: openstackclient-check-plugins
|
||||
parent: unittests
|
||||
run: playbooks/openstackclient-check-plugins/run.yaml
|
||||
parent: openstack-tox
|
||||
timeout: 1800
|
||||
vars:
|
||||
tox_envlist: osc_plugins
|
||||
required-projects:
|
||||
- openstack/openstackclient
|
||||
- x/pbrx
|
||||
|
|
|
@ -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
|
|
@ -18,6 +18,7 @@ plugins with the purpose of detecting duplicate commands.
|
|||
"""
|
||||
|
||||
import pkg_resources
|
||||
import pprint
|
||||
import traceback
|
||||
|
||||
|
||||
|
@ -96,26 +97,29 @@ def find_duplicates():
|
|||
|
||||
if duplicate_cmds:
|
||||
print("Duplicate commands found...")
|
||||
print(duplicate_cmds)
|
||||
pprint.pprint(duplicate_cmds)
|
||||
return True
|
||||
if failed_cmds:
|
||||
print("Some commands failed to load...")
|
||||
print(failed_cmds)
|
||||
pprint.pprint(failed_cmds)
|
||||
return True
|
||||
|
||||
overlap_cmds = _check_command_overlap(valid_cmds)
|
||||
|
||||
print("Final set of commands...")
|
||||
pprint.pprint(valid_cmds)
|
||||
|
||||
if overlap_cmds:
|
||||
print("WARNING: Some commands overlap...")
|
||||
print(overlap_cmds)
|
||||
pprint.pprint(overlap_cmds)
|
||||
# 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
|
||||
|
||||
# Safely return False here with the full set of commands
|
||||
print("Final set of commands...")
|
||||
print(valid_cmds)
|
||||
print("Found no duplicate or overlapping commands, OK to merge!")
|
||||
return False
|
||||
return False
|
||||
else:
|
||||
# Safely return False here with the full set of commands
|
||||
print("Found no duplicate or overlapping commands, OK to merge!")
|
||||
return False
|
||||
|
||||
|
||||
def _check_command_overlap(valid_cmds):
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#/bin/bash
|
||||
|
||||
pbrx install-siblings -c ../requirements/upper-constraints.txt $(find ../.. -mindepth 2 -maxdepth 2)
|
15
tox.ini
15
tox.ini
|
@ -22,6 +22,21 @@ deps = -r{toxinidir}/doc/requirements.txt
|
|||
commands =
|
||||
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]
|
||||
ignore = E123,H405
|
||||
show-source = True
|
||||
|
|
Loading…
Reference in New Issue