Skip to content

Commit

Permalink
Issues:
Browse files Browse the repository at this point in the history
Fixes #1

Problem:
The issue is that there does not exist any test automation for
continuous integration via Travis.

Analysis:
This initiates the test automation via Travis.  This is a very vanilla
setup with no entrypoint and only minimal items for tox to work with
both commands that are in the .travis_yml file.  This includes the setup
for travis and the basic framework around getting .rpm and .deb
installed via test automation in the framework.

Tests:
There exists a f5_cccl/test/test_f5_cccl.py which is a basic test to
validate that there exists a __version__ variable.
  • Loading branch information
sorensF5 committed Apr 19, 2017
1 parent ba1f134 commit 2de1ad0
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .git-commit-template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Headline or summary of the issue you are fixing

# Using the Fixes #<issueid> will close the issue on commit to repo
Issues:
Fixes #<issueid>

# Describe the issue that this change addresses
Problem:

# Describe the change itself and why you made the changes you did
Analysis:

# Describe the tests you ran and/or created to test this change
Tests:

24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: python
python:
- "2.7"
- "3.5"
sudo: true
env:
global:
- REPO="f5-cccl"
- PKG_VERSION=$(python -c "import f5_cccl; print f5_cccl.__version__")
# services: # needed for later work to build .deb and .rpm natively
# - docker
before_install:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis F5 Openstack"
- git fetch --depth=100
install:
- pip install tox
- pip install -r requirements.test.txt
- pip install -r requirements.docs.txt
- python ./setup.py install
script:
- tox -e flake
- tox -e unit
before_deploy: PKG_VERSION=$(python -c "import f5; print(f5_cccl.__version__)")
17 changes: 17 additions & 0 deletions f5_cccl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

__version__ = '0.0.0'
21 changes: 21 additions & 0 deletions f5_cccl/test/test_f5_cccl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import f5_cccl


def test_version():
assert isinstance(f5_cccl.__version__, str)
6 changes: 6 additions & 0 deletions requirements.docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-e .

# Docs requirements
Sphinx>=1.4.1
six>=1.10.0
sphinx_rtd_theme
12 changes: 12 additions & 0 deletions requirements.test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Install this directory (will use setup.py and therefore install_requires).
-e .
# Test Requirements
mock==2.0.0
pytest==3.0.5
pytest-cov>=2.2.1
python-coveralls==2.7.0
pyOpenSSL==16.2.0
requests-mock==1.2.0
flake8
netaddr
q
41 changes: 41 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env python

# Copyright 2014 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import f5_cccl

from setuptools import find_packages
from setuptools import setup

install_requires = []
print('install_requires', install_requires)
setup(
name='f5-cccl',
description='F5 Networks Common Controller Core Library',
license='Apache License, Version 2.0',
version=f5_cccl.__version__,
author='F5 Networks',
url='https://github.com/f5devcentral/f5-cccl',
keywords=['F5', 'big-ip'],
install_requires=install_requires,
packages=find_packages(
exclude=["*.test", "*.test.*", "test.*", "test_*", "test", "test*"]
),
data_files=[],
classifiers=[
],
entry_points={}
)
27 changes: 27 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tox]
envlist =
unit
flake
coveralls
docs

[testenv]
basepython =
unit: python
flake: python
coveralls: python
docs: python
passenv = COVERALLS_REPO_TOKEN
deps =
-rrequirements.test.txt

commands =
# Misc tests
flake: flake8 {posargs:.}
unit: py.test f5_cccl/
coveralls: coveralls
docs: bash ./devtools/bin/build-docs.sh
usedevelop = true

[flake8]
exclude = docs/conf.py,docs/userguide/code_example.py,docs/conf.py,.tox,.git,__pycache__,build,*.pyc,docs,devtools,*.tmpl

0 comments on commit 2de1ad0

Please sign in to comment.