• 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

23.08
/app/models/scsb_full_records_request.rb
1
class ScsbFullRecordsRequest
1✔
2
  attr_accessor :scsb_env, :email
1✔
3

4
  def initialize(scsb_env, email)
1✔
UNCOV
5
    @scsb_env = scsb_env
×
UNCOV
6
    @email = email
×
7
  end
8

9
  def scsb_host
1✔
UNCOV
10
    case scsb_env
×
11
    when 'uat'
UNCOV
12
      'https://uat-recap.htcinc.com:9093'
×
13
    when 'production'
UNCOV
14
      'https://scsb.recaplib.org:9093'
×
15
    end
16
  end
17

18
  def scsb_conn
1✔
UNCOV
19
    Faraday.new(url: scsb_host) do |faraday|
×
UNCOV
20
      faraday.request(:url_encoded)
×
21
    end
22
  end
23

24
  # See https://scsb.recaplib.org:9093/swagger-ui.html#/data-dump-rest-controller/exportDataDump for documentation
25
  def scsb_request(institution_code)
1✔
UNCOV
26
    response = scsb_conn.get do |req|
×
UNCOV
27
      req.path = '/dataDump/exportDataDump'
×
UNCOV
28
      req.params['collectionGroupIds'] = '1,2,5,6'
×
UNCOV
29
      req.params['emailToAddress'] = email
×
UNCOV
30
      req.params['fetchType'] = 10
×
UNCOV
31
      req.params['imsDepositoryCodes'] = repository_codes(institution_code)
×
UNCOV
32
      req.params['institutionCodes'] = institution_code
×
UNCOV
33
      req.params['outputFormat'] = 0
×
UNCOV
34
      req.params['requestingInstitutionCode'] = 'PUL'
×
UNCOV
35
      req.params['transmissionType'] = 0
×
UNCOV
36
      req.headers['Accept'] = '*/*'
×
UNCOV
37
      req.headers['api_key'] = scsb_auth_key
×
38
    end
UNCOV
39
    expected_response_body = 'Export process has started and we will send an email notification upon completion'
×
UNCOV
40
    Rails.logger.error("Received unexpected response: #{response.body}") unless response.body == expected_response_body
×
UNCOV
41
    response
×
42
  rescue Faraday::ConnectionFailed, Faraday::TimeoutError => e
43
    Rails.logger.warn("#{self.class}: Connection error for #{scsb_server}")
×
44
    raise e
×
45
  end
46

47
  def repository_codes(institution_code)
1✔
UNCOV
48
    case institution_code
×
49
    when 'PUL', 'CUL'
UNCOV
50
      'RECAP'
×
51
    when 'HL'
UNCOV
52
      'RECAP,HD'
×
53
    end
54
  end
55

56
  private
1✔
57

58
    def scsb_auth_key
1✔
UNCOV
59
      if Rails.env.test?
×
UNCOV
60
        'TESTME'
×
61
      else
62
        ENV['SCSB_AUTH_KEY']
×
63
      end
64
    end
65
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