Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Test against multiple versions of operator-courier.
Browse files Browse the repository at this point in the history
This will let us test against the currently released version of operator
courier on pypi, as well as whatever they have cooking in their master branch.

An upcoming release (2.0.0) is going to have a small break in backwards
compatibility, handled here.
  • Loading branch information
ralphbean committed Apr 26, 2019
1 parent 28d5144 commit 85a9e58
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Expand Up @@ -4,11 +4,19 @@ matrix:
include:
- dist: trusty
python: "3.6"
env: TOXENV=py36
env: TOXENV=py36-courier_released
after_success: coveralls
- dist: xenial
python: "3.7"
env: TOXENV=py37
env: TOXENV=py37-courier_released
after_success: coveralls
- dist: trusty
python: "3.6"
env: TOXENV=py36-courier_master
after_success: coveralls
- dist: xenial
python: "3.7"
env: TOXENV=py37-courier_master
after_success: coveralls
- dist: xenial
python: "3.7"
Expand Down
7 changes: 6 additions & 1 deletion omps/manifests_util.py
Expand Up @@ -49,6 +49,11 @@ def bundle(self):
def package_name(self):
"""Returns defined package name from operator bundle"""
# op. courier do verification, this should be never empty
pkgs_yaml = self.bundle['data']['packages']
if hasattr(self.bundle, 'bundle'):
# New, op. courier >= 2.0.0
pkgs_yaml = self.bundle.bundle['data']['packages']
else:
# Old, op. courier < 2.0.0
pkgs_yaml = self.bundle['data']['packages']
pkgs = yaml.safe_load(io.StringIO(pkgs_yaml))
return pkgs[0]['packageName']
7 changes: 5 additions & 2 deletions tox.ini
@@ -1,8 +1,11 @@
[tox]
envlist = py36,py37,flake8
envlist = py{36,37}-courier_{released,master},flake8

[testenv]
deps = .[test]
deps =
courier_master: -e git://github.com/operator-framework/operator-courier#egg=operatorcourier
courier_released: operator-courier
.[test]
commands = pytest --cov=omps --ignore=tests/integration tests/

[coverage:report]
Expand Down

0 comments on commit 85a9e58

Please sign in to comment.