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

pulibrary / tigerdata-app / d7ce1bf9-25b8-4b3e-b9dd-43f9a26f2d96

17 Oct 2025 05:51PM UTC coverage: 91.054%. Remained the same
d7ce1bf9-25b8-4b3e-b9dd-43f9a26f2d96

Pull #2055

circleci

jrgriffiniii
- 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
Pull Request #2055: Ensuring that `parallelism` is set to 4 for CircleCI and separates `system` and inconsistently-failing tests into separate CI jobs

2738 of 3007 relevant lines covered (91.05%)

380.37 hits per line

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

95.0
/app/models/mediaflux/project_update_request.rb
1
# frozen_string_literal: true
2
module Mediaflux
2✔
3
  class ProjectUpdateRequest < Request
2✔
4
    attr_reader :project, :project_metadata
2✔
5

6
    # Constructor
7
    # @param session_token [String] the API token for the authenticated session
8
    # @param project [Project] project to be created in Mediaflux
9
    def initialize(session_token:, project:)
2✔
10
      super(session_token: session_token)
2✔
11
      @project = project
2✔
12
      @id = @project.mediaflux_id
2✔
13
      @xml_namespace = self.class.default_xml_namespace
2✔
14
      @xml_namespace_uri = self.class.default_xml_namespace_uri
2✔
15
      @project_metadata = project.metadata_model
2✔
16
    end
17

18
    # Specifies the Mediaflux service to use when updating assets
19
    # @return [String]
20
    def self.service
2✔
21
      "asset.set"
3✔
22
    end
23

24
    private
2✔
25

26
      # The generated XML mimics what we get when we issue an Aterm command as follows:
27
      # > asset.set :id 1234
28
      #     :meta <
29
      #       :tigerdata:project <
30
      #         :title "RDSS test project"
31
      #         :description "The description of the project"
32
      #         ...the rest of the fields go here..
33
      #       >
34
      #     >
35
      #
36
      # rubocop:disable Metrics/MethodLength
37
      # rubocop:disable Metrics/AbcSize
38
      # rubocop:disable Metrics/BlockLength
39
      def build_http_request_body(name:)
2✔
40
        super do |xml|
3✔
41
          xml.args do
3✔
42
            xml.id @id
3✔
43
            xml.meta do
3✔
44
              doc = xml.doc
3✔
45
              root = doc.root
3✔
46
              root.add_namespace_definition(@xml_namespace, @xml_namespace_uri)
3✔
47

48
              element_name = "#{@xml_namespace}:project"
3✔
49
              xml.send(element_name) do
3✔
50
                xml.ProjectDirectory project.project_directory
3✔
51
                xml.Title project_metadata.title
3✔
52
                if project_metadata.description.blank?
3✔
53
                  xml.Description "description not provided"
×
54
                else
55
                  xml.Description project_metadata.description
3✔
56
                end
57
                # xml.Status project_metadata.status
58
                # xml.SchemaVersion TigerdataSchema::SCHEMA_VERSION
59
                xml.DataSponsor project_metadata.data_sponsor
3✔
60
                xml.DataManager project_metadata.data_manager
3✔
61
                departments = project_metadata.departments || []
3✔
62
                departments.each do |department|
3✔
63
                  xml.Department department
6✔
64
                end
65
                # xml.CreatedBy project_metadata.created_by
66
                ro_users = project_metadata.ro_users || []
3✔
67
                rw_users = project_metadata.rw_users || []
3✔
68
                all_users = ro_users + rw_users
3✔
69
                data_users = all_users.join(",")
3✔
70
                if data_users.blank?
3✔
71
                  xml.DataUser "n/a"
3✔
72
                else
73
                  xml.DataUser data_users
×
74
                end
75
                # created_on = Mediaflux::Time.format_date_for_mediaflux(project_metadata.created_on)
76
                # xml.CreatedOn created_on
77
                # xml.UpdatedBy project_metadata.updated_by
78
                # updated_on = Mediaflux::Time.format_date_for_mediaflux(project_metadata.updated_on)
79
                # xml.UpdatedOn updated_on
80
                # xml.ProjectID project_metadata.project_id
81
                # capacity = project_metadata.storage_capacity
82
                # xml.StorageCapacity do
83
                #   xml.Size capacity["size"]["requested"]
84
                #   xml.Unit capacity["unit"]["requested"]
85
                # end
86
                # performance = project_metadata.storage_performance_expectations
87
                # xml.Performance do
88
                #   xml.parent.set_attribute("Requested", performance["requested"])
89
                #   xml.text(performance["requested"])
90
                # end
91
                # xml.Submission do
92
                #   xml.RequestedBy project_metadata.created_by
93
                #   xml.RequestDateTime created_on
94
                # end
95
                # xml.ProjectPurpose project_metadata.project_purpose
96
              end
97
            end
98
          end
99
        end
100
      end
101
    # rubocop:enable Metrics/AbcSize
102
    # rubocop:enable Metrics/MethodLength
103
    # rubocop:enable Metrics/BlockLength
104
  end
105
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