16141: Fixes test to use the 1st keep_service's uuid the test server returns.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 10 Feb 2020 19:22:07 +0000 (16:22 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 10 Feb 2020 19:22:07 +0000 (16:22 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

lib/controller/handler_test.go
sdk/go/arvadostest/fixtures.go

index f1d6f15e34fc5b71137ada4b8791d45c79c9ea4b..5e058ff91bf7600abbabc2bf07b02563a202027a 100644 (file)
@@ -266,6 +266,17 @@ func (s *HandlerSuite) CheckObjectType(c *check.C, url string, token string, ski
 }
 
 func (s *HandlerSuite) TestGetObjects(c *check.C) {
+       // Get the 1st keep service's uuid from the running test server.
+       req := httptest.NewRequest("GET", "/arvados/v1/keep_services/", nil)
+       req.Header.Set("Authorization", "Bearer "+arvadostest.AdminToken)
+       resp := httptest.NewRecorder()
+       s.handler.ServeHTTP(resp, req)
+       c.Assert(resp.Code, check.Equals, http.StatusOK)
+       var ksList arvados.KeepServiceList
+       json.Unmarshal(resp.Body.Bytes(), &ksList)
+       c.Assert(len(ksList.Items), check.Not(check.Equals), 0)
+       ksUUID := ksList.Items[0].UUID
+
        testCases := map[string]map[string]bool{
                "api_clients/" + arvadostest.TrustedWorkbenchAPIClientUUID:     map[string]bool{},
                "api_client_authorizations/" + arvadostest.AdminTokenUUID:      map[string]bool{},
@@ -274,7 +285,7 @@ func (s *HandlerSuite) TestGetObjects(c *check.C) {
                "containers/" + arvadostest.RunningContainerUUID:               map[string]bool{},
                "container_requests/" + arvadostest.QueuedContainerRequestUUID: map[string]bool{},
                "groups/" + arvadostest.AProjectUUID:                           map[string]bool{},
-               "keep_services/" + arvadostest.KeepServiceZeroUUID:             map[string]bool{},
+               "keep_services/" + ksUUID:                                      map[string]bool{},
                "links/" + arvadostest.ActiveUserCanReadAllUsersLinkUUID:       map[string]bool{},
                "logs/" + arvadostest.CrunchstatForRunningJobLogUUID:           map[string]bool{},
                "nodes/" + arvadostest.IdleNodeUUID:                            map[string]bool{},
index 8a461473d07b50787aaf6d630a241e9af9de6d3f..7d3979581c45e3b60a7fe8ec7cc7475f429d4a9c 100644 (file)
@@ -60,8 +60,6 @@ const (
 
        CollectionReplicationDesired2Confirmed2UUID = "zzzzz-4zz18-434zv1tnnf2rygp"
 
-       KeepServiceZeroUUID = "zzzzz-bi6l4-6zhilxar6r8ey90"
-
        ActiveUserCanReadAllUsersLinkUUID = "zzzzz-o0j2j-ctbysaduejxfrs5"
 
        TrustedWorkbenchAPIClientUUID = "zzzzz-ozdt8-teyxzyd8qllg11h"