[ARVADOS] updated: e1de889290360f6dd5b5fdeab10cea997bcc6962

Git user git at public.curoverse.com
Tue Apr 26 18:07:33 EDT 2016


Summary of changes:
 build/run-tests.sh                                         | 11 ++++++++---
 sdk/python/setup.py                                        |  5 +++++
 sdk/python/tests/slow_test.py                              |  7 +++++++
 services/fuse/setup.py                                     |  5 +++++
 services/fuse/tests/mount_test_base.py                     | 14 ++++++++------
 .../fuse/tests/performance/test_collection_performance.py  |  7 +++++++
 services/fuse/tests/slow_test.py                           |  1 +
 services/keep-web/server_test.go                           | 10 ++++++++--
 8 files changed, 49 insertions(+), 11 deletions(-)
 create mode 100644 sdk/python/tests/slow_test.py
 create mode 120000 services/fuse/tests/slow_test.py

       via  e1de889290360f6dd5b5fdeab10cea997bcc6962 (commit)
       via  ac48d85ae411b1bcef0c194caae1a861eae9e929 (commit)
      from  47a79960c81ea689445f2040b24cb76729afab06 (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 e1de889290360f6dd5b5fdeab10cea997bcc6962
Merge: 47a7996 ac48d85
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Apr 26 18:07:07 2016 -0400

    Merge branch '9017-skip-slow-tests'
    
    refs #9017


commit ac48d85ae411b1bcef0c194caae1a861eae9e929
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Apr 26 18:06:53 2016 -0400

    9017: Add run-tests.sh --short flag to skip (some) slow tests.

diff --git a/build/run-tests.sh b/build/run-tests.sh
index 884eda3..53df93c 100755
--- a/build/run-tests.sh
+++ b/build/run-tests.sh
@@ -26,6 +26,7 @@ Options:
                You should provide GOPATH, GEMHOME, and VENVDIR options
                from a previous invocation if you use this option.
 --only-install Run specific install step
+--short        Skip (or scale down) some slow tests.
 WORKSPACE=path Arvados source tree to test.
 CONFIGSRC=path Dir with api server config files to copy into source tree.
                (If none given, leave config files alone in source tree.)
@@ -105,6 +106,7 @@ PYTHONPATH=
 GEMHOME=
 PERLINSTALLBASE=
 
+short=
 skip_install=
 temp=
 temp_preserve=
@@ -203,6 +205,9 @@ do
         --only)
             only="$1"; skip[$1]=""; shift
             ;;
+        --short)
+            short=1
+            ;;
         --skip-install)
             skip_install=1
             ;;
@@ -494,12 +499,12 @@ do_test_once() {
                 # does:
                 cd "$WORKSPACE/$1" && \
                     go get -t "git.curoverse.com/arvados.git/$1" && \
-                    go test ${coverflags[@]} ${testargs[$1]}
+                    go test ${short:+-short} ${coverflags[@]} ${testargs[$1]}
             else
                 # The above form gets verbose even when testargs is
                 # empty, so use this form in such cases:
                 go get -t "git.curoverse.com/arvados.git/$1" && \
-                    go test ${coverflags[@]} "git.curoverse.com/arvados.git/$1"
+                    go test ${short:+-short} ${coverflags[@]} "git.curoverse.com/arvados.git/$1"
             fi
             result="$?"
             go tool cover -html="$WORKSPACE/tmp/.$covername.tmp" -o "$WORKSPACE/tmp/$covername.html"
@@ -509,7 +514,7 @@ do_test_once() {
             # $3 can name a path directory for us to use, including trailing
             # slash; e.g., the bin/ subdirectory of a virtualenv.
             cd "$WORKSPACE/$1" \
-                && "${3}python" setup.py test ${testargs[$1]}
+                && "${3}python" setup.py ${short:+--short-tests-only} test ${testargs[$1]}
         elif [[ "$2" != "" ]]
         then
             "test_$2"
diff --git a/sdk/python/setup.py b/sdk/python/setup.py
index 17f9cb4..e0aae96 100644
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -15,6 +15,11 @@ try:
 except ImportError:
     tagger = egg_info_cmd.egg_info
 
+short_tests_only = False
+if '--short-tests-only' in sys.argv:
+    short_tests_only = True
+    sys.argv.remove('--short-tests-only')
+
 setup(name='arvados-python-client',
       version='0.1',
       description='Arvados client library',
diff --git a/sdk/python/tests/slow_test.py b/sdk/python/tests/slow_test.py
new file mode 100644
index 0000000..643ba92
--- /dev/null
+++ b/sdk/python/tests/slow_test.py
@@ -0,0 +1,7 @@
+import __main__
+import os
+import unittest
+
+slow_test = lambda _: unittest.skipIf(
+    __main__.short_tests_only,
+    "running --short tests only")
diff --git a/services/fuse/setup.py b/services/fuse/setup.py
index fca1edf..d7e1a8a 100644
--- a/services/fuse/setup.py
+++ b/services/fuse/setup.py
@@ -15,6 +15,11 @@ try:
 except ImportError:
     tagger = egg_info_cmd.egg_info
 
+short_tests_only = False
+if '--short-tests-only' in sys.argv:
+    short_tests_only = True
+    sys.argv.remove('--short-tests-only')
+
 setup(name='arvados_fuse',
       version='0.1',
       description='Arvados FUSE driver',
diff --git a/services/fuse/tests/mount_test_base.py b/services/fuse/tests/mount_test_base.py
index c79daf8..12395d7 100644
--- a/services/fuse/tests/mount_test_base.py
+++ b/services/fuse/tests/mount_test_base.py
@@ -36,6 +36,7 @@ class MountTestBase(unittest.TestCase):
         run_test_server.run()
         run_test_server.authorize_with("admin")
         self.api = api if api else arvados.safeapi.ThreadSafeApiCache(arvados.config.settings())
+        self.llfuse_thread = None
 
     # This is a copy of Mount's method.  TODO: Refactor MountTestBase
     # to use a Mount instead of copying its code.
@@ -67,12 +68,13 @@ class MountTestBase(unittest.TestCase):
         self.pool.join()
         del self.pool
 
-        subprocess.call(["fusermount", "-u", "-z", self.mounttmp])
-        self.llfuse_thread.join(timeout=1)
-        if self.llfuse_thread.is_alive():
-            logger.warning("MountTestBase.tearDown():"
-                           " llfuse thread still alive 1s after umount"
-                           " -- abandoning and exiting anyway")
+        if self.llfuse_thread:
+            subprocess.call(["fusermount", "-u", "-z", self.mounttmp])
+            self.llfuse_thread.join(timeout=1)
+            if self.llfuse_thread.is_alive():
+                logger.warning("MountTestBase.tearDown():"
+                               " llfuse thread still alive 1s after umount"
+                               " -- abandoning and exiting anyway")
 
         os.rmdir(self.mounttmp)
         if self.keeptmp:
diff --git a/services/fuse/tests/performance/test_collection_performance.py b/services/fuse/tests/performance/test_collection_performance.py
index c4eadca..a975db5 100644
--- a/services/fuse/tests/performance/test_collection_performance.py
+++ b/services/fuse/tests/performance/test_collection_performance.py
@@ -7,6 +7,7 @@ import sys
 import unittest
 from .. import run_test_server
 from ..mount_test_base import MountTestBase
+from ..slow_test import slow_test
 
 logger = logging.getLogger('arvados.arv-mount')
 
@@ -80,6 +81,7 @@ class CreateCollectionWithMultipleBlocksAndMoveAndDeleteFile(MountTestBase):
     def setUp(self):
         super(CreateCollectionWithMultipleBlocksAndMoveAndDeleteFile, self).setUp()
 
+    @slow_test
     def test_CreateCollectionWithManyBlocksAndMoveAndDeleteFile(self):
         collection = arvados.collection.Collection(api_client=self.api)
         collection.save_new()
@@ -215,6 +217,7 @@ class CreateCollectionWithManyFilesAndMoveAndDeleteFile(MountTestBase):
     def setUp(self):
         super(CreateCollectionWithManyFilesAndMoveAndDeleteFile, self).setUp()
 
+    @slow_test
     def test_CreateCollectionWithManyFilesAndMoveAndDeleteFile(self):
         collection = arvados.collection.Collection(api_client=self.api)
         collection.save_new()
@@ -327,6 +330,7 @@ class UsingMagicDir_CreateCollectionWithManyFilesAndMoveAndDeleteFile(MountTestB
             with open(os.path.join(self.mounttmp, collection, k)) as f:
                 self.assertEqual(v, f.read())
 
+    @slow_test
     def test_UsingMagicDirCreateCollectionWithManyFilesAndMoveAndDeleteFile(self):
         streams = 2
         files_per_stream = 200
@@ -382,6 +386,7 @@ class UsingMagicDir_CreateCollectionWithManyFilesAndMoveAllFilesIntoAnother(Moun
         collection.save_new()
         return collection
 
+    @slow_test
     def test_UsingMagicDirCreateCollectionWithManyFilesAndMoveAllFilesIntoAnother(self):
         streams = 2
         files_per_stream = 200
@@ -428,6 +433,7 @@ class UsingMagicDir_CreateCollectionWithManyFilesAndMoveEachFileIntoAnother(Moun
             self.pool.apply(magicDirTest_MoveFileFromCollection, (self.mounttmp, from_collection.manifest_locator(),
                   to_collection.manifest_locator(), 'stream0', 'file'+str(j)+'.txt',))
 
+    @slow_test
     def test_UsingMagicDirCreateCollectionWithManyFilesAndMoveEachFileIntoAnother(self):
         streams = 2
         files_per_stream = 200
@@ -470,6 +476,7 @@ class FuseListLargeProjectContents(MountTestBase):
             collection_contents = llfuse.listdir(os.path.join(self.mounttmp, collection_name))
             self.assertIn('baz', collection_contents)
 
+    @slow_test
     def test_listLargeProjectContents(self):
         self.make_mount(fuse.ProjectDirectory,
                         project_object=run_test_server.fixture('groups')['project_with_201_collections'])
diff --git a/services/fuse/tests/slow_test.py b/services/fuse/tests/slow_test.py
new file mode 120000
index 0000000..c7e1f7f
--- /dev/null
+++ b/services/fuse/tests/slow_test.py
@@ -0,0 +1 @@
+../../../sdk/python/tests/slow_test.py
\ No newline at end of file
diff --git a/services/keep-web/server_test.go b/services/keep-web/server_test.go
index cda8b17..324588a 100644
--- a/services/keep-web/server_test.go
+++ b/services/keep-web/server_test.go
@@ -84,8 +84,14 @@ func (s *IntegrationSuite) Test1GBFile(c *check.C) {
 	s.test100BlockFile(c, 10000000)
 }
 
-func (s *IntegrationSuite) Test300MBFile(c *check.C) {
-	s.test100BlockFile(c, 3000000)
+func (s *IntegrationSuite) Test100BlockFile(c *check.C) {
+	if testing.Short() {
+		// 3 MB
+		s.test100BlockFile(c, 30000)
+	} else {
+		// 300 MB
+		s.test100BlockFile(c, 3000000)
+	}
 }
 
 func (s *IntegrationSuite) test100BlockFile(c *check.C, blocksize int) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list