[ARVADOS] updated: 1.3.0-1189-g18056e7f7

Git user git at public.curoverse.com
Fri Jul 12 18:29:47 UTC 2019


Summary of changes:
 sdk/python/tests/run_test_server.py        | 13 ++++++++-----
 services/fuse/setup.py                     |  4 ++++
 services/fuse/tests/test_command_args.py   | 11 ++++++-----
 services/fuse/tests/test_exec.py           |  7 ++++---
 services/fuse/tests/test_mount.py          | 15 ++++++++-------
 services/fuse/tests/test_tmp_collection.py |  5 ++---
 6 files changed, 32 insertions(+), 23 deletions(-)

       via  18056e7f71e5df94e98c6ccdcb0ea15cfd20f1ec (commit)
       via  7cac2b42ab530880a9ac6bff59909f960ea106e8 (commit)
       via  8aaefe016ee75d3878946190bb476f9bcccc32bc (commit)
       via  86086ac2b5830dc20d021ba9fbea12035267920f (commit)
      from  b071451144bb00134cb31c868aae640fee4eca24 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 18056e7f71e5df94e98c6ccdcb0ea15cfd20f1ec
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Fri Jul 12 13:42:11 2019 -0400

    14965: Report python 3 compatibility
    
    Arvados-DCO-1.1-Signed-off-by:  <ebiagiotti at veritasgenetics.com>

diff --git a/services/fuse/setup.py b/services/fuse/setup.py
index 765cd9425..59213e8eb 100644
--- a/services/fuse/setup.py
+++ b/services/fuse/setup.py
@@ -48,6 +48,10 @@ setup(name='arvados_fuse',
       extras_require={
           ':python_version<"3"': ['pytz'],
       },
+      classifiers=[
+          'Programming Language :: Python :: 2',
+          'Programming Language :: Python :: 3',
+      ],
       test_suite='tests',
       tests_require=['pbr<1.7.0', 'mock>=1.0', 'PyYAML'],
       zip_safe=False

commit 7cac2b42ab530880a9ac6bff59909f960ea106e8
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Fri Jul 12 13:35:11 2019 -0400

    14965: Cleans up test output by reducing resource warnings
    
    Arvados-DCO-1.1-Signed-off-by:  <ebiagiotti at veritasgenetics.com>

diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index 786d5a26c..510ffbeca 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -503,9 +503,10 @@ def _start_keep(n, keep_args):
     for arg, val in keep_args.items():
         keep_cmd.append("{}={}".format(arg, val))
 
-    logf = open(_logfilename('keep{}'.format(n)), 'a')
-    kp0 = subprocess.Popen(
-        keep_cmd, stdin=open('/dev/null'), stdout=logf, stderr=logf, close_fds=True)
+    with open(_logfilename('keep{}'.format(n)), 'a') as logf:
+        with open('/dev/null') as _stdin:
+            kp0 = subprocess.Popen(
+                keep_cmd, stdin=_stdin, stdout=logf, stderr=logf, close_fds=True)
 
     with open(_pidfile('keep{}'.format(n)), 'w') as f:
         f.write(str(kp0.pid))
@@ -562,7 +563,8 @@ def run_keep(blob_signing_key=None, enforce_permissions=False, num_servers=2):
         pidfile = _pidfile('keepproxy')
         if os.path.exists(pidfile):
             try:
-                os.kill(int(open(pidfile).read()), signal.SIGHUP)
+                with open(pidfile) as pid:
+                    os.kill(int(pid.read()), signal.SIGHUP)
             except OSError:
                 os.remove(pidfile)
 
@@ -733,7 +735,8 @@ def _setport(program, port):
 # Returns 9 if program is not up.
 def _getport(program):
     try:
-        return int(open(_portfile(program)).read())
+        with open(_portfile(program)) as prog:
+            return int(prog.read())
     except IOError:
         return 9
 
diff --git a/services/fuse/tests/test_command_args.py b/services/fuse/tests/test_command_args.py
index 9f6555de3..581f24624 100644
--- a/services/fuse/tests/test_command_args.py
+++ b/services/fuse/tests/test_command_args.py
@@ -34,11 +34,12 @@ def noexit(func):
 
 @contextlib.contextmanager
 def nostderr():
-    orig, sys.stderr = sys.stderr, open(os.devnull, 'w')
-    try:
-        yield
-    finally:
-        sys.stderr = orig
+    with open(os.devnull, 'w') as dn:
+        orig, sys.stderr = sys.stderr, dn
+        try:
+            yield
+        finally:
+            sys.stderr = orig
 
 
 class MountArgsTest(unittest.TestCase):
diff --git a/services/fuse/tests/test_exec.py b/services/fuse/tests/test_exec.py
index 2111d5351..351960331 100644
--- a/services/fuse/tests/test_exec.py
+++ b/services/fuse/tests/test_exec.py
@@ -59,6 +59,7 @@ class ExecMode(unittest.TestCase):
                 quote(os.path.join(self.mnt, 'zzz', 'foo.txt')),
                 quote(os.path.join(self.mnt, 'zzz', '.arvados#collection')),
                 quote(os.path.join(self.okfile)))]))
-        self.assertRegexpMatches(
-            json.load(open(self.okfile))['manifest_text'],
-            r' 0:3:foo.txt\n')
+        with open(self.okfile) as f:
+            self.assertRegexpMatches(
+                json.load(f)['manifest_text'],
+                r' 0:3:foo.txt\n')
diff --git a/services/fuse/tests/test_tmp_collection.py b/services/fuse/tests/test_tmp_collection.py
index a70df8822..f85cc2b38 100644
--- a/services/fuse/tests/test_tmp_collection.py
+++ b/services/fuse/tests/test_tmp_collection.py
@@ -54,9 +54,8 @@ class TmpCollectionArgsTest(unittest.TestCase):
 
 
 def current_manifest(tmpdir):
-    return json.load(open(
-        os.path.join(tmpdir, '.arvados#collection')
-    ))['manifest_text']
+    with open(os.path.join(tmpdir, '.arvados#collection')) as tmp:
+        return json.load(tmp)['manifest_text']
 
 
 class TmpCollectionTest(IntegrationTest):

commit 8aaefe016ee75d3878946190bb476f9bcccc32bc
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Fri Jul 12 10:18:39 2019 -0400

    14965: Mocks FreshBase _poll_time to avoid comparing mock and int
    
    Arvados-DCO-1.1-Signed-off-by:  <ebiagiotti at veritasgenetics.com>

diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index 3095e7013..51edfa888 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -1085,15 +1085,16 @@ class MagicDirApiError(FuseMagicTest):
         api.keep.get.side_effect = Exception('Keep fail')
 
     def runTest(self):
-        self.make_mount(fuse.MagicDirectory)
+        with mock.patch('arvados_fuse.fresh.FreshBase._poll_time', new_callable=mock.PropertyMock, return_value=60) as mock_poll_time:
+            self.make_mount(fuse.MagicDirectory)
 
-        self.operations.inodes.inode_cache.cap = 1
-        self.operations.inodes.inode_cache.min_entries = 2
+            self.operations.inodes.inode_cache.cap = 1
+            self.operations.inodes.inode_cache.min_entries = 2
 
-        with self.assertRaises(OSError):
-            llfuse.listdir(os.path.join(self.mounttmp, self.testcollection))
+            with self.assertRaises(OSError):
+                llfuse.listdir(os.path.join(self.mounttmp, self.testcollection))
 
-        llfuse.listdir(os.path.join(self.mounttmp, self.testcollection))
+            llfuse.listdir(os.path.join(self.mounttmp, self.testcollection))
 
 
 class FuseUnitTest(unittest.TestCase):

commit 86086ac2b5830dc20d021ba9fbea12035267920f
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Fri Jul 12 10:11:41 2019 -0400

    14965: Adds encoding to keep.put argument
    
    Arvados-DCO-1.1-Signed-off-by:  <ebiagiotti at veritasgenetics.com>

diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index 1b9d361bf..3095e7013 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -275,7 +275,7 @@ class FuseSharedTest(MountTestBase):
         self.make_mount(fuse.SharedDirectory,
                         exclude=self.api.users().current().execute()['uuid'])
         keep = arvados.keep.KeepClient()
-        keep.put("baz")
+        keep.put("baz".encode())
 
         self.pool.apply(fuseSharedTestHelper, (self.mounttmp,))
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list