Skip to content
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
27 changes: 16 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
os: linux
language: python

dist: xenial

cache: pip

notifications:
email: true

matrix:
include:
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.8
matrix:
include:
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.8

before_install:
- npm install npm@latest -g
Expand All @@ -23,9 +22,15 @@ before_install:

install:
- pip install tox-travis

script: tox

- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install .
- python setup.py build

script:
- tox
- pytest test
- ./test-integration.sh

# To enable semantic-release, uncomment these sections.
# before_deploy:
Expand Down
29 changes: 29 additions & 0 deletions test-integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Code Engine Python SDK Integration tests
# Requires the following env. variables (provdied to TravisCI)
# - CE_API_KEY: IBM Cloud API Key
# - CE_PROJECT_ID: GUID of Code Engine project to target
# - CE_PROJECT_REGION: region for API URL

echo "Running integration tests..."

# Install dependencies
pip install kubernetes

# Run example, get exit code
exampleoutput=$(python example/example.py)
exampleexit=$?
if [ $exampleexit -ne 0 ]; then
echo "Integration tests failed with exit code $exampleexit"
echo $exampleoutput
exit $exampleexit
fi

# Check if output is expected
outputcheck="2 configmaps"
if [[ $exampleoutput != *$outputcheck* ]]; then
echo "Intergration test output is incorrect:"
echo "Expected '$exampleoutput' to contain '$outputcheck'"
exit 1
fi

echo "Success!"