From 69df3a177f751f372383f4188d799ad20ce31e25 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Wed, 29 Jul 2015 14:09:51 -0300 Subject: [bug] Added files created running tests to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6a0003cc..581f21d4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ MANIFEST *.log *.*~ *.csv +.eggs +_trial_temp +.DS_Store -- cgit v1.2.3 From 52c2f7258416fcd54e9aeb50656830b55d653630 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Wed, 29 Jul 2015 14:11:48 -0300 Subject: [feat] Added requirements-latest pip file With this, you can setup soledad for using locally and running the tests with the latest head in a simpler way --- client/pkg/requirements-latest.pip | 8 ++++++++ common/pkg/requirements-latest.pip | 6 ++++++ server/pkg/requirements-latest.pip | 8 ++++++++ 3 files changed, 22 insertions(+) create mode 100644 client/pkg/requirements-latest.pip create mode 100644 common/pkg/requirements-latest.pip create mode 100644 server/pkg/requirements-latest.pip diff --git a/client/pkg/requirements-latest.pip b/client/pkg/requirements-latest.pip new file mode 100644 index 00000000..0edfbca0 --- /dev/null +++ b/client/pkg/requirements-latest.pip @@ -0,0 +1,8 @@ +--index-url https://pypi.python.org/simple/ + +--allow-external u1db --allow-unverified u1db +--allow-external dirspec --allow-unverified dirspec + +-e 'git+https://github.com/pixelated-project/leap_pycommon.git#egg=leap.common' +-e '../common' +-e . diff --git a/common/pkg/requirements-latest.pip b/common/pkg/requirements-latest.pip new file mode 100644 index 00000000..929bb542 --- /dev/null +++ b/common/pkg/requirements-latest.pip @@ -0,0 +1,6 @@ +--index-url https://pypi.python.org/simple/ + +--allow-external u1db --allow-unverified u1db +--allow-external dirspec --allow-unverified dirspec +-e 'git+https://github.com/pixelated-project/leap_pycommon.git#egg=leap.common' +-e . diff --git a/server/pkg/requirements-latest.pip b/server/pkg/requirements-latest.pip new file mode 100644 index 00000000..0edfbca0 --- /dev/null +++ b/server/pkg/requirements-latest.pip @@ -0,0 +1,8 @@ +--index-url https://pypi.python.org/simple/ + +--allow-external u1db --allow-unverified u1db +--allow-external dirspec --allow-unverified dirspec + +-e 'git+https://github.com/pixelated-project/leap_pycommon.git#egg=leap.common' +-e '../common' +-e . -- cgit v1.2.3 From bc096f113f5c70fee90156a6276273f08a53e081 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Wed, 29 Jul 2015 14:35:52 -0300 Subject: [style] Fixed pep8 warning on api.py The bolean operator must come before a line break, not after according to pep8 --- client/src/leap/soledad/client/api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/leap/soledad/client/api.py b/client/src/leap/soledad/client/api.py index def2841a..a3dfb1d4 100644 --- a/client/src/leap/soledad/client/api.py +++ b/client/src/leap/soledad/client/api.py @@ -213,8 +213,7 @@ class Soledad(object): soledad_assert_type(self._passphrase, unicode) def initialize(attr, val): - return (getattr(self, attr, None) is None - and setattr(self, attr, val)) + return (getattr(self, attr, None) is None and setattr(self, attr, val)) initialize("_secrets_path", os.path.join( self.default_prefix, self.secrets_file_name)) -- cgit v1.2.3 From c8fcfb452392af6b54e36a4bd0788f7b412fdc5c Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 29 Jul 2015 16:21:33 -0300 Subject: [bug] specify develop branch when using -e requirements-latest.pip will try to clone and install. Since it is meant to be latest, I added a small change to specify the branch 'develop'. --- client/pkg/requirements-latest.pip | 2 +- common/pkg/requirements-latest.pip | 2 +- server/pkg/requirements-latest.pip | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/pkg/requirements-latest.pip b/client/pkg/requirements-latest.pip index 0edfbca0..a629aa57 100644 --- a/client/pkg/requirements-latest.pip +++ b/client/pkg/requirements-latest.pip @@ -3,6 +3,6 @@ --allow-external u1db --allow-unverified u1db --allow-external dirspec --allow-unverified dirspec --e 'git+https://github.com/pixelated-project/leap_pycommon.git#egg=leap.common' +-e 'git+https://github.com/pixelated-project/leap_pycommon.git@develop#egg=leap.common' -e '../common' -e . diff --git a/common/pkg/requirements-latest.pip b/common/pkg/requirements-latest.pip index 929bb542..9de17382 100644 --- a/common/pkg/requirements-latest.pip +++ b/common/pkg/requirements-latest.pip @@ -2,5 +2,5 @@ --allow-external u1db --allow-unverified u1db --allow-external dirspec --allow-unverified dirspec --e 'git+https://github.com/pixelated-project/leap_pycommon.git#egg=leap.common' +-e 'git+https://github.com/pixelated-project/leap_pycommon.git@develop#egg=leap.common' -e . diff --git a/server/pkg/requirements-latest.pip b/server/pkg/requirements-latest.pip index 0edfbca0..a629aa57 100644 --- a/server/pkg/requirements-latest.pip +++ b/server/pkg/requirements-latest.pip @@ -3,6 +3,6 @@ --allow-external u1db --allow-unverified u1db --allow-external dirspec --allow-unverified dirspec --e 'git+https://github.com/pixelated-project/leap_pycommon.git#egg=leap.common' +-e 'git+https://github.com/pixelated-project/leap_pycommon.git@develop#egg=leap.common' -e '../common' -e . -- cgit v1.2.3 From 970f898206d81694dbe1a1db84da923cc78fc915 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Wed, 29 Jul 2015 18:16:54 -0300 Subject: [test] Added events enabled flag to False for the tests The soledad tests were breaking after the change to zmq, the event server was trying to create a zmq instance but there are some missing files that prevented the tests from running just fixed those and the tests run again --- common/src/leap/soledad/common/tests/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/leap/soledad/common/tests/util.py b/common/src/leap/soledad/common/tests/util.py index d8d86850..140d0ea1 100644 --- a/common/src/leap/soledad/common/tests/util.py +++ b/common/src/leap/soledad/common/tests/util.py @@ -43,6 +43,7 @@ from u1db.remote import http_database from twisted.trial import unittest from leap.common.files import mkdir_p +from leap.common.events.flags import set_events_enabled from leap.soledad.common import soledad_assert from leap.soledad.common.document import SoledadDocument @@ -194,6 +195,9 @@ class BaseSoledadTest(unittest.TestCase, MockedSharedDBTest): # The following snippet comes from BaseLeapTest.setUpClass, but we # repeat it here because twisted.trial does not work with # setUpClass/tearDownClass. + + set_events_enabled(False) + self.old_path = os.environ['PATH'] self.old_home = os.environ['HOME'] self.tempdir = tempfile.mkdtemp(prefix="leap_tests-") -- cgit v1.2.3 From 54afb28b372118b0f08d0567b27034dd72fe63e7 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Mon, 3 Aug 2015 14:46:55 -0300 Subject: [bug] BaseSoledadTest now inherit from BaseLeapTest That is the right way TM to fix the events issue without explicitly setting the flag, as kaliy suggested --- common/src/leap/soledad/common/tests/util.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/src/leap/soledad/common/tests/util.py b/common/src/leap/soledad/common/tests/util.py index 140d0ea1..cbd92b94 100644 --- a/common/src/leap/soledad/common/tests/util.py +++ b/common/src/leap/soledad/common/tests/util.py @@ -43,7 +43,7 @@ from u1db.remote import http_database from twisted.trial import unittest from leap.common.files import mkdir_p -from leap.common.events.flags import set_events_enabled +from leap.common.testing.basetest import BaseLeapTest from leap.soledad.common import soledad_assert from leap.soledad.common.document import SoledadDocument @@ -185,7 +185,7 @@ def token_soledad_sync_target(test, path): return st -class BaseSoledadTest(unittest.TestCase, MockedSharedDBTest): +class BaseSoledadTest(BaseLeapTest, MockedSharedDBTest): """ Instantiates Soledad for usage in tests. """ @@ -196,8 +196,6 @@ class BaseSoledadTest(unittest.TestCase, MockedSharedDBTest): # repeat it here because twisted.trial does not work with # setUpClass/tearDownClass. - set_events_enabled(False) - self.old_path = os.environ['PATH'] self.old_home = os.environ['HOME'] self.tempdir = tempfile.mkdtemp(prefix="leap_tests-") -- cgit v1.2.3