• 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

100.0
/app/services/xml_tree_builder.rb
1
# frozen_string_literal: true
2

3
class XmlTreeBuilder < XmlNodeBuilder
4✔
4
  attr_reader :children, :root_builder_options
4✔
5

6
  def null_builder
4✔
7
    @null_builder ||= XmlNullBuilder.new(**root_builder_options)
676✔
8
  end
9

10
  def root_builder
4✔
11
    @root_builder ||= begin
8,362✔
12
                        default_builder = XmlElementBuilder.new(**root_builder_options)
1,673✔
13
                        null_builder if default_builder.blank?
1,673✔
14
                        default_builder
1,673✔
15
                      end
16
  end
17

18
  delegate :node, :document, to: :root_builder
4✔
19

20
  # @return [Nokogiri::XML::Element]
21
  def build
4✔
22
    nodes = children.map(&:build)
1,673✔
23
    nodes.each do |child|
1,673✔
24
      root_builder.add_child(child)
1,627✔
25
    end
26

27
    node
1,673✔
28
  end
29

30
  # rubocop:disable Metrics/AbcSize
31
  # rubocop:disable Metrics/MethodLength
32
  #
33
  # @param [Array<Hash>] entries options for constructing each child node
34
  # @return [Array<Nokogiri::XML::Node>] an array of XML child nodes
35
  def parse_child_entries(entries)
4✔
36
    instances = [:default]
1,673✔
37
    builders = entries.map do |child_entry|
1,673✔
38
      child_entry.values.map do |child_args|
855✔
39
        multiple_children = child_args[:multiple] || false
1,620✔
40

41
        if multiple_children
1,620✔
42
          message = child_args[:object_method]
135✔
43

44
          method_args = child_args[:args] || []
135✔
45
          instances = root_builder.presenter.send(message, *method_args)
135✔
46
        end
47

48
        instances.each_with_index.map do |_instance, i|
1,620✔
49
          builder_args = child_args.dup
1,627✔
50
          builder_args[:presenter] = root_builder.presenter
1,627✔
51
          builder_args[:document] = document
1,627✔
52

53
          if multiple_children
1,627✔
54
            builder_args[:index] = i
142✔
55
            builder_args.delete(:multiple)
142✔
56
          end
57
          builder_args.delete(:object_method)
1,627✔
58
          builder_args.delete(:args)
1,627✔
59
          self.class.new(**builder_args)
1,627✔
60
        end
61
      end
62
    end
63
    builders.flatten
1,673✔
64
  end
65
  # rubocop:enable Metrics/MethodLength
66
  # rubocop:enable Metrics/AbcSize
67

68
  # @param children [Array<XmlNodeBuilder>] XmlNodeBuilder objects for the child nodes in the XML tree
69
  # @param options [Hash] arguments for the root XmlElementBuilder
70
  def initialize(children: [], **options)
4✔
71
    @root_builder_options = options.dup
1,673✔
72
    @children = parse_child_entries(children)
1,673✔
73

74
    super(document: document)
1,673✔
75
  end
76
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