fastlane-plugin-setup_fragile_tests_for_rescan 1.0.1 → 1.1.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: cfeef5d925156451f674975aa40fa39f7f187482
4
- data.tar.gz: '00008e1b1a23ec633e1219bb4ade7e177493aebd'
3
+ metadata.gz: 1ded2daae21d9ba1afd5875e67c0a19048c38895
4
+ data.tar.gz: 3395f9cbed2f8f1dba0d1a4e2f470d6e01d2e6cb
5
5
  SHA512:
6
- metadata.gz: 5cc07327155e8f9eb858a79c68e592e52a19c2a7311c25f4efc787e23f93eb90023048154a6869d5ff486e60a26c7c654337753c6a0d20061e1ef2f1ec54c9c2
7
- data.tar.gz: d3456fc30e163730978ede516e5b715c5131de72aecf14767494647791b8db3c5e6702965b28539718eb31decbed5082005285349debb8b9ef35f23ca9175eab
6
+ metadata.gz: e1e648ef08f5206057909e00dbe8d629093ccbf5938c7c623dd79f7dba0229a15498cf108b83b4405bb735d0eaf44b39872665d0cbd1d4d44825d277f725d42d
7
+ data.tar.gz: acacf54bed601c1323d5b523cbcee02a6e660b38e375b5b2d7f216f7d56e88ae9d2e0a261e9865da376f6ae06ca333a0921f45823919b4544546523148e70200
@@ -11,11 +11,20 @@ module Fastlane
11
11
  UI.user_error!("Malformed XML test report file given") if report_file.root.nil?
12
12
  UI.user_error!("Valid XML file is not an Xcode test report") if report_file.get_elements('testsuites').empty?
13
13
 
14
+ result = {
15
+ passed_tests: [],
16
+ failed_tests: []
17
+ }
18
+
14
19
  # remove all testcases that failed from the report file
15
20
  # so that our subsequent steps here can just focus on finding
16
21
  # passing testcases to suppress
17
22
  report_file.elements.each('*/testsuite/testcase/failure') do |failure_element|
18
- failure_element.parent.parent.delete_element failure_element.parent
23
+ testcase = failure_element.parent
24
+ testsuite_element = testcase.parent
25
+
26
+ result[:failed_tests] << xcodebuild_test_identifier(testsuite_element.parent, testcase)
27
+ testsuite_element.delete_element testcase
19
28
  end
20
29
 
21
30
  scheme = xcscheme(params)
@@ -30,8 +39,9 @@ module Fastlane
30
39
 
31
40
  testsuites.elements.each('testsuite/testcase') do |testcase|
32
41
  skipped_test = Xcodeproj::XCScheme::TestAction::TestableReference::SkippedTest.new
33
- skipped_test.identifier = skipped_test_identifier(testcase.attributes['classname'], testcase.attributes['name'])
42
+ skipped_test.identifier = xctest_identifier(testcase)
34
43
  testable.add_skipped_test(skipped_test)
44
+ result[:passed_tests] << xcodebuild_test_identifier(testsuites, testcase)
35
45
  is_dirty = true
36
46
  summary << [skipped_test.identifier]
37
47
  end
@@ -46,7 +56,7 @@ module Fastlane
46
56
  else
47
57
  UI.error('No passing tests found for suppression')
48
58
  end
49
- summary.flatten
59
+ result
50
60
  end
51
61
 
52
62
  def self.xcscheme(params)
@@ -62,19 +72,29 @@ module Fastlane
62
72
  Xcodeproj::XCScheme.new(scheme_filepath)
63
73
  end
64
74
 
65
- def self.skipped_test_identifier(testcase_class, testcase_testmethod)
75
+ def self.xctest_identifier(testcase)
76
+ testcase_class = testcase.attributes['classname']
77
+ testcase_testmethod = testcase.attributes['name']
78
+
66
79
  is_swift = testcase_class.include?('.')
67
80
  testcase_class.gsub!(/.*\./, '')
68
81
  testcase_testmethod << '()' if is_swift
69
82
  "#{testcase_class}/#{testcase_testmethod}"
70
83
  end
71
84
 
85
+ def self.xcodebuild_test_identifier(testsuites, testcase)
86
+ # remove '.xctest' from the buildable_name
87
+ buildable_name = File.basename(testsuites.attributes['name'], '.*')
88
+ test_identifier = xctest_identifier(testcase).chomp('()')
89
+ "#{buildable_name}/#{test_identifier}"
90
+ end
91
+
72
92
  def self.description
73
93
  "Suppress stabile tests so that 'scan' can run the fragile tests again"
74
94
  end
75
95
 
76
96
  def self.return_value
77
- "A list of the tests to suppress if you use going to use the :skip_testing option in the scan action"
97
+ "A hash of the tests with arrays :passed_tests and :failed_tests which can be used with scan's :skip_testing and :test_only options"
78
98
  end
79
99
 
80
100
  def self.authors
@@ -122,6 +142,7 @@ module Fastlane
122
142
  end
123
143
 
124
144
  def self.is_supported?(platform)
145
+ STDOUT.puts "platform: #{platform}"
125
146
  %i[ios mac].include?(platform)
126
147
  end
127
148
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SetupFragileTestsForRescan
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-setup_fragile_tests_for_rescan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.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: 2017-04-25 00:00:00.000000000 Z
11
+ date: 2017-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj