[ARVADOS] updated: 2.1.0-235-ge337906b3

Git user git at public.arvados.org
Tue Jan 5 15:49:59 UTC 2021


Summary of changes:
 lib/controller/federation_test.go | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

       via  e337906b3f5d38c25dd6ae58b7855ae3c2dc4744 (commit)
      from  888bafe5cfc950c950e4a22681f08456bee095ee (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 e337906b3f5d38c25dd6ae58b7855ae3c2dc4744
Author: Nico Cesar <nico at nicocesar.com>
Date:   Tue Jan 5 10:49:16 2021 -0500

    using getCRfromMockRequest()
    
    Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>

diff --git a/lib/controller/federation_test.go b/lib/controller/federation_test.go
index 5e52019f6..cabd3f99e 100644
--- a/lib/controller/federation_test.go
+++ b/lib/controller/federation_test.go
@@ -728,29 +728,8 @@ func (s *FederationSuite) TestCreateRemoteContainerRequestCheckSetRuntimeToken(c
 	req.Header.Set("Content-type", "application/json")
 	resp := s.testRequest(req).Result()
 	c.Check(resp.StatusCode, check.Equals, http.StatusOK)
-	var cr arvados.ContainerRequest
 
-	// Body can be a json formated or something like:
-	//  (forceLegacyAPI14==false) cluster_id=zmock&container_request=%7B%22command%22%3A%5B%22abc%22%5D%2C%22container_image%22%3A%22123%22%2C%22...7D
-	// or:
-	//  (forceLegacyAPI14==true) "{\"container_request\":{\"command\":[\"abc\"],\"container_image\":\"12...Uncommitted\"}}"
-	data, err := ioutil.ReadAll(s.remoteMockRequests[0].Body)
-	c.Check(err, check.IsNil)
-
-	// this exposes the different inputs we get in the mock
-	if forceLegacyAPI14 {
-		var answerCR struct {
-			ContainerRequest arvados.ContainerRequest `json:"container_request"`
-		}
-		c.Check(json.Unmarshal(data, &answerCR), check.IsNil)
-		cr = answerCR.ContainerRequest
-	} else {
-		var decodedValueCR string
-		decodedValue, err := url.ParseQuery(string(data))
-		c.Check(err, check.IsNil)
-		decodedValueCR = decodedValue.Get("container_request")
-		c.Check(json.Unmarshal([]byte(decodedValueCR), &cr), check.IsNil)
-	}
+	cr := s.getCRfromMockRequest(c)
 
 	// After mocking around now making sure the runtime_token we sent is still there.
 	c.Check(cr.RuntimeToken, check.Equals, "xyz")

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list