Skip to content

Commit

Permalink
Adding initial skeleton to get Travis CI set up
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlynch committed Mar 18, 2016
1 parent 31497a8 commit b3e733a
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .gitignore
@@ -0,0 +1,67 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Vim
*~
*.swp
*.swo

# Mac OS
*.DS_Store
*.xcworkspace

18 changes: 18 additions & 0 deletions .travis.yml
@@ -0,0 +1,18 @@
sudo: false
language: python
python:
- "2.7"
install:
- pip install coveralls
- pip install yapf==0.6.2
- pip install pyflakes==1.0.0
script:
# Run unit tests and calculate code coverage.
- coverage run --source client_wrapper -m unittest discover
# Check that source has correct formatting.
- yapf --diff --recursive --style google ./
# Run static analysis for Python bugs/cruft.
- pyflakes client_wrapper/*.py tests/*.py
after_success:
coveralls

4 changes: 4 additions & 0 deletions README.md
@@ -0,0 +1,4 @@
[![Build
Status](https://travis-ci.org/m-lab/ndt-e2e-clientworker.svg?branch=master)](https://travis-ci.org/m-lab/ndt-e2e-clientworker)
[![Coverage
Status](https://coveralls.io/repos/m-lab/ndt-e2e-clientworker/badge.svg?branch=master&service=github)](https://coveralls.io/github/m-lab/ndt-e2e-clientworker?branch=master)
Empty file added __init__.py
Empty file.
Empty file added client_wrapper/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions client_wrapper/client_wrapper.py
@@ -0,0 +1,23 @@
# Copyright 2016 Measurement Lab
#
# 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 foo


def main():
print 'Running tests: %s' % foo.bar()


if __name__ == '__main__':
main()
18 changes: 18 additions & 0 deletions client_wrapper/foo.py
@@ -0,0 +1,18 @@
# Copyright 2016 Measurement Lab
#
# 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.


def bar():
"""Stub to get CI set up, not permanent."""
return True
Empty file added tests/__init__.py
Empty file.
32 changes: 32 additions & 0 deletions tests/test_foo.py
@@ -0,0 +1,32 @@
# Copyright 2016 Measurement Lab
#
# 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 os
import sys
import unittest

sys.path.insert(1, os.path.abspath(os.path.join(
os.path.dirname(__file__), '../client_wrapper')))
import foo


class ClientWrapperTest(unittest.TestCase):

def test_run_tests_executes_all_tests_successfully(self):
"""Dummy test to exercise CI setup, not permanent."""
self.assertTrue(foo.bar())


if __name__ == '__main__':
unittest.main()

0 comments on commit b3e733a

Please sign in to comment.