diff --git a/.travis.yml b/.travis.yml index 52e6432cc7022dccc4b97e4b51701adac826c2e0..adb0d2d5f5a8d6e3e56e30a97dc01eed745a954f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,48 +10,48 @@ before_script: - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - pip install -r requirements.txt - - pip install coverage nose2 + - pip install coverage nose2 nose2[coverage] jobs: include: - stage: test python: "3.5" script: - - coverage run -m nose2 -v + - nose2 -vv after_script: - coverage xml - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - stage: test python: "3.6" script: - - coverage run -m nose2 -v + - nose2 -vv after_script: - coverage xml - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - stage: test python: "3.7" script: - - coverage run -m nose2 -v + - nose2 -vv after_script: - coverage xml - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - stage: test python: "3.8" script: - - coverage run -m nose2 -v + - nose2 -vv after_script: - coverage xml - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - stage: test python: "nightly" script: - - coverage run -m nose2 -v + - nose2 -vv after_script: - coverage xml - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - stage: test python: "pypy3.5" script: - - coverage run -m nose2 -v + - nose2 -vv after_script: - coverage xml - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT diff --git a/Dockerfile b/Dockerfile index 36434cf8ebf8a6a9493e1972ad088e840b807f19..fae211e4b85026f80dad0baf1f8c1b5e68426e0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ FROM python:3.8 ADD requirements.txt /app/requirements.txt -RUN pip install -r /app/requirements.txt -RUN pip install nose2 mock coverage +RUN pip install -r /app/requirements.txt && \ + pip install nose2 mock coverage nose2[mp] nose2[coverage_plugin] ADD satella /app/satella ADD tests /app/tests +ADD unittest.cfg /app/unittest.cfg +ADD setup.py /app/setup.py +ADD setup.cfg /app/setup.cfg +ADD LICENSE /app/LICENSE +ADD README.md /app/README.md +ADD MANIFEST.in /app/MANIFEST.in ADD tests/test_docker.sh /test_docker.sh RUN chmod ugo+x /test_docker.sh diff --git a/setup.py b/setup.py index 0f4d265ab9c14dd16997ff5f4b7941fae93b89a0..afee25bac060ae019ff3381db6b1eb4b7e0641f0 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,15 @@ from setuptools import setup, find_packages - +import unittest from satella import __version__ + setup(keywords=['ha', 'high availability', 'scalable', 'scalability', 'server', 'metrics'], packages=find_packages(include=['satella', 'satella.*']), version=__version__, install_requires=[ 'psutil' ], + test_suite='nose2.collector.collector', python_requires='!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*', extras_require={ 'HTTPJSONSource': ['requests'], diff --git a/tests/test_coding/test_structures.py b/tests/test_coding/test_structures.py index 1659c78b41279689e041b9945dd11340cdc2c3a4..27b4ef20d368f3c741fee445e9653aeb562045f3 100644 --- a/tests/test_coding/test_structures.py +++ b/tests/test_coding/test_structures.py @@ -259,8 +259,8 @@ class TestMisc(unittest.TestCase): def __init__(self, v): self.v = v - self.assertEqual(repr(Test2(2)), - 'tests.test_coding.test_structures.TestMisc.test_reprable_mixin.<locals>.Test2(2)') + self.assertTrue(repr(Test2(2)).endswith( + 'test_coding.test_structures.TestMisc.test_reprable_mixin.<locals>.Test2(2)')) def test_proxy(self): a = Proxy(5, wrap_operations=True) diff --git a/tests/test_docker.sh b/tests/test_docker.sh index e0c45d054a1521edf8b57564a1a843a218c7ba24..7af1416977acfcdc735240fa1b216bb8064e6a95 100644 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -1,6 +1,5 @@ #!/bin/bash set -e -coverage run --parallel-mode -m nose2 -vv -coverage combine +nose2 -vv coverage report diff --git a/tests/test_os/test_suicide.py b/tests/test_os/test_suicide.py index e9cc66886b2555d24e046ef4b2225493cb7dd455..ec28e6f6d14cd40a6c944bd7725a8fa29b891cdf 100644 --- a/tests/test_os/test_suicide.py +++ b/tests/test_os/test_suicide.py @@ -6,6 +6,7 @@ from satella.os.misc import suicide class TestSuicide(unittest.TestCase): + @unittest.skipIf('linux' in sys.platform, 'Running on Linux') @unittest.skipIf('win' in sys.platform, 'Running on Windows') def test_suicide(self): pcid = os.fork() diff --git a/unittest.cfg b/unittest.cfg new file mode 100644 index 0000000000000000000000000000000000000000..36e5d4696224d3b274af51f63df91272442bfd6e --- /dev/null +++ b/unittest.cfg @@ -0,0 +1,6 @@ +[unittest] +plugins = + nose2.plugins.coverage + +[coverage] +always-on = True