[ARVADOS] updated: 1.3.0-2145-gebd4760f0

Git user git at public.arvados.org
Mon Feb 10 17:42:41 UTC 2020


Summary of changes:
 lib/controller/handler_test.go       | 48 +++++++++++++++++++++++++++---------
 sdk/go/arvados/collection.go         | 13 +++++-----
 sdk/go/arvados/user.go               |  4 +--
 sdk/go/arvadostest/fixtures.go       | 15 +++++++++++
 services/api/test/fixtures/users.yml |  1 +
 5 files changed, 60 insertions(+), 21 deletions(-)

       via  ebd4760f06f66fa31ea72aaed817094a36ca5ab8 (commit)
       via  41f903c1b1c2c1821ff5d72e31d134cfa52029e2 (commit)
       via  f4f0614d06c4ac9abeb34dc6df7c88ecb5feebda (commit)
      from  7d1970e46ed5dab65e1eaa28b3ddfe609ffe6e4e (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 ebd4760f06f66fa31ea72aaed817094a36ca5ab8
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Feb 10 14:41:44 2020 -0300

    16141: Fixes GoSDK's User type.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/sdk/go/arvados/user.go b/sdk/go/arvados/user.go
index 68960144a..cbaf3d7a8 100644
--- a/sdk/go/arvados/user.go
+++ b/sdk/go/arvados/user.go
@@ -22,8 +22,8 @@ type User struct {
 	OwnerUUID            string                 `json:"owner_uuid"`
 	CreatedAt            time.Time              `json:"created_at"`
 	ModifiedAt           time.Time              `json:"modified_at"`
-	ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
-	ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
+	ModifiedByUserUUID   *string                `json:"modified_by_user_uuid"`
+	ModifiedByClientUUID *string                `json:"modified_by_client_uuid"`
 	Prefs                map[string]interface{} `json:"prefs"`
 	WritableBy           []string               `json:"writable_by,omitempty"`
 }
diff --git a/services/api/test/fixtures/users.yml b/services/api/test/fixtures/users.yml
index ce81c8ff9..4733096cb 100644
--- a/services/api/test/fixtures/users.yml
+++ b/services/api/test/fixtures/users.yml
@@ -77,6 +77,7 @@ active:
   identity_url: https://active-user.openid.local
   is_active: true
   is_admin: false
+  modified_at: 2015-03-26 12:34:56.789000000 Z
   username: active
   prefs:
     profile:

commit 41f903c1b1c2c1821ff5d72e31d134cfa52029e2
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Feb 10 14:41:10 2020 -0300

    16141: Expands test for other object types.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/lib/controller/handler_test.go b/lib/controller/handler_test.go
index e8cd1efba..fac2f8a82 100644
--- a/lib/controller/handler_test.go
+++ b/lib/controller/handler_test.go
@@ -219,17 +219,13 @@ func (s *HandlerSuite) TestCreateAPIToken(c *check.C) {
 	c.Check(user.Authorization.TokenV2(), check.Equals, auth.TokenV2())
 }
 
-func (s *HandlerSuite) TestGetCollection(c *check.C) {
+func (s *HandlerSuite) CheckObjectType(c *check.C, url string, token string, skippedFields map[string]bool) {
 	var proxied, direct map[string]interface{}
 	var err error
-	skippedFields := map[string]bool{
-		"href": true,
-	}
 
 	// Get collection from controller
-	fooURL := "/arvados/v1/collections/" + arvadostest.FooCollection
-	req := httptest.NewRequest("GET", fooURL, nil)
-	req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)
+	req := httptest.NewRequest("GET", url, nil)
+	req.Header.Set("Authorization", "Bearer "+token)
 	resp := httptest.NewRecorder()
 	s.handler.ServeHTTP(resp, req)
 	c.Check(resp.Code, check.Equals, http.StatusOK)
@@ -242,7 +238,7 @@ func (s *HandlerSuite) TestGetCollection(c *check.C) {
 			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
 		},
 	}
-	resp2, err := client.Get(s.cluster.Services.RailsAPI.ExternalURL.String() + fooURL + "/?api_token=" + arvadostest.ActiveToken)
+	resp2, err := client.Get(s.cluster.Services.RailsAPI.ExternalURL.String() + url + "/?api_token=" + token)
 	c.Check(err, check.Equals, nil)
 	defer resp2.Body.Close()
 	db, err := ioutil.ReadAll(resp2.Body)
@@ -255,15 +251,38 @@ func (s *HandlerSuite) TestGetCollection(c *check.C) {
 		if _, ok := skippedFields[k]; ok {
 			continue
 		} else if val, ok := proxied[k]; ok {
-			if k == "manifest_text" {
+			if direct["kind"] == "arvados#collection" && k == "manifest_text" {
 				// Tokens differ from request to request
 				c.Check(strings.Split(val.(string), "+A")[0], check.Equals, strings.Split(direct[k].(string), "+A")[0])
 			} else {
 				c.Check(val, check.DeepEquals, direct[k],
-					check.Commentf("RailsAPI key %q's value %q differs from controller's %q.", k, direct[k], val))
+					check.Commentf("RailsAPI %s key %q's value %q differs from controller's %q.", direct["kind"], k, direct[k], val))
 			}
 		} else {
-			c.Errorf("Key %q missing on controller's response.", k)
+			c.Errorf("%s's key %q missing on controller's response.", direct["kind"], k)
 		}
 	}
 }
+
+func (s *HandlerSuite) TestGetObjects(c *check.C) {
+	testCases := map[string]map[string]bool{
+		"api_clients/" + arvadostest.TrustedWorkbenchAPIClientUUID:     map[string]bool{},
+		"api_client_authorizations/" + arvadostest.AdminTokenUUID:      map[string]bool{},
+		"authorized_keys/" + arvadostest.AdminAuthorizedKeysUUID:       map[string]bool{},
+		"collections/" + arvadostest.FooCollection:                     map[string]bool{"href": true},
+		"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{},
+		"links/" + arvadostest.ActiveUserCanReadAllUsersLinkUUID:       map[string]bool{},
+		"logs/" + arvadostest.CrunchstatForRunningJobLogUUID:           map[string]bool{},
+		"nodes/" + arvadostest.IdleNodeUUID:                            map[string]bool{},
+		"repositories/" + arvadostest.ArvadosRepoUUID:                  map[string]bool{},
+		"users/" + arvadostest.ActiveUserUUID:                          map[string]bool{"href": true},
+		"virtual_machines/" + arvadostest.TestVMUUID:                   map[string]bool{},
+		"workflows/" + arvadostest.WorkflowWithDefinitionYAMLUUID:      map[string]bool{},
+	}
+	for url, skippedFields := range testCases {
+		s.CheckObjectType(c, "/arvados/v1/"+url, arvadostest.AdminToken, skippedFields)
+	}
+}
diff --git a/sdk/go/arvadostest/fixtures.go b/sdk/go/arvadostest/fixtures.go
index 10b95c037..8a461473d 100644
--- a/sdk/go/arvadostest/fixtures.go
+++ b/sdk/go/arvadostest/fixtures.go
@@ -11,6 +11,7 @@ const (
 	ActiveTokenUUID         = "zzzzz-gj3su-077z32aux8dg2s1"
 	ActiveTokenV2           = "v2/zzzzz-gj3su-077z32aux8dg2s1/3kg6k6lzmp9kj5cpkcoxie963cmvjahbt2fod9zru30k1jqdmi"
 	AdminToken              = "4axaw8zxe0qm22wa6urpp5nskcne8z88cvbupv653y1njyi05h"
+	AdminTokenUUID          = "zzzzz-gj3su-027z32aux8dg2s1"
 	AnonymousToken          = "4kg6k6lzmp9kj4cpkcoxie964cmvjahbt4fod9zru44k4jqdmi"
 	DataManagerToken        = "320mkve8qkswstz7ff61glpk3mhgghmg67wmic7elw4z41pke1"
 	SystemRootToken         = "systemusertesttoken1234567890aoeuidhtnsqjkxbmwvzpy"
@@ -58,6 +59,20 @@ const (
 	WorkflowWithDefinitionYAMLUUID = "zzzzz-7fd4e-validworkfloyml"
 
 	CollectionReplicationDesired2Confirmed2UUID = "zzzzz-4zz18-434zv1tnnf2rygp"
+
+	KeepServiceZeroUUID = "zzzzz-bi6l4-6zhilxar6r8ey90"
+
+	ActiveUserCanReadAllUsersLinkUUID = "zzzzz-o0j2j-ctbysaduejxfrs5"
+
+	TrustedWorkbenchAPIClientUUID = "zzzzz-ozdt8-teyxzyd8qllg11h"
+
+	AdminAuthorizedKeysUUID = "zzzzz-fngyi-12nc9ov4osp8nae"
+
+	CrunchstatForRunningJobLogUUID = "zzzzz-57u5n-tmymyrojrbtnxh1"
+
+	IdleNodeUUID = "zzzzz-7ekkf-2z3mc76g2q73aio"
+
+	TestVMUUID = "zzzzz-2x53u-382brsig8rp3064"
 )
 
 // PathologicalManifest : A valid manifest designed to test

commit f4f0614d06c4ac9abeb34dc6df7c88ecb5feebda
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Feb 10 12:41:12 2020 -0300

    16141: Fixes Collection type on Go SDK. Adjusts test.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/lib/controller/handler_test.go b/lib/controller/handler_test.go
index 53f5e65c6..e8cd1efba 100644
--- a/lib/controller/handler_test.go
+++ b/lib/controller/handler_test.go
@@ -222,6 +222,9 @@ func (s *HandlerSuite) TestCreateAPIToken(c *check.C) {
 func (s *HandlerSuite) TestGetCollection(c *check.C) {
 	var proxied, direct map[string]interface{}
 	var err error
+	skippedFields := map[string]bool{
+		"href": true,
+	}
 
 	// Get collection from controller
 	fooURL := "/arvados/v1/collections/" + arvadostest.FooCollection
@@ -247,18 +250,20 @@ func (s *HandlerSuite) TestGetCollection(c *check.C) {
 	err = json.Unmarshal(db, &direct)
 	c.Check(err, check.Equals, nil)
 
-	// Check that all railsAPI provided keys exist on the controller response
-	// and their non-nil values are equal.
+	// Check that all RailsAPI provided keys exist on the controller response.
 	for k := range direct {
-		if val, ok := proxied[k]; ok {
+		if _, ok := skippedFields[k]; ok {
+			continue
+		} else if val, ok := proxied[k]; ok {
 			if k == "manifest_text" {
 				// Tokens differ from request to request
 				c.Check(strings.Split(val.(string), "+A")[0], check.Equals, strings.Split(direct[k].(string), "+A")[0])
-			} else if direct[k] != nil {
-				c.Check(val, check.DeepEquals, direct[k])
+			} else {
+				c.Check(val, check.DeepEquals, direct[k],
+					check.Commentf("RailsAPI key %q's value %q differs from controller's %q.", k, direct[k], val))
 			}
 		} else {
-			c.Errorf("Key %q missing", k)
+			c.Errorf("Key %q missing on controller's response.", k)
 		}
 	}
 }
diff --git a/sdk/go/arvados/collection.go b/sdk/go/arvados/collection.go
index 94390bc01..623a8d985 100644
--- a/sdk/go/arvados/collection.go
+++ b/sdk/go/arvados/collection.go
@@ -24,26 +24,25 @@ type Collection struct {
 	Name                      string                 `json:"name"`
 	CreatedAt                 time.Time              `json:"created_at"`
 	ModifiedAt                time.Time              `json:"modified_at"`
-	ModifiedByClientUUID      string                 `json:"modified_by_client_uuid"`
-	ModifiedByUserUUID        string                 `json:"modified_by_user_uuid"`
+	ModifiedByClientUUID      *string                `json:"modified_by_client_uuid"`
+	ModifiedByUserUUID        *string                `json:"modified_by_user_uuid"`
 	PortableDataHash          string                 `json:"portable_data_hash"`
 	ReplicationConfirmed      *int                   `json:"replication_confirmed"`
 	ReplicationConfirmedAt    *time.Time             `json:"replication_confirmed_at"`
 	ReplicationDesired        *int                   `json:"replication_desired"`
 	StorageClassesDesired     []string               `json:"storage_classes_desired"`
 	StorageClassesConfirmed   []string               `json:"storage_classes_confirmed"`
-	StorageClassesConfirmedAt time.Time              `json:"storage_classes_confirmed_at"`
+	StorageClassesConfirmedAt *time.Time             `json:"storage_classes_confirmed_at"`
 	DeleteAt                  *time.Time             `json:"delete_at"`
 	IsTrashed                 bool                   `json:"is_trashed"`
 	Properties                map[string]interface{} `json:"properties"`
 	WritableBy                []string               `json:"writable_by,omitempty"`
-	FileCount                 *int                   `json:"file_count"`
-	FileSizeTotal             *int                   `json:"file_size_total"`
+	FileCount                 int                    `json:"file_count"`
+	FileSizeTotal             int64                  `json:"file_size_total"`
 	Version                   *int                   `json:"version"`
 	PreserveVersion           bool                   `json:"preserve_version"`
 	CurrentVersionUUID        string                 `json:"current_version_uuid"`
-	Description               string                 `json:"description"`
-	Href                      string                 `json:"href"`
+	Description               *string                `json:"description"`
 }
 
 func (c Collection) resourceName() string {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list