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

pulibrary / tigerdata-app / 6a5be3a8-ecd4-400d-9134-33099047b33b

21 Oct 2025 03:31PM UTC coverage: 91.184% (+0.1%) from 91.054%
6a5be3a8-ecd4-400d-9134-33099047b33b

push

circleci

web-flow
Ensuring that `parallelism` is set to 4 for CircleCI and separates `system` tests into separate CI jobs (#2055)

* - Ensuring that `parallelism` is set to 4
- Separating `system` RSpec spec suites in the CI build
- Using an `inconsistent` RSpec tag to mark inconsistently failing tests
- Ensuring that CI does not run for `inconsistent` tests

* Removing `inconsistent` tag for RSpec test suites

2741 of 3006 relevant lines covered (91.18%)

763.77 hits per line

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

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

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

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

19
  private
3✔
20

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

25
      Request.create(metadata(capacity))
2✔
26
    end
27

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

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