[ARVADOS] updated: 3ed87fefbe5839572d7f1c7cfa9938ad85073088

git at public.curoverse.com git at public.curoverse.com
Fri Nov 20 16:11:59 EST 2015


Summary of changes:
 services/datamanager/keep/keep_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

  discards  40464b75b34b2d6dd11efc681d6274005815bcf9 (commit)
       via  3ed87fefbe5839572d7f1c7cfa9938ad85073088 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (40464b75b34b2d6dd11efc681d6274005815bcf9)
            \
             N -- N -- N (3ed87fefbe5839572d7f1c7cfa9938ad85073088)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 3ed87fefbe5839572d7f1c7cfa9938ad85073088
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Nov 20 16:21:42 2015 -0500

    7490: Quote strings in error messages, fixup error matching in tests.

diff --git a/services/datamanager/keep/keep.go b/services/datamanager/keep/keep.go
index 5d3d2ed..7da74b1 100644
--- a/services/datamanager/keep/keep.go
+++ b/services/datamanager/keep/keep.go
@@ -309,8 +309,7 @@ func ReadServerResponse(arvLogger *logger.Logger,
 	resp *http.Response) (response ServerResponse, err error) {
 
 	if resp.StatusCode != 200 {
-		return response, fmt.Errorf("Received error code %d in response to request "+
-			"for %s index: %s",
+		return response, fmt.Errorf("Received error code %d in response to index request for %s: %s",
 			resp.StatusCode, keepServer.String(), resp.Status)
 	}
 
@@ -397,19 +396,19 @@ func parseBlockInfoFromIndexLine(indexLine string) (blockInfo BlockInfo, err err
 	tokens := strings.Fields(indexLine)
 	if len(tokens) != 2 {
 		err = fmt.Errorf("Expected 2 tokens per line but received a "+
-			"line containing %v instead.",
+			"line containing %#q instead.",
 			tokens)
 	}
 
 	var locator blockdigest.BlockLocator
 	if locator, err = blockdigest.ParseBlockLocator(tokens[0]); err != nil {
-		err = fmt.Errorf("%v Received error while parsing line \"%s\"",
+		err = fmt.Errorf("%v Received error while parsing line \"%#q\"",
 			err, indexLine)
 		return
 	}
 	if len(locator.Hints) > 0 {
 		err = fmt.Errorf("Block locator in index line should not contain hints "+
-			"but it does: %v",
+			"but it does: %#q",
 			locator)
 		return
 	}
diff --git a/services/datamanager/keep/keep_test.go b/services/datamanager/keep/keep_test.go
index 3ca7b82..42559af 100644
--- a/services/datamanager/keep/keep_test.go
+++ b/services/datamanager/keep/keep_test.go
@@ -221,27 +221,27 @@ type KeepServerTestData struct {
 
 func (s *KeepSuite) TestGetKeepServers_ErrorGettingKeepServerStatus(c *C) {
 	testGetKeepServersAndSummarize(c, KeepServerTestData{500, 200, "ok",
-		"500 Internal Server Error"})
+		".*http://.* 500 Internal Server Error"})
 }
 
 func (s *KeepSuite) TestGetKeepServers_GettingIndex(c *C) {
 	testGetKeepServersAndSummarize(c, KeepServerTestData{200, -1, "notok",
-		"redirect-loop"})
+		".*redirect-loop.*"})
 }
 
 func (s *KeepSuite) TestGetKeepServers_ErrorReadServerResponse(c *C) {
 	testGetKeepServersAndSummarize(c, KeepServerTestData{200, 500, "notok",
-		"500 Internal Server Error"})
+		".*http://.* 500 Internal Server Error"})
 }
 
 func (s *KeepSuite) TestGetKeepServers_ReadServerResponseTuncatedAtLineOne(c *C) {
 	testGetKeepServersAndSummarize(c, KeepServerTestData{200, 200,
-		"notterminatedwithnewline", "truncated at line 1"})
+		"notterminatedwithnewline", "Index from http://.* truncated at line 1"})
 }
 
 func (s *KeepSuite) TestGetKeepServers_InvalidBlockLocatorPattern(c *C) {
 	testGetKeepServersAndSummarize(c, KeepServerTestData{200, 200, "testing\n",
-		"Error parsing BlockInfo from index line"})
+		"Error parsing BlockInfo from index line.*"})
 }
 
 func (s *KeepSuite) TestGetKeepServers_ReadServerResponseEmpty(c *C) {
@@ -325,11 +325,6 @@ func testGetKeepServersAndSummarize(c *C, testData KeepServerTestData) {
 			}
 		}
 	} else {
-		if testData.expectedError == "Error parsing BlockInfo from index line" {
-			// In this case ErrorMatches does not work because the error message contains regexp match characters
-			strings.Contains(err.Error(), testData.expectedError)
-		} else {
-			c.Assert(err, ErrorMatches, fmt.Sprintf(".*%s.*", testData.expectedError))
-		}
+		c.Assert(err, ErrorMatches, testData.expectedError)
 	}
 }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list