fastlane-plugin-test_center 3.5.11 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c23ba2116da10db89626e43c151091eef3f4edf0
4
- data.tar.gz: 441930e849fff38b59807163b7afa091565ff6fe
3
+ metadata.gz: 2a688442d7c22abd139e2583a4b600c54e9c7356
4
+ data.tar.gz: 27d86d455364da619ac764308ce9476852405777
5
5
  SHA512:
6
- metadata.gz: c3a6e7b763364dd834cdd16a7a0fdc4fa1f58260d2aeae7f9c2667633ec456b4bcb3448cf716a14d4128837533be1ccb60f09b3695ceb314cdfa35e5427b1509
7
- data.tar.gz: 610565db975ea056313ae101a13f569de6522027c374577d530ad7c7292af96a81bb5f67b38a77fb8a743a1358f031600fc0ca20ef81fef18c6090c2d98edd3f
6
+ metadata.gz: aba572c09e76dddc65f9461814c9a97a0027045ead381c239fd38df3b30511b39b530d42f60087bead97c39d94cd367645aa025be047a9bf6b28251b0572c2c8
7
+ data.tar.gz: 7e127db0cd2bd998b3f2e72bf09111fad7c1f5c5acb12e296a91f6c1f1e47a71ee27671ebd2d0242457f4c720268b90641e93175290026c6feb83069b5254f12
@@ -1,6 +1,7 @@
1
1
  module Fastlane
2
2
  module Actions
3
3
  class CollateJunitReportsAction < Action
4
+
4
5
  def self.run(params)
5
6
  report_filepaths = params[:reports]
6
7
  if report_filepaths.size == 1
@@ -8,9 +9,9 @@ module Fastlane
8
9
  else
9
10
  UI.verbose("collate_junit_reports with #{report_filepaths}")
10
11
  reports = report_filepaths.map { |report_filepath| REXML::Document.new(File.new(report_filepath)) }
11
-
12
12
  # copy any missing testsuites
13
13
  target_report = reports.shift
14
+ target_report.root.attributes['retries'] = reports.size.to_s
14
15
  preprocess_testsuites(target_report)
15
16
 
16
17
  reports.each do |report|
@@ -97,6 +98,7 @@ module Fastlane
97
98
  UI.verbose(" collate_testsuite with testcase #{name}")
98
99
  UI.verbose(" replacing \"#{target_testcase}\" with \"#{testcase}\"")
99
100
  parent = target_testcase.parent
101
+ increment_testcase_tries(target_testcase, testcase) unless testcase.root == target_testcase.root
100
102
  parent.insert_after(target_testcase, testcase)
101
103
  parent.delete_element(target_testcase)
102
104
  UI.verbose("")
@@ -107,6 +109,11 @@ module Fastlane
107
109
  end
108
110
  end
109
111
 
112
+ def self.increment_testcase_tries(target_testcase, testcase)
113
+ try_count = target_testcase.attributes['retries']
114
+ testcase.attributes['retries'] = (try_count.to_i + 1).to_s
115
+ end
116
+
110
117
  def self.update_testable_counts(testable)
111
118
  testsuites = REXML::XPath.match(testable, 'testsuite')
112
119
  test_count = 0
@@ -10,7 +10,7 @@ module Fastlane
10
10
  def self.run(params)
11
11
  unless Helper.test?
12
12
  FastlaneCore::PrintTable.print_values(
13
- config: params._values.select { |k, _| %i[try_count batch_count fail_build].include?(k) },
13
+ config: params._values.select { |k, _| %i[try_count batch_count fail_build quit_simulators].include?(k) },
14
14
  title: "Summary for multi_scan (test_center v#{Fastlane::TestCenter::VERSION})"
15
15
  )
16
16
  end
@@ -84,6 +84,7 @@ module Fastlane
84
84
  options_to_remove = %i[
85
85
  try_count
86
86
  batch_count
87
+ quit_simulators
87
88
  testrun_completed_block
88
89
  test_without_building
89
90
  output_types
@@ -155,6 +156,15 @@ module Fastlane
155
156
  UI.user_error!("Error: Batch counts must be greater than zero") unless count > 0
156
157
  end
157
158
  ),
159
+ FastlaneCore::ConfigItem.new(
160
+ key: :quit_simulators,
161
+ env_name: "FL_MULTI_SCAN_QUIT_SIMULATORS",
162
+ description: "If the simulators need to be killed before run the tests",
163
+ type: Boolean,
164
+ is_string: false,
165
+ default_value: true,
166
+ optional: true
167
+ ),
158
168
  FastlaneCore::ConfigItem.new(
159
169
  key: :output_types,
160
170
  short_option: "-f",
@@ -15,13 +15,18 @@ module Fastlane
15
15
  xctestrun.each do |testable_name, xctestrun_config|
16
16
  next if testable_name == '__xctestrun_metadata__'
17
17
 
18
- test_identifiers = XCTestList.tests(xctest_bundle_path(xctestrun_rootpath, xctestrun_config))
18
+ xctest_path = xctest_bundle_path(xctestrun_rootpath, xctestrun_config)
19
+ test_identifiers = XCTestList.tests(xctest_path)
19
20
  UI.verbose("Found the following tests: #{test_identifiers.join("\n\t")}")
20
21
  if xctestrun_config.key?('SkipTestIdentifiers')
21
22
  skipped_tests = xctestrun_config['SkipTestIdentifiers']
22
23
  UI.verbose("Removing skipped tests: #{skipped_tests.join("\n\t")}")
23
24
  test_identifiers.reject! { |test_identifier| skipped_tests.include?(test_identifier) }
24
25
  end
26
+ if test_identifiers.empty?
27
+ UI.error("No tests found in '#{xctest_path}'!")
28
+ UI.important("Is the Build Setting, `ENABLE_TESTABILITY` enabled for the test target #{testable_name}?")
29
+ end
25
30
  tests[testable_name] = test_identifiers.map do |test_identifier|
26
31
  "#{testable_name.shellescape}/#{test_identifier}"
27
32
  end
@@ -10,6 +10,7 @@ module TestCenter
10
10
  @batch_count = multi_scan_options[:batch_count] || 1
11
11
  @output_directory = multi_scan_options[:output_directory] || 'test_results'
12
12
  @try_count = multi_scan_options[:try_count]
13
+ @quit_simulators = multi_scan_options[:quit_simulators]
13
14
  @retry_total_count = 0
14
15
  @testrun_completed_block = multi_scan_options[:testrun_completed_block]
15
16
  @given_custom_report_file_name = multi_scan_options[:custom_report_file_name]
@@ -23,6 +24,7 @@ module TestCenter
23
24
  clean
24
25
  try_count
25
26
  batch_count
27
+ quit_simulators
26
28
  custom_report_file_name
27
29
  fail_build
28
30
  testrun_completed_block
@@ -276,6 +278,8 @@ module TestCenter
276
278
  end
277
279
 
278
280
  def quit_simulators
281
+ return unless @quit_simulators
282
+
279
283
  Fastlane::Actions.sh("killall -9 'iPhone Simulator' 'Simulator' 'SimulatorBridge' &> /dev/null || true", log: false)
280
284
  launchctl_list_count = 0
281
285
  while Fastlane::Actions.sh('launchctl list | grep com.apple.CoreSimulator.CoreSimulatorService || true', log: false) != ''
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module TestCenter
3
- VERSION = "3.5.11"
3
+ VERSION = "3.6.0"
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.5.11
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyndsey Ferguson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-13 00:00:00.000000000 Z
11
+ date: 2018-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json