• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / 1dcebae2-3318-4e77-bc53-82276e293354

02 May 2025 04:45PM UTC coverage: 28.256% (-63.9%) from 92.189%
1dcebae2-3318-4e77-bc53-82276e293354

push

circleci

sandbergja
Add basic infrastructure for compiling rust code

* Add a rake compile task to compile
* Run the rake task in CI
* Run the rake task before rspec tests with the rust tag, to provide quick feedback on rust changes in TDD cycles

2 of 7 new or added lines in 2 files covered. (28.57%)

2467 existing lines in 97 files now uncovered.

1089 of 3854 relevant lines covered (28.26%)

0.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/adapters/alma_adapter/execute.rb
UNCOV
1
class AlmaAdapter::Execute
×
2
  # Makes a call to the Alma gem using custom configuration options.
3
  #
4
  # @param options [Hash] custom configuration options to use for the Alma API call. Some
5
  # of the possible options are:
6
  #
7
  #   enable_loggable (boolean): True to request Alma to preserve the original exception
8
  #     to that we can handle PER_SECOND_THRESHOLD errors (otherwise we cannnot distinguish
9
  #     threshold errors from any other).
10
  #
11
  #   timeout (seconds): Used to allow longer requests than the default (5 seconds).
12
  #
13
  #   For a full list of options see https://github.com/tulibraries/alma_rb/blob/main/lib/alma/config.rb
14
  #
15
  # @param message [String] Message to include when logging the call.
UNCOV
16
  def self.call(options:, message:)
×
17
    # Saves the current values of the options to customize
UNCOV
18
    original = {}
×
UNCOV
19
    options.keys.each do |key|
×
UNCOV
20
      original[key] = Alma.configuration.send(key.to_s)
×
UNCOV
21
    end
×
UNCOV
22
    start = Time.now
×
UNCOV
23
    begin
×
24
      # Sets the new configuration values
UNCOV
25
      options.keys.each do |key|
×
UNCOV
26
        Alma.configure { |config| config.send(key.to_s + '=', options[key]) }
×
UNCOV
27
      end
×
UNCOV
28
      yield
×
UNCOV
29
    ensure
×
30
      # Restore the options to their original values
UNCOV
31
      options.keys.each do |key|
×
UNCOV
32
        Alma.configure { |config| config.send(key.to_s + '=', original[key]) }
×
UNCOV
33
      end
×
UNCOV
34
      log_elapsed(start, message)
×
UNCOV
35
    end
×
UNCOV
36
  end
×
37

UNCOV
38
  def self.log_elapsed(start, msg)
×
UNCOV
39
    elapsed_ms = ((Time.now - start) * 1000).to_i
×
UNCOV
40
    if elapsed_ms > 3000
×
41
      Rails.logger.warn("ELAPSED: #{msg} took #{elapsed_ms} ms")
×
UNCOV
42
    else
×
UNCOV
43
      Rails.logger.info("ELAPSED: #{msg} took #{elapsed_ms} ms")
×
UNCOV
44
    end
×
UNCOV
45
  end
×
UNCOV
46
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc