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

Test for travis-ci integration #1

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e3e8911
Initial code for travis-ci.
adiroiban Feb 27, 2014
386c968
Add unit tests.
adiroiban Feb 27, 2014
8d190e9
Add runtime requirements.
adiroiban Feb 27, 2014
53937f9
Update test commands.
adiroiban Feb 28, 2014
63875c4
Update travis tests.
adiroiban Feb 28, 2014
c029972
Update travis config.
adiroiban Feb 28, 2014
590f2f2
Fix glib2.
adiroiban Feb 28, 2014
c549b7f
Add separate api-reference build.
adiroiban Feb 28, 2014
471a104
Update glib2.
adiroiban Feb 28, 2014
e59b548
Fix gobject install
adiroiban Feb 28, 2014
b047698
Fix py 3.3.
adiroiban Feb 28, 2014
556c049
Update glib2.
adiroiban Feb 28, 2014
eb5ed19
Fix test matrix.
adiroiban Feb 28, 2014
1ef99e1
Reduce duplication from travis-test.
adiroiban Feb 28, 2014
f3108cb
Enable full tests.
adiroiban Feb 28, 2014
6f5c1a4
Update build matrix.
adiroiban Feb 28, 2014
c4d1004
Optimize dependencies.
adiroiban Feb 28, 2014
bd0c620
Refactor travis test.
adiroiban Feb 28, 2014
c296854
Run full tests.
adiroiban Feb 28, 2014
a6352c6
Update documentation build.
adiroiban Feb 28, 2014
44b788f
Disable gc test and add test.log.
adiroiban Feb 28, 2014
06a0fda
Update py3.3 tests.
adiroiban Feb 28, 2014
3414b94
Enable all tests.
adiroiban Feb 28, 2014
6a72ca3
Fix typo.
adiroiban Feb 28, 2014
41edc2b
Merge branch 'trunk' into travis-ci
adiroiban Apr 21, 2014
a48ec29
Update travis.
adiroiban Apr 21, 2014
53008d7
Fix travis tets.
adiroiban Apr 21, 2014
ec94c8e
Get log only on failure.
adiroiban Apr 21, 2014
c2af9c5
Update glib2.
adiroiban Apr 21, 2014
67d1c09
Add more reactors.
adiroiban Apr 21, 2014
62aa501
Fix debug.
adiroiban Apr 21, 2014
1de328c
Run all tests.
adiroiban Apr 21, 2014
c1f748f
Try to wait.
adiroiban Apr 21, 2014
b5ea9a6
Run a single tests.
adiroiban Apr 21, 2014
abc4f3e
Try someting new.
adiroiban Apr 21, 2014
2cd470b
Now this.
adiroiban Apr 21, 2014
bf8de59
Run default test.
adiroiban Apr 21, 2014
57e2f66
Revert changes.
adiroiban Apr 21, 2014
af85414
Fix yaml file.
adiroiban Apr 21, 2014
e5d408d
Try simple test.
adiroiban Apr 21, 2014
275a14f
Try tests.
adiroiban Apr 21, 2014
e196feb
Fix test.
adiroiban Apr 21, 2014
0e1e5cf
Try this.
adiroiban Apr 21, 2014
da61466
Update test.
adiroiban Apr 21, 2014
eecbacf
Update test.
adiroiban Apr 21, 2014
93e457d
Run more tests.
adiroiban Apr 21, 2014
ac0c172
skip test.
adiroiban Apr 21, 2014
77fc5c0
Fix mask.
adiroiban Apr 21, 2014
039cff3
Record mask.
adiroiban Apr 21, 2014
1c7c2c7
Skip travis failing tests.
adiroiban Apr 21, 2014
119d284
Enable all tests.
adiroiban Apr 21, 2014
af2ed42
Rename script.
adiroiban Apr 21, 2014
dac761d
Fix travis test command.
adiroiban Apr 21, 2014
b296f80
Revert python 3 runner.
adiroiban Apr 21, 2014
3c73e80
Start xvfb.
adiroiban Apr 21, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 65 additions & 0 deletions .travis.yml
@@ -0,0 +1,65 @@
#
# Travis CI configuration file for Twisted tests.
#
language: python

# Supported Python versions.
python:
- "2.6"
- "2.7"

# Run default tests on all supported Python versions..
env:
- TEST=py-default

# Start X server for GTK reactor.
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

# Dump trial log on failure.
after_failure: "cat _trial_temp/test.log"

# In addition, some tests are executed on a single Python version.
matrix:
include:
# Python 3.3 tests are only executed once while Twisted is in migration
# process.
- python: "3.3"
env: TEST=py-3.3

- python: "2.7"
env: TEST=py-without-modules

# Run test with various reactors using a single Python version.
- python: "2.7"
env: TEST=py-select
- python: "2.7"
env: TEST=py-poll
- python: "2.7"
env: TEST=py-epoll
- python: "2.7"
env: TEST=py-glib2
- python: "2.7"
env: TEST=py-gi
- python: "2.7"
env: TEST=py-gtk2
- python: "2.7"
env: TEST=py-gtk3

- python: "2.7"
env: TEST=pyflakes

- python: "2.7"
env: TEST=api-reference
- python: "2.7"
env: TEST=documentation

# Each builder has its own install requirements in order
# to avoid installing unused packages.
install:
- echo "Custom install steps for each builder."

# Command used for executing the tests, where $TEST is extracted from `env`.
script:
- ./bin/admin/run-test-suite $TEST
133 changes: 133 additions & 0 deletions bin/admin/run-test-suite
@@ -0,0 +1,133 @@
#!/bin/bash
#
# Helper to run predefined test suites.
#

COMMAND=$1

# Run minimal report to reduce log size.
TRIAL_COMMAND="./bin/trial --reporter=text --unclean-warnings"
PYTHON_3_TEST="./admin/run-python3-tests"

REQUIREMENTS="\
pyOpenSSL==0.14 \
service-identity==0.2 \
pycrypto==2.6.1 \
pyasn1==0.1.7 \
"

#
# Install project and dependencies with pip.
#
pip_install_dependencies() {
pip install .
pip install $REQUIREMENTS
# Removed compiled python files.
find . -name "*.pyc" -or -name "*$py.class" | xargs rm -f
}


#
# Run trial inside the virtual environment.
#
run_venv_trial() {
pip_install_dependencies
echo "Running tests $@..."
python $TRIAL_COMMAND $@
exit_code=$?
return $exit_code
}


#
# Run trial on using system Python.
#
run_system_trial() {
echo "Updating packages..."
sudo apt-get update -qq

echo "Installing dependencies..."
sudo apt-get install -qq python-gtk2 python-gobject

echo "Running tests $@..."
/usr/bin/python $TRIAL_COMMAND $@
exit_code=$?

return $exit_code
}


case "$COMMAND" in
"py-default")
run_venv_trial twisted
;;

"py-without-modules")
run_venv_trial --without-module OpenSSL --without-module Crypto twisted
;;

"py-select-gc")
run_venv_trial --force-gc --reactor=select twisted.internet
;;

"py-select")
run_venv_trial --reactor=select twisted.internet
;;

"py-poll")
run_venv_trial --reactor=poll twisted.internet
;;

"py-epoll")
run_venv_trial --reactor=epoll twisted.internet
;;

"py-glib2")
run_system_trial --reactor=glib2 twisted.internet
;;

"py-gi")
run_system_trial --reactor=gi twisted.internet
;;

"py-gtk2")
run_system_trial --reactor=gtk2 twisted.internet
;;

"py-gtk3")
run_system_trial --reactor=gtk3 twisted.internet
;;

"py-3.3")
pip_install_dependencies
python3.3 $PYTHON_3_TEST
exit_code=$?
exit $exit_code
;;

"pyflakes")
pip install pyflakes==0.8.1
pyflakes twisted
;;

"twistedchecker")
pip install pep8==1.5.1 twistedchecker==0.2.0
twistedchecker twisted
;;

"documentation")
pip install . sphinx==1.2.1
python ./bin/admin/build-docs . doc/core/howto/template.
;;

"api-reference")
pip install pydoctor==0.5
python ./bin/admin/build-apidocs . apidocs
;;

*)
echo "Unknown command $COMMAND"
exit 1
esac

exit $?
10 changes: 10 additions & 0 deletions twisted/internet/test/test_inotify.py
Expand Up @@ -4,6 +4,7 @@
"""
Tests for the inotify wrapper in L{twisted.internet.inotify}.
"""
import os

from twisted.internet import defer, reactor
from twisted.python import filepath, runtime
Expand All @@ -16,6 +17,10 @@
else:
from twisted.internet import inotify

skipTravisCI = None
if os.environ.get('TRAVIS') == 'true':
skipTravisCI = 'IN_DELETE_SELF is not working on Travis CI workers.'



class TestINotify(unittest.TestCase):
Expand Down Expand Up @@ -219,6 +224,7 @@ def operation(path):

return self._notificationTest(
inotify.IN_DELETE_SELF, operation, expectedPath=self.dirname)
test_deleteSelf.skip = skipTravisCI


def test_moveSelf(self):
Expand Down Expand Up @@ -298,6 +304,8 @@ def _eb():
d = defer.Deferred()
subdir.createDirectory()
return d
# autoAdd depends IN_DELETE_SELF which is not working on Travis.
test_simpleDeleteDirectory.skip = skipTravisCI


def test_ignoreDirectory(self):
Expand Down Expand Up @@ -411,6 +419,7 @@ def callIt(*args):
expectedPath.remove()

return notified
test_seriesOfWatchAndIgnore.skip = skipTravisCI


def test_ignoreFilePath(self):
Expand Down Expand Up @@ -446,6 +455,7 @@ def callIt(*args):
expectedPath2.remove()

return notified
test_ignoreFilePath.skip = skipTravisCI


def test_ignoreNonWatchedFile(self):
Expand Down