• 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

32.14
/app/jobs/import/partner/full.rb
1
module Import
1✔
2
  module Partner
1✔
3
    class Full
1✔
4
      include Sidekiq::Job
1✔
5
      def perform
1✔
UNCOV
6
        FileUtils.mkdir_p(update_directory)
×
UNCOV
7
        delete_stale_files
×
UNCOV
8
        event = Event.new
×
UNCOV
9
        event.start = Time.now.utc
×
UNCOV
10
        event.save!
×
UNCOV
11
        event.dump = created_dump(event)
×
UNCOV
12
        event.save!
×
UNCOV
13
        overall = Sidekiq::Batch.new
×
UNCOV
14
        overall.description = "Full partner update process for event: #{event.id}"
×
UNCOV
15
        overall.on(:success, 'Import::Partner::FullCallbacks#overall_success', 'event_id' => event.id)
×
UNCOV
16
        overall.jobs do
×
UNCOV
17
          Import::Partner::StartWorkflowJob.perform_async(event.dump.id)
×
18
        end
19
      end
20

21
      private
1✔
22

23
        def update_directory
1✔
UNCOV
24
          ENV.fetch('SCSB_PARTNER_UPDATE_DIRECTORY', '/tmp/updates')
×
25
        end
26

27
        def created_dump(event)
1✔
UNCOV
28
          Dump.create!(dump_type: :partner_recap_full, event_id: event.id)
×
29
        end
30

31
        def delete_stale_files
1✔
UNCOV
32
          files_to_delete = Dir.glob("#{update_directory}/*.zip")
×
33
                               .concat(Dir.glob("#{update_directory}/*.xml"))
34
                               .concat(Dir.glob("#{update_directory}/*.csv"))
UNCOV
35
          files_to_delete.each do |file|
×
UNCOV
36
            FileUtils.rm file
×
37
          rescue Errno::ENOENT
UNCOV
38
            Rails.logger.warn("Attempted to delete file #{file}, but it was no longer present on the filesystem")
×
UNCOV
39
            next
×
40
          end
41
        end
42
    end
43
  end
44
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