[ARVADOS] updated: 8e9a3e39375b4dd689cd85a92e77a5eee03b4908

Git user git at public.curoverse.com
Mon Jan 30 10:04:36 EST 2017


Summary of changes:
 services/crunch-run/crunchrun.go      | 17 +++++++++--------
 services/crunch-run/crunchrun_test.go |  6 +++---
 2 files changed, 12 insertions(+), 11 deletions(-)

       via  8e9a3e39375b4dd689cd85a92e77a5eee03b4908 (commit)
      from  6b91e8201f24d2b4126532d809abba42a5ab959c (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 8e9a3e39375b4dd689cd85a92e77a5eee03b4908
Author: radhika <radhika at curoverse.com>
Date:   Sun Jan 22 08:00:12 2017 -0500

    9397: testing in progress for mount points under output_dir.

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index f2b4277..f510825 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -698,7 +698,7 @@ func (runner *ContainerRunner) CaptureOutput() error {
 		idx := strings.Index(mnt.PortableDataHash, "/")
 		if idx > 0 {
 			mnt.Path = mnt.PortableDataHash[idx:]
-			mnt.PortableDataHash = mnt.PortableDataHash[0 : idx-1]
+			mnt.PortableDataHash = mnt.PortableDataHash[0:idx]
 		}
 
 		// append to manifest_text
@@ -750,7 +750,7 @@ func (runner *ContainerRunner) getCollectionManifestForPath(mnt arvados.Mount, b
 		manifestText = strings.Replace(manifestText, "./", "."+bindSuffix+"/", -1)
 		manifestText = strings.Replace(manifestText, ". ", "."+bindSuffix+" ", -1)
 	} else {
-		// either a stream or file from a stream is being sought
+		// either a single stream or file from a stream is being sought
 		bindIdx := strings.LastIndex(bindSuffix, "/")
 		var bindSubdir, bindFileName string
 		if bindIdx >= 0 {
@@ -779,16 +779,17 @@ func (runner *ContainerRunner) getCollectionManifestForPath(mnt arvados.Mount, b
 						if strings.Index(token, ":"+pathFileName) > 0 {
 							// found the file in the stream; discard all other file tokens
 							for _, t := range tokens {
-								if strings.Index(t, ":") == 0 {
-									manifestText = " " + t
+								if strings.Index(t, ":") == -1 {
+									manifestText += (" " + t)
 								} else {
 									break // done reading all non-file tokens
 								}
-								token = strings.Replace(token, pathFileName, bindFileName, -1)
-								manifestText = manifestText + token + "\n"
-								manifestText = strings.Replace(manifestText, pathSubdir, bindSubdir, -1)
-								break
 							}
+							manifestText = strings.Trim(manifestText, " ")
+							token = strings.Replace(token, pathFileName, bindFileName, -1)
+							manifestText += (" " + token + "\n")
+							manifestText = strings.Replace(manifestText, pathSubdir, bindSubdir, -1)
+							break
 						}
 					}
 				}
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index b96b7c7..1a28dea 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -1197,7 +1197,7 @@ func (s *TestSuite) TestStdoutWithMountPointForFileUnderOutputDir(c *C) {
 		"runtime_constraints": {}
 	}`
 
-	extraMounts := []string{"a3e8f74c6f101eae01fa08bfb4e49b3a+54"}
+	extraMounts := []string{"a3e8f74c6f101eae01fa08bfb4e49b3a+54/md5sum.txt"}
 
 	api, _ := FullRunHelper(c, helperRecord, extraMounts, func(t *TestDockerClient) {
 		t.logWriter.Write(dockerLog(1, t.env[0][7:]+"\n"))
@@ -1213,7 +1213,7 @@ func (s *TestSuite) TestStdoutWithMountPointForFileUnderOutputDir(c *C) {
 			if strings.Index(collection["name"].(string), "output") == 0 {
 				streams := strings.Split(collection["manifest_text"].(string), "\n")
 				c.Check(streams[0], Equals, "./a/b 307372fa8fd5c146b22ae7a45b49bc31+6 0:6:c.out")
-				c.Check(streams[1], Matches, `\.\/foo.*md5sum\.txt`)
+				c.Check(streams[1], Matches, `\.\ .*\ 0:46:foo`)
 			}
 		}
 	}
@@ -1251,7 +1251,7 @@ func (s *TestSuite) TestStdoutWithMountPointForFileAsPathUnderOutputDir(c *C) {
 			if strings.Index(collection["name"].(string), "output") == 0 {
 				streams := strings.Split(collection["manifest_text"].(string), "\n")
 				c.Check(streams[0], Equals, "./a/b 307372fa8fd5c146b22ae7a45b49bc31+6 0:6:c.out")
-				c.Check(streams[1], Matches, `\.\/foo.*md5sum\.txt`)
+				c.Check(streams[1], Matches, `\.\ .*\ 0:46:foo`)
 			}
 		}
 	}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list