15219: Tests for exception backtraces being included on the json log.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Fri, 12 Jul 2019 19:50:35 +0000 (16:50 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Fri, 12 Jul 2019 19:50:35 +0000 (16:50 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

services/api/test/functional/application_controller_test.rb

index b74ff0f41d6d5190f217df7cc776490d0e8e9d83..175a8f71ea0544e2253754f607a2217a441d63cc 100644 (file)
@@ -121,4 +121,16 @@ class ApplicationControllerTest < ActionController::TestCase
       end
     end
   end
+
+  test "exceptions with backtraces get logged at exception_backtrace key" do
+    Group.stubs(:new).raises(Exception, 'Whoops')
+    Rails.logger.expects(:info).with(any_parameters) do |param|
+      param.include?('Whoops') and param.include?('"exception_backtrace":')
+    end
+    @controller = Arvados::V1::GroupsController.new
+    authorize_with :active
+    post :create, params: {
+      group: {},
+    }
+  end
 end