[ARVADOS] updated: 06867b98824c26c0f5acb4e6e57859c3a4e075e4

Git user git at public.curoverse.com
Mon Jun 19 09:36:53 EDT 2017


Summary of changes:
 lib/crunchstat/crunchstat_test.go | 2 +-
 sdk/cwl/tests/matcher.py          | 5 +++++
 sdk/cwl/tests/test_job.py         | 4 ++--
 sdk/cwl/tests/test_submit.py      | 8 +++++---
 4 files changed, 13 insertions(+), 6 deletions(-)

       via  06867b98824c26c0f5acb4e6e57859c3a4e075e4 (commit)
      from  ecb4fb69d779eb9219238791fd37cb8767ce3122 (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 06867b98824c26c0f5acb4e6e57859c3a4e075e4
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jun 16 13:04:31 2017 -0400

    2411: Fix tests to accommodate copyright notices.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>

diff --git a/lib/crunchstat/crunchstat_test.go b/lib/crunchstat/crunchstat_test.go
index e7c5cff..962a579 100644
--- a/lib/crunchstat/crunchstat_test.go
+++ b/lib/crunchstat/crunchstat_test.go
@@ -60,7 +60,7 @@ func TestReadAllOrWarnSuccess(t *testing.T) {
 	if err != nil {
 		t.Fatalf("got error %s", err)
 	}
-	if matched, err := regexp.MatchString("^package crunchstat\n", string(data)); err != nil || !matched {
+	if matched, err := regexp.MatchString("\npackage crunchstat\n", string(data)); err != nil || !matched {
 		t.Fatalf("data failed regexp: err %v, matched %v", err, matched)
 	}
 }
diff --git a/sdk/cwl/tests/matcher.py b/sdk/cwl/tests/matcher.py
index 61cf6b3..50c0c60 100644
--- a/sdk/cwl/tests/matcher.py
+++ b/sdk/cwl/tests/matcher.py
@@ -4,6 +4,7 @@
 
 import difflib
 import json
+import re
 
 
 class JsonDiffMatcher(object):
@@ -25,3 +26,7 @@ class JsonDiffMatcher(object):
                 actual_json.splitlines(1),
                 fromfile="Expected", tofile="Actual")))
         return True
+
+
+def StripYAMLComments(yml):
+    return re.sub(r'(?ms)^(#.*?\n)*\n*', '', yml)
diff --git a/sdk/cwl/tests/test_job.py b/sdk/cwl/tests/test_job.py
index 906ff98..338d1fc 100644
--- a/sdk/cwl/tests/test_job.py
+++ b/sdk/cwl/tests/test_job.py
@@ -17,7 +17,7 @@ import cwltool.process
 from schema_salad.ref_resolver import Loader
 from schema_salad.sourceline import cmap
 from .mock_discovery import get_rootDesc
-from .matcher import JsonDiffMatcher
+from .matcher import JsonDiffMatcher, StripYAMLComments
 
 if not os.getenv('ARVADOS_DEBUG'):
     logging.getLogger('arvados.cwl-runner').setLevel(logging.WARN)
@@ -281,7 +281,7 @@ class TestWorkflow(unittest.TestCase):
         it.next().run()
 
         with open("tests/wf/scatter2_subwf.cwl") as f:
-            subwf = f.read()
+            subwf = StripYAMLComments(f.read())
 
         runner.api.jobs().create.assert_called_with(
             body=JsonDiffMatcher({
diff --git a/sdk/cwl/tests/test_submit.py b/sdk/cwl/tests/test_submit.py
index c72f093..15cdc1e 100644
--- a/sdk/cwl/tests/test_submit.py
+++ b/sdk/cwl/tests/test_submit.py
@@ -18,7 +18,7 @@ import arvados_cwl
 import arvados_cwl.runner
 import arvados.keep
 
-from .matcher import JsonDiffMatcher
+from .matcher import JsonDiffMatcher, StripYAMLComments
 from .mock_discovery import get_rootDesc
 
 import ruamel.yaml as yaml
@@ -1021,7 +1021,8 @@ class TestCreateTemplate(unittest.TestCase):
 
 class TestCreateWorkflow(unittest.TestCase):
     existing_workflow_uuid = "zzzzz-7fd4e-validworkfloyml"
-    expect_workflow = open("tests/wf/expect_packed.cwl").read()
+    expect_workflow = StripYAMLComments(
+        open("tests/wf/expect_packed.cwl").read())
 
     @stubs
     def test_create(self, stubs):
@@ -1168,7 +1169,8 @@ class TestCreateWorkflow(unittest.TestCase):
             capture_stdout, sys.stderr, api_client=stubs.api)
         self.assertEqual(exited, 0)
 
-        expect_workflow = open("tests/collection_per_tool/collection_per_tool_packed.cwl").read()
+        toolfile = "tests/collection_per_tool/collection_per_tool_packed.cwl"
+        expect_workflow = StripYAMLComments(open(toolfile).read())
 
         body = {
             "workflow": {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list