Merge "Remove projects_alphabetized from tox.ini"

This commit is contained in:
Jenkins 2014-10-07 23:23:32 +00:00 committed by Gerrit Code Review
commit f26d2847a8
3 changed files with 1 additions and 83 deletions

View File

@ -1,24 +0,0 @@
#!/bin/bash -xe
# It checks that projects.yaml alphabetized and prints list of projects that
# should be sorted.
export TMPDIR=`/bin/mktemp -d`
trap "rm -rf $TMPDIR" EXIT
pushd $TMPDIR
PROJECTS_LIST=$OLDPWD/modules/openstack_project/files/review.projects.yaml
sed -e '/^- project: /!d' -e 's/^- project: //' $PROJECTS_LIST > projects_list
LC_ALL=C sort --ignore-case projects_list -o projects_list.sorted
if ! diff projects_list projects_list.sorted > projects_list.diff; then
echo "The following projects should be alphabetized: "
cat projects_list.diff | grep -e '> '
exit 1
else
echo "Projects alphabetized."
fi
popd

View File

@ -1,45 +0,0 @@
#!/usr/bin/env python
"""
Allow git:// and https:// URLs for importing upstream repositories,
but not git@
"""
import argparse
import yaml
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose',
dest='verbose',
default=False,
action='store_true',
)
parser.add_argument(
'infile',
help='path to review.projects.yaml',
)
args = parser.parse_args()
projects = yaml.load(open(args.infile, 'r'))
VALID_SCHEMES = ['https://', 'http://', 'git://']
for p in projects:
name = p.get('project')
if not name:
# not a project
continue
upstream = p.get('upstream')
if args.verbose:
print 'Checking %s: %r' % (name, upstream)
if not upstream:
continue
for prefix in VALID_SCHEMES:
if upstream.startswith(prefix):
break
else:
raise ValueError(
'Upstream URLs should use a scheme in %s, found %s' %
(VALID_SCHEMES, p['project'])
)

15
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
minversion = 1.6
envlist = pep8,upstream,projects_alphabetized
envlist = pep8,upstream
skipsdist = True
[testenv]
@ -11,12 +11,6 @@ deps = -r{toxinidir}/test-requirements.txt
[testenv:pep8]
commands = flake8
[testenv:projects]
deps = PyYAML
commands =
{toxinidir}/tools/check_upstream_url_scheme.py modules/openstack_project/files/review.projects.yaml
{toxinidir}/tools/check_projects_yaml_alphabetized.sh
[testenv:venv]
commands = {posargs}
@ -42,12 +36,5 @@ commands =
mkdir -p {envdir}/tmp
jenkins-jobs -l debug test -o {envdir}/tmp modules/openstack_project/files/jenkins_job_builder/config
[testenv:zuul]
basepython = python2.7
deps =
commands =
{toxinidir}/tools/check_projects_yaml_alphabetized.sh
{toxinidir}/tools/run-layout.sh openstack-infra config
[testenv:bashate]
commands = bashate -v