fastlane-plugin-test_center 0.3.0 → 0.4.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b600780bb2c5b5caee315b15be8366c0942a68be
|
4
|
+
data.tar.gz: 7c3ec116614992c2589bf917656438b9a76cc511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ded3e6c83f8a88427a2a3431c09c6eb2c1219fa32544970b4986ffaf83e0110cef240d9fe73f4d5ea3bc4fe7eb3e33befd0667208fea8d03575248e65c2ee8
|
7
|
+
data.tar.gz: cd47605f1117968b9dc1d986e1d33b8e06a54ac2fd06a3ef27a6805d2780dd38cd94847aa658667aa454fa194cecf391c17bc842a39ec08a5bbd76fbb28faa7d
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class TestsFromJunitAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
report_file = File.open(params[:junit]) { |f| REXML::Document.new(f) }
|
6
|
+
UI.user_error!("Malformed XML test report file given") if report_file.root.nil?
|
7
|
+
UI.user_error!("Valid XML file is not an Xcode test report") if report_file.get_elements('testsuites').empty?
|
8
|
+
|
9
|
+
{
|
10
|
+
passing: passing_tests(report_file).to_a,
|
11
|
+
failed: failing_tests(report_file).to_a
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.failing_tests(report_file)
|
16
|
+
tests = Set.new
|
17
|
+
|
18
|
+
report_file.elements.each('*/testsuite/testcase/failure') do |failure_element|
|
19
|
+
testcase = failure_element.parent
|
20
|
+
tests << xctest_identifier(testcase)
|
21
|
+
end
|
22
|
+
tests
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.passing_tests(report_file)
|
26
|
+
tests = Set.new
|
27
|
+
|
28
|
+
report_file.elements.each('*/testsuite/testcase[not(failure)]') do |testcase|
|
29
|
+
tests << xctest_identifier(testcase)
|
30
|
+
end
|
31
|
+
tests
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.xctest_identifier(testcase)
|
35
|
+
testcase_class = testcase.attributes['classname']
|
36
|
+
testcase_testmethod = testcase.attributes['name']
|
37
|
+
|
38
|
+
testcase_class.gsub!(/.*\./, '')
|
39
|
+
"#{testcase_class}/#{testcase_testmethod}"
|
40
|
+
end
|
41
|
+
|
42
|
+
#####################################################
|
43
|
+
# @!group Documentation
|
44
|
+
#####################################################
|
45
|
+
|
46
|
+
def self.description
|
47
|
+
"Get the failing and passing tests as reported in a junit xml file"
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.available_options
|
51
|
+
[
|
52
|
+
FastlaneCore::ConfigItem.new(
|
53
|
+
key: :junit,
|
54
|
+
env_name: "FL_SUPPRESS_TESTS_FROM_JUNIT_JUNIT_REPORT", # The name of the environment variable
|
55
|
+
description: "The junit xml report file from which to collect the tests to suppress",
|
56
|
+
verify_block: proc do |path|
|
57
|
+
UI.user_error!("Error: cannot find the junit xml report file '#{path}'") unless File.exist?(path)
|
58
|
+
end
|
59
|
+
)
|
60
|
+
]
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.return_value
|
64
|
+
"A Hash with an Array of :passing and :failed tests"
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.authors
|
68
|
+
["lyndsey-ferguson/ldferguson"]
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.is_supported?(platform)
|
72
|
+
platform == :ios
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
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: 0.
|
4
|
+
version: 0.4.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-11-
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/fastlane/plugin/test_center/actions/suppress_tests_from_junit.rb
|
136
136
|
- lib/fastlane/plugin/test_center/actions/suppressed_tests.rb
|
137
137
|
- lib/fastlane/plugin/test_center/actions/test_center_action.rb
|
138
|
+
- lib/fastlane/plugin/test_center/actions/tests_from_junit.rb
|
138
139
|
- lib/fastlane/plugin/test_center/helper/test_center_helper.rb
|
139
140
|
- lib/fastlane/plugin/test_center/version.rb
|
140
141
|
homepage: https://github.com/lyndsey-ferguson/fastlane-plugin-test_center
|