• 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

27.27
/app/models/scsb/partner_updates/full.rb
1
module Scsb
1✔
2
  class PartnerUpdates
1✔
3
    class Full < Update
1✔
4
      def initialize(dump:, dump_file_type:, timestamp: DateTime.now.to_time)
1✔
UNCOV
5
        super
×
6
      end
7

8
      def self.validate_csv(dump_id, file, institution)
1✔
UNCOV
9
        matches_expected_collections = false
×
UNCOV
10
        raise StandardError, "No metadata files found matching #{institution}" unless file
×
11

UNCOV
12
        csv = CSV.read(file, headers: true)
×
UNCOV
13
        group_ids = csv['Collection Group Id(s)'].first
×
UNCOV
14
        matches_expected_collections = group_ids == '1*2*5*6'
×
UNCOV
15
        filename = File.basename(file)
×
UNCOV
16
        scsb_file_dir = ENV['SCSB_FILE_DIR']
×
UNCOV
17
        destination_filepath = "#{scsb_file_dir}/#{filename}"
×
UNCOV
18
        FileUtils.move(file, destination_filepath)
×
UNCOV
19
        Dump.attach_dump_file(dump_id, destination_filepath, :recap_records_full_metadata)
×
UNCOV
20
        File.unlink(destination_filepath) if File.exist?(destination_filepath)
×
UNCOV
21
        unless matches_expected_collections
×
UNCOV
22
          raise StandardError, "Metadata file indicates that dump for #{institution} does not include the correct Group IDs, not processing. Group ids: #{group_ids}"
×
23
        end
24

UNCOV
25
        matches_expected_collections
×
26
      end
27

28
      def self.download_full_file(institution, extension)
1✔
UNCOV
29
        Scsb::S3Bucket.partner_transfer_client.download_recent(
×
30
          prefix: ENV['SCSB_S3_PARTNER_FULLS'] || 'data-exports/PUL/MARCXml/Full',
31
          output_directory: ENV['SCSB_PARTNER_UPDATE_DIRECTORY'] || '/tmp/updates',
32
          file_filter: /#{institution}.*\.#{extension}/
33
        )
34
      end
35
    end
36
  end
37
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