Merge branch 'main' into 18995-code-cleanup-1
authorWard Vandewege <ward@curii.com>
Fri, 15 Apr 2022 15:44:51 +0000 (11:44 -0400)
committerWard Vandewege <ward@curii.com>
Fri, 15 Apr 2022 15:45:06 +0000 (11:45 -0400)
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

apps/workbench/test/integration/pipeline_instances_test.rb
lib/config/deprecated.go
lib/config/load_test.go
services/api/app/controllers/arvados/v1/groups_controller.rb
services/api/test/functional/arvados/v1/groups_controller_test.rb

index b6e86d8ae5556d98b8f9d6f2fd8d5b8114035c1f..732e3609991c445f80a49a916d34651f90f96120 100644 (file)
@@ -37,30 +37,6 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
     DateTime.parse(utc).to_time
   end
 
-  if false
-    # No need to test (or mention) these all the time. If they start
-    # working (without need_selenium) then some real tests might not
-    # need_selenium any more.
-
-    test 'phantomjs DST' do
-      skip '^^'
-      t0s = '3/8/2015, 01:59 AM'
-      t1s = '3/8/2015, 03:01 AM'
-      t0 = parse_browser_timestamp t0s
-      t1 = parse_browser_timestamp t1s
-      assert_equal 120, t1-t0, "'#{t0s}' to '#{t1s}' was reported as #{t1-t0} seconds, should be 120"
-    end
-
-    test 'phantomjs DST 2' do
-      skip '^^'
-      t0s = '2015-03-08T10:43:00Z'
-      t1s = '2015-03-09T03:43:00Z'
-      t0 = parse_browser_timestamp page.evaluate_script("new Date('#{t0s}').toLocaleString()")
-      t1 = parse_browser_timestamp page.evaluate_script("new Date('#{t1s}').toLocaleString()")
-      assert_equal 17*3600, t1-t0, "'#{t0s}' to '#{t1s}' was reported as #{t1-t0} seconds, should be #{17*3600} (17 hours)"
-    end
-  end
-
   test 'view pipeline with job and see graph' do
     visit page_with_token('active_trustedclient', '/pipeline_instances')
     assert page.has_text? 'pipeline_with_job'
index e9c5da1064848fe5917cfa882d937302e2b33c29..d53e7ae34096363f5f22c810d02d2da75c682f58 100644 (file)
@@ -125,7 +125,6 @@ func (ldr *Loader) applyDeprecatedVolumeDriverParameters(cfg *arvados.Config) er
                                if params.AccessKey != "" || params.SecretKey != "" {
                                        if params.AccessKeyID != "" || params.SecretAccessKey != "" {
                                                return fmt.Errorf("cannot use old keys (AccessKey/SecretKey) and new keys (AccessKeyID/SecretAccessKey) at the same time in %s.Volumes.%s.DriverParameters -- you must remove the old config keys", clusterID, volID)
-                                               continue
                                        }
                                        var allparams map[string]interface{}
                                        err = json.Unmarshal(vol.DriverParameters, &allparams)
index 5270dcccce8b9d95b5b5fdb1e6fe9ad15f2e0426..2d87b906c9b399f49f243d170984a31d712f6ed9 100644 (file)
@@ -338,11 +338,7 @@ func (s *LoadSuite) TestUnacceptableTokens(c *check.C) {
        } {
                c.Logf("trying bogus config: %s", trial.example)
                _, err := testLoader(c, "Clusters:\n zzzzz:\n  "+trial.example, nil).Load()
-               if trial.short {
-                       c.Check(err, check.ErrorMatches, `Clusters.zzzzz.`+trial.configPath+`: unacceptable characters in token.*`)
-               } else {
-                       c.Check(err, check.ErrorMatches, `Clusters.zzzzz.`+trial.configPath+`: unacceptable characters in token.*`)
-               }
+               c.Check(err, check.ErrorMatches, `Clusters.zzzzz.`+trial.configPath+`: unacceptable characters in token.*`)
        }
 }
 
index c1dc7a49612162aa9fcc79211c4358e77005da5b..3473c7e4e0c361e3c594569f83178e2ea18ebed2 100644 (file)
@@ -103,7 +103,7 @@ class Arvados::V1::GroupsController < ApplicationController
 
   def destroy
     if !TRASHABLE_CLASSES.include?(@object.group_class)
-      return @object.destroy
+      @object.destroy
       show
     else
       super # Calls destroy from TrashableController module
index fcdce0e600d6572fc69b682cd8b5ef68036d633a..cfcb33d40a743c21cbbd8ae0ff1ec7dd15c5945e 100644 (file)
@@ -787,6 +787,28 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
     end
   end
 
+  # the group class overrides the destroy method. Make sure that the destroyed
+  # object is returned
+  [
+    {group_class: "project"},
+    {group_class: "role"},
+    {group_class: "filter", properties: {"filters":[]}},
+  ].each do |params|
+    test "destroy group #{params} returns object" do
+      authorize_with :active
+
+      group = Group.create!(params)
+
+      post :destroy, params: {
+            id: group.uuid,
+            format: :json,
+          }
+      assert_response :success
+      assert_not_nil json_response
+      assert_equal group.uuid, json_response["uuid"]
+    end
+  end
+
   test 'get shared owned by another user' do
     authorize_with :user_bar_in_sharing_group