Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix travis #10

Merged
merged 5 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
language: python
python: "2.7"

# Run jobs in containers.
sudo: false
Expand All @@ -14,16 +13,26 @@ addons:
- realpath

# Create a build matrix for the different test jobs.
env:
matrix:
# Run python style checks.
- TOX_ENV=pep8
matrix:
include:
# Run python2.7 unit tests.
- TOX_ENV=py27
- python: 2.7
env: TOXENV=py27
# Run python style checks.
- python: 3.8
env: TOXENV=pep8
# Run python3.6 unit tests.
- python: 3.6
env: TOXENV=py36
# Run python3.7 unit tests.
- python: 3.7
env: TOXENV=py37
# Run python3.8 unit tests.
- python: 3.8
env: TOXENV=py38

install:
- pip install tox

script:
# Run the tox environment.
- tox -e ${TOX_ENV}
- tox
2 changes: 2 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pyflakes>=2.2.0 # MIT
python-ironicclient # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
flake8-import-order==0.11 # LGPLv3
hacking<0.13,>=0.12.0 # Apache-2.0
Expand Down
37 changes: 34 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[tox]
envlist = py35,py27,pep8
envlist = py36,py37,py38,py27,pep8

[testenv]
usedevelop = True
install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
install_command = pip install -U {opts} {packages}
basepython = python3.8
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
coverage run --branch --include "stackhpc_inspector_plugins*" -m unittest discover stackhpc_inspector_plugins.tests.unit
Expand All @@ -22,10 +25,38 @@ commands =
coverage report -m

[testenv:pep8]
basepython = python2.7
commands =
flake8 stackhpc_inspector_plugins

[testenv:py27]
basepython = python2.7
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt

[testenv:py38]
basepython = python3.8
# FIXME: Use ussuri release until victoria is released.
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/ussuri}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt

[testenv:py37]
basepython = python3.7
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/ussuri}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt

[testenv:py36]
basepython = python3.6
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt

[flake8]
max-complexity=15
# [H106] Don’t put vim configuration in source files.
Expand Down