xcknife 0.11.1 → 0.12.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/.gitignore +2 -0
- data/.rubocop.yml +168 -0
- data/.travis.yml +1 -1
- data/.vscode/configure.sh +23 -0
- data/.vscode/vscode_ruby.json.template +44 -0
- data/Gemfile +10 -2
- data/Gemfile.lock +43 -15
- data/Rakefile +14 -10
- data/bin/xcknife +2 -0
- data/bin/xcknife-min +12 -15
- data/bin/xcknife-test-dumper +2 -0
- data/example/run_example.rb +10 -8
- data/example/xcknife-exemplar-historical-data.json-stream +3 -3
- data/example/xcknife-exemplar.json-stream +3 -3
- data/lib/xcknife.rb +3 -1
- data/lib/xcknife/events_analyzer.rb +11 -6
- data/lib/xcknife/exceptions.rb +2 -0
- data/lib/xcknife/json_stream_parser_helper.rb +8 -8
- data/lib/xcknife/runner.rb +18 -19
- data/lib/xcknife/stream_parser.rb +39 -30
- data/lib/xcknife/test_dumper.rb +155 -121
- data/lib/xcknife/xcscheme_analyzer.rb +9 -9
- data/lib/xcknife/xctool_cmd_helper.rb +16 -4
- data/xcknife.gemspec +8 -6
- metadata +9 -6
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rexml/document'
|
2
4
|
|
3
5
|
module XCKnife
|
@@ -8,20 +10,18 @@ module XCKnife
|
|
8
10
|
ret = {}
|
9
11
|
xml_root = REXML::Document.new(xscheme_data).root
|
10
12
|
|
11
|
-
|
12
|
-
action = xml_root.elements["//TestAction"]
|
13
|
+
action = xml_root.elements['//TestAction']
|
13
14
|
return ret if action.nil?
|
14
|
-
|
15
|
-
|
16
|
-
end
|
15
|
+
|
16
|
+
action = xml_root.elements['//LaunchAction'] if action.attributes['shouldUseLaunchSchemeArgsEnv'] == 'YES'
|
17
17
|
return ret if action.nil?
|
18
|
-
|
18
|
+
|
19
|
+
env_elements = action.elements['.//EnvironmentVariables']
|
19
20
|
return ret if env_elements.nil?
|
21
|
+
|
20
22
|
env_elements.elements.each do |e|
|
21
23
|
attrs = e.attributes
|
22
|
-
if attrs[
|
23
|
-
ret[attrs["key"]] = attrs["value"]
|
24
|
-
end
|
24
|
+
ret[attrs['key']] = attrs['value'] if attrs['isEnabled'] == 'YES'
|
25
25
|
end
|
26
26
|
ret
|
27
27
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'set'
|
2
4
|
|
3
5
|
module XCKnife
|
@@ -5,12 +7,14 @@ module XCKnife
|
|
5
7
|
def only_arguments_for_a_partition_set(output_type, partition_set)
|
6
8
|
method = "#{output_type}_only_arguments_for_a_partition_set"
|
7
9
|
raise "Unknown output_type: #{output_type}" unless respond_to?(method)
|
10
|
+
|
8
11
|
__send__(method, partition_set)
|
9
12
|
end
|
10
13
|
|
11
14
|
def only_arguments(output_type, partition)
|
12
15
|
method = "#{output_type}_only_arguments"
|
13
16
|
raise "Unknown output_type: #{output_type}" unless respond_to?(method)
|
17
|
+
|
14
18
|
__send__(method, partition)
|
15
19
|
end
|
16
20
|
|
@@ -25,11 +29,18 @@ module XCKnife
|
|
25
29
|
end
|
26
30
|
|
27
31
|
# only-testing is available since Xcode 8
|
32
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
28
33
|
def xcodebuild_only_arguments(single_partition, meta_partition = nil)
|
29
|
-
only_targets =
|
30
|
-
|
31
|
-
|
32
|
-
|
34
|
+
only_targets = Set.new
|
35
|
+
|
36
|
+
if meta_partition
|
37
|
+
filtered = meta_partition.flat_map(&:keys)
|
38
|
+
.group_by(&:to_s)
|
39
|
+
.select { |_, v| v.size == 1 }
|
40
|
+
.map(&:first)
|
41
|
+
.to_set
|
42
|
+
|
43
|
+
only_targets = single_partition.keys.to_set & filtered
|
33
44
|
end
|
34
45
|
|
35
46
|
only_target_arguments = only_targets.sort.map { |test_target| "-only-testing:#{test_target}" }
|
@@ -62,4 +73,5 @@ module XCKnife
|
|
62
73
|
partition_set.map { |partition| xctool_only_arguments(partition) }
|
63
74
|
end
|
64
75
|
end
|
76
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
65
77
|
end
|
data/xcknife.gemspec
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
4
6
|
require 'xcknife'
|
5
7
|
|
6
8
|
Gem::Specification.new do |s|
|
@@ -11,19 +13,19 @@ Gem::Specification.new do |s|
|
|
11
13
|
s.homepage = 'https://github.com/square/xcknife'
|
12
14
|
s.licenses = ['Apache-2.0']
|
13
15
|
|
14
|
-
s.summary =
|
16
|
+
s.summary = 'Simple tool for optimizing XCTest runs across machines'
|
15
17
|
s.description = <<-DESCRIPTION
|
16
18
|
Simple tool for optimizing XCTest runs across machines.
|
17
19
|
Works by leveraging xctool's json-streams timing and test data.
|
18
20
|
DESCRIPTION
|
19
21
|
|
20
|
-
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR).reject { |f| f =~ /^spec/} + [
|
22
|
+
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR).reject { |f| f =~ /^spec/ } + ['TestDumper/TestDumper.dylib']
|
21
23
|
s.bindir = 'bin'
|
22
|
-
s.executables
|
24
|
+
s.executables = %w[xcknife xcknife-min xcknife-test-dumper]
|
23
25
|
s.require_paths = ['lib']
|
24
26
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
25
27
|
|
26
|
-
s.required_ruby_version = '>= 2.
|
28
|
+
s.required_ruby_version = '>= 2.6.0'
|
27
29
|
|
28
30
|
s.add_development_dependency 'bundler', '~> 1.12'
|
29
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcknife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Ribeiro
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -39,8 +39,11 @@ extra_rdoc_files: []
|
|
39
39
|
files:
|
40
40
|
- ".gitignore"
|
41
41
|
- ".rspec"
|
42
|
+
- ".rubocop.yml"
|
42
43
|
- ".ruby-version"
|
43
44
|
- ".travis.yml"
|
45
|
+
- ".vscode/configure.sh"
|
46
|
+
- ".vscode/vscode_ruby.json.template"
|
44
47
|
- CONTRIBUTING.md
|
45
48
|
- Gemfile
|
46
49
|
- Gemfile.lock
|
@@ -78,7 +81,7 @@ homepage: https://github.com/square/xcknife
|
|
78
81
|
licenses:
|
79
82
|
- Apache-2.0
|
80
83
|
metadata: {}
|
81
|
-
post_install_message:
|
84
|
+
post_install_message:
|
82
85
|
rdoc_options: []
|
83
86
|
require_paths:
|
84
87
|
- lib
|
@@ -86,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
89
|
requirements:
|
87
90
|
- - ">="
|
88
91
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.
|
92
|
+
version: 2.6.0
|
90
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
94
|
requirements:
|
92
95
|
- - ">="
|
@@ -94,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
97
|
version: '0'
|
95
98
|
requirements: []
|
96
99
|
rubygems_version: 3.0.8
|
97
|
-
signing_key:
|
100
|
+
signing_key:
|
98
101
|
specification_version: 4
|
99
102
|
summary: Simple tool for optimizing XCTest runs across machines
|
100
103
|
test_files: []
|