junit_timing_splitter 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/junit_timing_splitter/cli.rb +1 -1
- data/lib/junit_timing_splitter/splitter.rb +11 -2
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd393cd51b716e271af1271a0ca3fd8f6625eeb8dfee191651bd60148fd48f7c
|
4
|
+
data.tar.gz: 40275aa106181fcbc87018c8451a2184ff08af2d3a7b25c279cc9edfbe8230d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dc4b813e394e62e5edc74910515dd5d3fcdf905a6684ee60daa43b9c3431d7e1508bdf6d0e9560750f58b19c9210798bea9b4a356cb3555c024c400c2e46b5b
|
7
|
+
data.tar.gz: 87c111bb31bff75029f587bf526877d97ab9eea0464b6ac97b6eb9c4550978b7b723823d34746eb246c13155b3644f1e46f99b6070d99eb903c1e9a2739349b0
|
@@ -65,7 +65,7 @@ module JunitTimingSplitter
|
|
65
65
|
if missing_files.empty?
|
66
66
|
puts 'No missing test files to merge.'
|
67
67
|
else
|
68
|
-
splitter = JunitTimingSplitter::Splitter.new([], schema.buckets.size)
|
68
|
+
splitter = JunitTimingSplitter::Splitter.new([], schema.buckets.size, existing_schema: schema.buckets)
|
69
69
|
buckets = splitter.merge_missing_files(missing_files)
|
70
70
|
buckets_as_hashes = buckets.map(&:to_h)
|
71
71
|
File.write(options[:schema], JSON.pretty_generate(buckets_as_hashes))
|
@@ -2,10 +2,19 @@ module JunitTimingSplitter
|
|
2
2
|
class Splitter
|
3
3
|
attr_reader :parsed_timings, :total_splits, :buckets
|
4
4
|
|
5
|
-
def initialize(parsed_timings, total_splits)
|
5
|
+
def initialize(parsed_timings, total_splits, existing_schema: nil)
|
6
6
|
@parsed_timings = parsed_timings
|
7
7
|
@total_splits = total_splits
|
8
|
-
|
8
|
+
if existing_schema
|
9
|
+
@buckets = existing_schema.map do |bucket_hash|
|
10
|
+
b = Bucket.new
|
11
|
+
b.files = bucket_hash['files']
|
12
|
+
b.total_time = bucket_hash['total_time']
|
13
|
+
b
|
14
|
+
end
|
15
|
+
else
|
16
|
+
@buckets = Array.new(total_splits) { Bucket.new }
|
17
|
+
end
|
9
18
|
end
|
10
19
|
|
11
20
|
# Split the parsed timings into buckets based on total_splits
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: junit_timing_splitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kim Yu Ng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -103,7 +103,10 @@ files:
|
|
103
103
|
homepage: https://github.com/kimyu92/junit_timing_splitter
|
104
104
|
licenses:
|
105
105
|
- MIT
|
106
|
-
metadata:
|
106
|
+
metadata:
|
107
|
+
bug_tracker_uri: https://github.com/kimyu92/junit_timing_splitter/issues
|
108
|
+
documentation_uri: https://github.com/kimyu92/junit_timing_splitter/blob/main/README.md
|
109
|
+
changelog_uri: https://github.com/kimyu92/junit_timing_splitter/blob/main/CHANGELOG.md
|
107
110
|
post_install_message:
|
108
111
|
rdoc_options: []
|
109
112
|
require_paths:
|