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

pulibrary / tigerdata-app / 47f8b36e-6cbd-422b-b67d-16bb6ff637e9

29 Oct 2025 11:56AM UTC coverage: 82.265% (-9.1%) from 91.333%
47f8b36e-6cbd-422b-b67d-16bb6ff637e9

Pull #2118

circleci

bess
Update expected version of mediaflux
Pull Request #2118: Upgrade to mediaflux_dev v0.17.0

1 of 1 new or added line in 1 file covered. (100.0%)

568 existing lines in 35 files now uncovered.

2528 of 3073 relevant lines covered (82.26%)

296.63 hits per line

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

32.0
/app/services/test_project_generator.rb
1
# frozen_string_literal: true
UNCOV
2
class TestProjectGenerator
1✔
UNCOV
3
  attr_reader :user, :number, :sequence, :project_prefix
1✔
4

UNCOV
5
  def initialize(user:, number:, project_prefix:)
1✔
UNCOV
6
    @user = user
×
UNCOV
7
    @number = number
×
UNCOV
8
    @sequence = number.to_s.rjust(5, "0")
×
UNCOV
9
    @project_prefix = project_prefix
×
UNCOV
10
  end
11

UNCOV
12
  def generate
1✔
UNCOV
13
    request = create_request
×
UNCOV
14
    project = request.approve(user)
×
UNCOV
15
    project.save!
×
UNCOV
16
    project
×
UNCOV
17
  end
18

UNCOV
19
  private
1✔
20

UNCOV
21
    def create_request
1✔
22
      # create a duplicate copy of the configuration so we do not modify the rails defaults
UNCOV
23
      capacity = Rails.configuration.project_defaults[:storage_capacity].deep_dup
×
24

UNCOV
25
      Request.create(metadata(capacity))
×
UNCOV
26
    end
27

28
    # rubocop:disable Metrics/MethodLength
UNCOV
29
    def metadata(capacity)
1✔
UNCOV
30
      {
UNCOV
31
        data_sponsor: "tigerdatatester", # Must be a valid netid/uid
×
UNCOV
32
        data_manager: "tigerdatatester", # Must be a valid netid/uid
UNCOV
33
        user_roles: [],
UNCOV
34
        quota: "custom",
UNCOV
35
        storage_size: capacity[:size][:requested],
UNCOV
36
        storage_unit: capacity[:unit][:requested],
37
        # For testing purposes we use the same size as the requested values
UNCOV
38
        approved_quota: "custom",
UNCOV
39
        approved_storage_size: capacity[:size][:requested],
UNCOV
40
        approved_storage_unit: capacity[:unit][:requested],
UNCOV
41
        project_title: "Project #{project_prefix} #{sequence}",
UNCOV
42
        departments: departments,
UNCOV
43
        description: "Description of project #{project_prefix} #{sequence}",
UNCOV
44
        project_folder: "#{project_prefix}-#{sequence}",
UNCOV
45
        project_purpose: Rails.configuration.project_defaults[:project_purpose]
46
        # storage_performance_expectations: Rails.configuration.project_defaults[:storage_performance_expectations]
UNCOV
47
      }
UNCOV
48
    end
49
    # rubocop:enable Metrics/MethodLength
50

UNCOV
51
    def departments
1✔
UNCOV
52
      ldepartments = []
×
UNCOV
53
      ldepartments << Affiliation.all[3] if (number % 7) == 0
×
UNCOV
54
      ldepartments << Affiliation.all[2] if (number % 3) == 0
×
UNCOV
55
      ldepartments << Affiliation.all[1] if (number % 5) == 0
×
UNCOV
56
      ldepartments << Affiliation.all[0] if ldepartments.count == 0
×
UNCOV
57
      ldepartments
×
UNCOV
58
    end
UNCOV
59
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