Correct usage of tox

Changes:
* use tox for creating venv and launch command in post update job
* add .gitignore
* move test requirements to test-requirements.txt
* add venv environment for launch user command
* drop python2 pin for tox jobs

Change-Id: I42638edc64d9f8ffcbcf9b831f656eefdbf4857d
This commit is contained in:
Sergey Reshetnyak 2016-08-10 13:21:03 +03:00
parent e3208183c3
commit b622776277
4 changed files with 15 additions and 15 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.tox
output

View File

@ -5,10 +5,6 @@ echo "This is job for update jenkins jobs after merge"
git clone https://git.openstack.org/$ZUUL_PROJECT .
tox -e fuel-ccp-ci
source ".tox/fuel-ccp-ci/bin/activate"
cat > jenkins_jobs.ini << EOF
[jenkins]
user=${JJB_USER}
@ -20,7 +16,5 @@ ignore_cache=True
recursive=True
EOF
jenkins-jobs --flush-cache --conf jenkins_jobs.ini update \
--delete-old jenkins-tp/jobs
deactivate
tox -e venv -- jenkins-jobs --flush-cache --conf jenkins_jobs.ini update \
--delete-old jenkins-tp/jobs

1
test-requirements.txt Normal file
View File

@ -0,0 +1 @@
bashate>=0.2

17
tox.ini
View File

@ -3,21 +3,24 @@ minversion = 1.6
skipsdist = True
envlist = bashate,fuel-ccp-ci
[testenv]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
usedevelop = False
[testenv:linters]
deps = yamllint
commands =
{toxinidir}/tools/run-check-yaml-syntax.sh
[testenv:bashate]
deps = bashate>=0.2
whitelist_externals = bash
commands = bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -print0 | xargs -0 bashate -v"
[testenv]
basepython = python2
deps = -r{toxinidir}/requirements.txt
usedevelop = False
commands =
jenkins-jobs --conf conf/jenkins_job.ini.example test jenkins-tp/jobs -o {toxinidir}/output/{envname}
[testenv:venv]
commands = {posargs}
[testenv:fuel-ccp-ci]
commands =
jenkins-jobs --conf conf/jenkins_job.ini.example test jenkins-tp/jobs -o {toxinidir}/output/{envname}