fastlane-plugin-test_center 3.13.1 → 3.13.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79e2765eea8d10df4efd2039d298d2e7b3e9481844686eb5dc5c3e5223f96171
4
- data.tar.gz: a5856750d9519fe3db99c10aebe9b320a91aa6285a15919ea0547069fdc6627b
3
+ metadata.gz: aad12d735ede09ec5252a46c7ce09dcdc146473c94562948a3bfb48298d3efc4
4
+ data.tar.gz: 91b490649264d9994bc9acbe7d0703e6bf2f800fe91555cee201c3a2dde491dc
5
5
  SHA512:
6
- metadata.gz: 7d40544a3352ddd61af2c9ff77d842d006a0400df54bb9e2492ccd0f01f7ab514a008d6a82c4f1f2fc979e840a599cd1e0e4d514afd9d053e5ad6473347d2f5d
7
- data.tar.gz: cbd5f866464960e4a35b3b3f59baceafc6621eb7d0917f72d795cb53973f62f342dd717587431f8f72da958164b9f3b2ed8c709f3661dd759584b0c4574c65ce
6
+ metadata.gz: 49b63536f6ce286c9db3743a07301713d574465a5ef68d02fda3c250f4244ff8cccdbeff9b3562c0eeefc9a0ac696704a356efb815104b3fd912280e29f3d207
7
+ data.tar.gz: be836edfc4eb671119ee7adb4752931454988fd53c861736598f708f2369ba15f6caf592a3a2749983855e268728249de97074e61ea3e52a0eec5615d2dc9907
@@ -66,9 +66,10 @@ module TestCenter
66
66
  @test_collector = TestCollector.new(@options)
67
67
  @options.reject! { |key| %i[testplan].include?(key) }
68
68
  @batch_count = @test_collector.test_batches.size
69
- if @test_collector.test_batches.flatten.size < @options[:parallel_testrun_count].to_i
70
- FastlaneCore::UI.important(":parallel_testrun_count greater than the number of tests (#{@test_collector.test_batches.flatten.size}). Reducing to that number.")
71
- @options[:parallel_testrun_count] = @test_collector.test_batches.flatten.size
69
+ tests = @test_collector.test_batches.flatten
70
+ if tests.size < @options[:parallel_testrun_count].to_i
71
+ FastlaneCore::UI.important(":parallel_testrun_count greater than the number of tests (#{tests.size}). Reducing to that number.")
72
+ @options[:parallel_testrun_count] = tests.size
72
73
  end
73
74
  end
74
75
 
@@ -91,31 +91,84 @@ module TestCenter
91
91
  end
92
92
 
93
93
  def xctestrun_known_tests
94
- config = FastlaneCore::Configuration.create(
95
- ::Fastlane::Actions::TestsFromXctestrunAction.available_options,
96
- {
97
- xctestrun: @xctestrun_path,
98
- invocation_based_tests: @invocation_based_tests,
99
- swift_test_prefix: @swift_test_prefix
100
- }
101
- )
102
- ::Fastlane::Actions::TestsFromXctestrunAction.run(config)
94
+ unless @known_tests
95
+ config = FastlaneCore::Configuration.create(
96
+ ::Fastlane::Actions::TestsFromXctestrunAction.available_options,
97
+ {
98
+ xctestrun: @xctestrun_path,
99
+ invocation_based_tests: @invocation_based_tests,
100
+ swift_test_prefix: @swift_test_prefix
101
+ }
102
+ )
103
+ @known_tests = ::Fastlane::Actions::TestsFromXctestrunAction.run(config)
104
+ end
105
+ @known_tests
103
106
  end
104
107
 
105
- def expand_testsuites_to_tests
108
+ # The purpose of this method is to expand :only_testing
109
+ # that has elements that are just the 'testsuite' or
110
+ # are just the 'testable/testsuite'. We want to take
111
+ # those and expand them out to the individual testcases.
112
+ # 'testsuite' => [
113
+ # 'testable/testsuite/testcase1',
114
+ # . 'testable/testsuite/testcase2',
115
+ # . 'testable/testsuite/testcase3'
116
+ # ]
117
+ # OR
118
+ # 'testable/testsuite' => [
119
+ # 'testable/testsuite/testcase1',
120
+ # . 'testable/testsuite/testcase2',
121
+ # . 'testable/testsuite/testcase3'
122
+ # ]
123
+ def expand_testsuites_to_tests(testables_tests)
124
+ # Remember, testable_tests is of the format:
125
+ # {
126
+ # 'testable1' => [
127
+ # 'testsuite1/testcase1',
128
+ # 'testsuite1/testcase2',
129
+ # 'testsuite2/testcase1',
130
+ # 'testsuite2/testcase2',
131
+ # ...
132
+ # 'testsuiteN/testcase1', ... 'testsuiteN/testcaseM'
133
+ # ],
134
+ # ...
135
+ # 'testableO' => [
136
+ # 'testsuite1/testcase1',
137
+ # 'testsuite1/testcase2',
138
+ # 'testsuite2/testcase1',
139
+ # 'testsuite2/testcase2',
140
+ # ...
141
+ # 'testsuiteN/testcase1', ... 'testsuiteN/testcaseM'
142
+ # ]
143
+ # }
106
144
  return if @invocation_based_tests
107
145
 
146
+ # iterate among all the test identifers for each testable
147
+ # A test identifier is seperated into components by '/'
148
+ # if a test identifier has only 2 separators, it probably is
149
+ # 'testable/testsuite' (but it could be 'testsuite/testcase' )
150
+ all_known_tests = nil
108
151
  known_tests = []
109
- @testables_tests.each do |testable, tests|
152
+ testables_tests.each do |testable, tests|
110
153
  tests.each_with_index do |test, index|
111
- if test.count('/') < 2
112
- known_tests += xctestrun_known_tests[testable]
113
- test_components = test.split('/')
114
- testsuite = test_components.size == 1 ? test_components[0] : test_components[1]
115
- @testables_tests[testable][index] = known_tests.select { |known_test| known_test.include?(testsuite) }
154
+ test_components = test.split('/')
155
+ is_full_test_identifier = (test_components.size == 3)
156
+ next if is_full_test_identifier
157
+
158
+ all_known_tests ||= xctestrun_known_tests.clone
159
+
160
+ testsuite = ''
161
+ if test_components.size == 1
162
+ testsuite = test_components[0]
163
+ else
164
+ testsuite = test_components[1]
165
+ end
166
+
167
+ testables_tests[testable][index], all_known_tests[testable] = all_known_tests[testable].partition do |known_test|
168
+ known_test.split('/')[1] == testsuite
116
169
  end
117
170
  end
118
- @testables_tests[testable].flatten!
171
+ testables_tests[testable].flatten!
119
172
  end
120
173
  end
121
174
 
@@ -123,7 +176,7 @@ module TestCenter
123
176
  unless @testables_tests
124
177
  if @only_testing
125
178
  @testables_tests = only_testing_to_testables_tests
126
- expand_testsuites_to_tests
179
+ expand_testsuites_to_tests(@testables_tests)
127
180
  else
128
181
  @testables_tests = xctestrun_known_tests
129
182
  if @skip_testing
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module TestCenter
3
- VERSION = "3.13.1"
3
+ VERSION = "3.13.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-test_center
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.1
4
+ version: 3.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyndsey Ferguson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-03 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json