diff --git a/.functests b/.functests index 7ee71ba3..bf7f2cb1 100755 --- a/.functests +++ b/.functests @@ -19,7 +19,7 @@ ant build_storlets SRC_DIR=$(cd $(dirname $0); pwd) cd ${SRC_DIR}/tests/functional if [ "$FLAVOR" == "jenkins" ]; then - nosetests --exe -v ${@:2} + nose2 -v ${@:2} else - nosetests --exe -v -a '!slow' ${@:2} + nose2 -v -A '!slow' ${@:2} fi diff --git a/doc/source/s2aio_dev_host_include.rst b/doc/source/s2aio_dev_host_include.rst index 75948e9a..cf4498c7 100644 --- a/doc/source/s2aio_dev_host_include.rst +++ b/doc/source/s2aio_dev_host_include.rst @@ -4,7 +4,7 @@ With that user just do: :: sudo apt-get update - sudo apt-get install python-tox python-nose git + sudo apt-get install python-tox git git clone https://opendev.org/openstack/storlets.git cd storlets ./s2aio.sh install diff --git a/nose2.cfg b/nose2.cfg new file mode 100644 index 00000000..8baf921f --- /dev/null +++ b/nose2.cfg @@ -0,0 +1,2 @@ +[unittest] +plugins = nose2.plugins.attrib diff --git a/playbooks/storlets-functional/pre.yaml b/playbooks/storlets-functional/pre.yaml index 64336026..7b9acc2c 100644 --- a/playbooks/storlets-functional/pre.yaml +++ b/playbooks/storlets-functional/pre.yaml @@ -6,7 +6,6 @@ with_items: - python3 - python3-venv - - python3-nose - python3-pip become: yes diff --git a/test-requirements.txt b/test-requirements.txt index df95ad2f..17cf463d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0 coverage>=3.6 -nose +nose2 pexpect python-subunit>=0.0.18 oslotest>=1.2.0 # Apache-2.0 diff --git a/tests/functional/java/test_SLO.py b/tests/functional/java/test_SLO.py index d9a96ec2..374f397f 100644 --- a/tests/functional/java/test_SLO.py +++ b/tests/functional/java/test_SLO.py @@ -19,7 +19,6 @@ import os import random import string from swiftclient import client as c -from nose.plugins.attrib import attr from tests.functional.java import StorletJavaFunctionalTest import unittest @@ -139,7 +138,6 @@ class TestSLO(StorletJavaFunctionalTest): f.close() self.ssertEqual(chunk, aux_content) - @attr('slow') def test_get_SLO(self): headers = {'X-Run-Storlet': self.storlet_name} headers.update(self.additional_headers) @@ -152,6 +150,8 @@ class TestSLO(StorletJavaFunctionalTest): headers=headers) self.compare_slo_to_chunks(body) + test_get_SLO.slo = 1 + class TestSloOnProxy(TestSLO): def setUp(self): diff --git a/tests/functional/java/test_identity_storlet.py b/tests/functional/java/test_identity_storlet.py index a26f2017..5bba32c7 100644 --- a/tests/functional/java/test_identity_storlet.py +++ b/tests/functional/java/test_identity_storlet.py @@ -18,7 +18,6 @@ import os import random import string from swiftclient import client as c -from nose.plugins.attrib import attr from contextlib import contextmanager from tests.functional.java import StorletJavaFunctionalTest import unittest @@ -127,7 +126,6 @@ class TestIdentityStorlet(StorletJavaFunctionalTest): except Exception: pass - @attr('slow') def test_put_10MB_file(self): gf_file_path = '/tmp/10MB_file' with self._filecontext(gf_file_path): @@ -149,6 +147,8 @@ class TestIdentityStorlet(StorletJavaFunctionalTest): status = response.get('status') self.assertIn(status, [200, 201]) + test_put_10MB_file.slow = 1 + def test_put(self): self.invoke_storlet('PUT') diff --git a/tests/functional/java/test_test_storlet.py b/tests/functional/java/test_test_storlet.py index 29ecfcbb..acd50b12 100644 --- a/tests/functional/java/test_test_storlet.py +++ b/tests/functional/java/test_test_storlet.py @@ -17,7 +17,6 @@ import threading from swiftclient import client as swift_client from swiftclient import ClientException -from nose.plugins.attrib import attr from storlets.tools.utils import get_member_auth from tests.functional.java import StorletJavaFunctionalTest import unittest @@ -100,10 +99,11 @@ class TestTestStorlet(StorletJavaFunctionalTest): def test_crash(self): self.invokeTestStorlet("crash") - @attr('slow') def test_hold(self): self.invokeTestStorlet("hold") + test_hold.slow = 1 + def invokeTestStorletinParallel(self): mythreads = [] @@ -117,10 +117,11 @@ class TestTestStorlet(StorletJavaFunctionalTest): for t in mythreads: t.join() - @attr('slow') def test_parallel_print(self): self.invokeTestStorletinParallel() + test_parallel_print.slow = 1 + def test_storlet_acl_get_fail(self): headers = {'X-Run-Storlet': self.storlet_name} headers.update(self.additional_headers) diff --git a/tests/functional/python/test_SLO.py b/tests/functional/python/test_SLO.py index 32591dbe..854acc88 100644 --- a/tests/functional/python/test_SLO.py +++ b/tests/functional/python/test_SLO.py @@ -17,7 +17,6 @@ import json import random import string from swiftclient import client -from nose.plugins.attrib import attr from tests.functional.python import StorletPythonFunctionalTest import unittest @@ -104,7 +103,6 @@ class TestSLO(StorletPythonFunctionalTest): aux_content += f.read() self.asertEqual(chunk, aux_content) - @attr('slow') def test_get_SLO(self): headers = {'X-Run-Storlet': self.storlet_name} headers.update(self.additional_headers) @@ -117,6 +115,8 @@ class TestSLO(StorletPythonFunctionalTest): headers=headers) self.compare_slo_to_chunks(body) + test_get_SLO.slow = 1 + class TestSLOOnProxy(TestSLO): def setUp(self): diff --git a/tests/functional/python/test_simple_storlet.py b/tests/functional/python/test_simple_storlet.py index 05095ce1..ca5ca5f3 100644 --- a/tests/functional/python/test_simple_storlet.py +++ b/tests/functional/python/test_simple_storlet.py @@ -16,7 +16,6 @@ import os import tempfile from swiftclient import client -from nose.plugins.attrib import attr from tests.functional.python import StorletPythonFunctionalTest import unittest from urllib.request import Request, urlopen @@ -79,7 +78,6 @@ class TestSimpleStorlet(StorletPythonFunctionalTest): response_dict=resp) self.assertEqual(204, resp['status']) - @attr('slow') def test_put_10MB_file(self): with tempfile.NamedTemporaryFile() as f: with open(f.name, 'wb') as wf: @@ -99,6 +97,8 @@ class TestSimpleStorlet(StorletPythonFunctionalTest): status = response.get('status') self.assertEqual(201, status) + test_put_10MB_file.slow = 1 + def test_copy_from(self): resp = dict() objname = self.storlet_file + '-copy' diff --git a/tests/functional/python/test_test_storlet.py b/tests/functional/python/test_test_storlet.py index be694f0d..0254a4b4 100644 --- a/tests/functional/python/test_test_storlet.py +++ b/tests/functional/python/test_test_storlet.py @@ -16,7 +16,6 @@ import threading from swiftclient import client as swift_client from swiftclient import ClientException -from nose.plugins.attrib import attr from storlets.tools.utils import get_member_auth from tests.functional.python import StorletPythonFunctionalTest import unittest @@ -89,10 +88,11 @@ class TestTestStorlet(StorletPythonFunctionalTest): def test_crash(self): self.invoke_storlet("crash") - @attr('slow') def test_hold(self): self.invoke_storlet("hold") + test_hold.slow = 1 + def invoke_storlet_in_parallel(self): mythreads = [] @@ -106,10 +106,11 @@ class TestTestStorlet(StorletPythonFunctionalTest): for t in mythreads: t.join() - @attr('slow') def test_parallel_print(self): self.invoke_storlet_in_parallel() + test_parallel_print.slow = 1 + def test_storlet_acl_get_fail(self): headers = {'X-Run-Storlet': self.storlet_name} headers.update(self.additional_headers)