[ARVADOS] updated: 2.1.0-1416-g290695c42

Git user git at public.arvados.org
Wed Sep 29 14:17:37 UTC 2021


Summary of changes:
 services/api/test/integration/logging_test.rb | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 services/api/test/integration/logging_test.rb

       via  290695c429ea536bd4e4ee01ff76e0d770bc8021 (commit)
      from  dcd77dd78f89a225cc9bcefc1930f8a54bc62791 (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 290695c429ea536bd4e4ee01ff76e0d770bc8021
Author: Tom Clegg <tom at curii.com>
Date:   Wed Sep 29 10:17:11 2021 -0400

    17830: Add test for logging request ID.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/api/test/integration/logging_test.rb b/services/api/test/integration/logging_test.rb
new file mode 100644
index 000000000..cbf9681d4
--- /dev/null
+++ b/services/api/test/integration/logging_test.rb
@@ -0,0 +1,28 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+require 'stringio'
+
+class LoggingTest < ActionDispatch::IntegrationTest
+  fixtures :collections
+
+  test "request_id" do
+    buf = StringIO.new
+    logcopy = ActiveSupport::Logger.new(buf)
+    logcopy.level = :info
+    begin
+      Rails.logger.extend(ActiveSupport::Logger.broadcast(logcopy))
+      get "/arvados/v1/collections/#{collections(:foo_file).uuid}",
+          params: {:format => :json},
+          headers: auth(:active).merge({ 'X-Request-Id' => 'req-aaaaaaaaaaaaaaaaaaaa' })
+      assert_response :success
+      assert_match /^{.*"request_id":"req-aaaaaaaaaaaaaaaaaaaa"/, buf.string
+    ensure
+      # We don't seem to have an "unbroadcast" option, so this is how
+      # we avoid filling buf with unlimited logs from subsequent
+      # tests.
+      logcopy.level = :fatal
+    end
+  end
+end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list