From 42a5cf70e6acc134d5c7e070f84d55903adae26b Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Thu, 24 Dec 2015 09:49:58 +0100 Subject: [PATCH 1/5] mock socket.getaddrinfo for patroni-ctl unit tests --- tests/test_ctl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_ctl.py b/tests/test_ctl.py index 0d65a05c..093ead32 100644 --- a/tests/test_ctl.py +++ b/tests/test_ctl.py @@ -18,7 +18,7 @@ from patroni.etcd import Etcd, Client from test_ha import get_cluster_initialized_without_leader, get_cluster_initialized_with_leader, \ get_cluster_initialized_with_only_leader, MockPostgresql, MockPatroni, run_async, \ get_cluster_not_initialized_without_leader -from test_etcd import etcd_read, etcd_write, requests_get, MockResponse +from test_etcd import etcd_read, etcd_write, requests_get, socket_getaddrinfo, MockResponse from test_postgresql import MockConnect, psycopg2_connect CONFIG_FILE_PATH = './test-ctl.yaml' @@ -48,6 +48,7 @@ def test_rw_config(): @patch('patroni.ctl.load_config', Mock(return_value={'dcs': {'scheme': 'etcd', 'hostname': 'localhost', 'port': 4001}})) class TestCtl(unittest.TestCase): + @patch('socket.getaddrinfo', socket_getaddrinfo) @patch.object(Client, 'machines') def setUp(self, mock_machines): mock_machines.__get__ = Mock(return_value=['http://remotehost:2379']) From 91a10bf122047daffcd3c46f3e1f94c98fe9235f Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Thu, 24 Dec 2015 09:51:42 +0100 Subject: [PATCH 2/5] Execute tests against python 3.5 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7debc49e..e7c5d0d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: python python: - "2.7" - - "3.3" - "3.4" + - "3.5" install: - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install -r requirements-py2.txt --use-mirrors; fi - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip install -r requirements-py3.txt --use-mirrors; fi From 41bf010cc1d5ca746248632fe168c2f23853add6 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Thu, 24 Dec 2015 09:54:13 +0100 Subject: [PATCH 3/5] stick to the python-etcd=0.4.2 until issues=152 is not fixed --- requirements-py2.txt | 2 +- requirements-py3.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-py2.txt b/requirements-py2.txt index f8eacc12..c2f41305 100644 --- a/requirements-py2.txt +++ b/requirements-py2.txt @@ -6,6 +6,6 @@ PyYAML requests six >= 1.7 kazoo>=2.2.1 -python-etcd>=0.4.1 +python-etcd=0.4.2 click>=4.1 prettytable>=0.7 diff --git a/requirements-py3.txt b/requirements-py3.txt index 30b5ce96..1765e2da 100644 --- a/requirements-py3.txt +++ b/requirements-py3.txt @@ -6,6 +6,6 @@ PyYAML requests six kazoo>=2.2.1 -python-etcd>=0.4.1 +python-etcd=0.4.2 click>=4.1 prettytable>=0.7 From 1b032ab6181c28069fdfafc2dbd89133dce0dc86 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Thu, 24 Dec 2015 09:56:24 +0100 Subject: [PATCH 4/5] stick to the python-etcd=0.4.2 until issues=152 is not fixed --- requirements-py2.txt | 2 +- requirements-py3.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-py2.txt b/requirements-py2.txt index c2f41305..1e194bc0 100644 --- a/requirements-py2.txt +++ b/requirements-py2.txt @@ -6,6 +6,6 @@ PyYAML requests six >= 1.7 kazoo>=2.2.1 -python-etcd=0.4.2 +python-etcd==0.4.2 click>=4.1 prettytable>=0.7 diff --git a/requirements-py3.txt b/requirements-py3.txt index 1765e2da..13c3010c 100644 --- a/requirements-py3.txt +++ b/requirements-py3.txt @@ -6,6 +6,6 @@ PyYAML requests six kazoo>=2.2.1 -python-etcd=0.4.2 +python-etcd==0.4.2 click>=4.1 prettytable>=0.7 From b77908ce58f28c268a303f025e8d858a10e77dd3 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Thu, 24 Dec 2015 09:59:01 +0100 Subject: [PATCH 5/5] Execute tests against python 3.5 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e7c5d0d1..696295f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - "3.5" install: - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install -r requirements-py2.txt --use-mirrors; fi - - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip install -r requirements-py3.txt --use-mirrors; fi + - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip install -r requirements-py3.txt; fi - pip install coveralls script: - python setup.py test