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

pulibrary / tigerdata-app / f7329e4d-6695-4253-bf5c-53543b2c2203

28 Feb 2025 04:36PM UTC coverage: 84.229% (-0.3%) from 84.51%
f7329e4d-6695-4253-bf5c-53543b2c2203

Pull #1329

circleci

hectorcorrea
Adds rake task to attach a file to a file inventory job
Pull Request #1329: Adds rake task to attach a file to a file inventory job

4 of 4 branches covered (100.0%)

3 of 13 new or added lines in 1 file covered. (23.08%)

2398 of 2847 relevant lines covered (84.23%)

459.6 hits per line

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

23.08
/lib/tasks/file_inventory.rake
1
# frozen_string_literal: true
2

3
namespace :file_inventory do
1✔
4
  desc "Attaches a file to a file inventory job"
1✔
5
  task :attach_file, [:job_id, :filename] => [:environment] do |_, args|
1✔
NEW
6
    job_id = args[:job_id]
×
NEW
7
    filename = args[:filename]
×
8

NEW
9
    request = FileInventoryRequest.where(job_id: job_id).first
×
NEW
10
    raise "Job #{job_id} not found" if request.nil?
×
NEW
11
    raise "File #{filename} not found" unless File.exist?(filename)
×
12

NEW
13
    puts "Attaching file #{filename} to job #{job_id}"
×
NEW
14
    request.completion_time = Time.current.in_time_zone("America/New_York")
×
NEW
15
    request.state = "completed"
×
NEW
16
    request.request_details = { file_size: File.size(filename), output_file: filename }
×
NEW
17
    request.save!
×
18
  end
19
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