• 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_asset_generator.rb
1
# frozen_string_literal: true
2
class TestAssetGenerator
3✔
3
  attr_reader :levels, :base_name, :file_count_per_directory, :directory_per_level, :mediaflux_session
3✔
4
  def initialize(user:, project_id:, levels: 5, directory_per_level: 100, file_count_per_directory: 1000)
3✔
5
    @user = user
20✔
6
    @project = Project.find(project_id)
20✔
7
    @levels = levels
20✔
8
    @directory_per_level = directory_per_level
20✔
9
    @file_count_per_directory = file_count_per_directory
20✔
10
    # Only use the last part of the path as the base (so we don't get the root "tigerdata/")
11
    @base_name = @project.project_directory_short.split("/").last
20✔
12
    @mediaflux_session = @user.mediaflux_session
20✔
13
  end
14

15
  def generate
3✔
16
    generate_level(@project.mediaflux_id, levels)
20✔
17
  end
18

19
  private
3✔
20

21
    def generate_level(parent_id, level)
3✔
22
      return if level == 0
54✔
23
      collection = Mediaflux::AssetCreateRequest.new(session_token: mediaflux_session, name: "#{base_name}-#{level}", pid: parent_id)
34✔
24
      collection_id = collection.id  # resolves the request and extracts the id
34✔
25
      generate_directory(collection_id, directory_per_level)
34✔
26
      generate_level(collection_id, level - 1)
34✔
27
    end
28

29
    def generate_directory(parent_id, directory_count)
3✔
30
      return if directory_count == 0
94✔
31
      name_extention = (0...10).map { ("a".."z").to_a[rand(26)] }.join
660✔
32
      dir_collection = Mediaflux::AssetCreateRequest.new(session_token: mediaflux_session, name: "#{base_name}-#{parent_id}-#{name_extention}", pid: parent_id)
60✔
33
      dir_collection_id = dir_collection.id
60✔
34
      raise dir_collection.response_error.to_s if dir_collection_id.blank?
60✔
35
      Mediaflux::TestAssetCreateRequest.new(session_token: mediaflux_session, parent_id: dir_collection_id, count: file_count_per_directory).resolve
60✔
36
      generate_directory(parent_id, directory_count - 1)
60✔
37
    end
38
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