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

pulibrary / tigerdata-app / 8306569a-4f72-444d-ba8a-d69ed227106c

05 Nov 2025 07:43PM UTC coverage: 91.527% (+0.03%) from 91.5%
8306569a-4f72-444d-ba8a-d69ed227106c

push

circleci

web-flow
Set the displayed value to the entire name (#2151)

Centralize the view and javascript for data manager and sponsor
Set the displayed value to the entire name and have a hidden field with
the uid

fix spec error "not to search for nil"
<img width="1707" height="1085" alt="Screenshot 2025-11-05 at 2 38
43 PM"
src="https://github.com/user-attachments/assets/82278712-d16d-4b58-8b9c-5c33587a7810"
/>

6 of 10 new or added lines in 1 file covered. (60.0%)

1010 existing lines in 37 files now uncovered.

2841 of 3104 relevant lines covered (91.53%)

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

UNCOV
15
  def generate
2✔
UNCOV
16
    generate_level(@project.mediaflux_id, levels)
14✔
UNCOV
17
  end
18

UNCOV
19
  private
2✔
20

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

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