Class: Fastlane::Actions::RunTestsAction
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, authors, deprecated_notes, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.author ⇒ Object
48
49
50
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 48
def self.author
"KrauseFx"
end
|
.available_options ⇒ Object
.category ⇒ Object
100
101
102
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 100
def self.category
:testing
end
|
.description ⇒ Object
40
41
42
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 40
def self.description
"Easily run tests of your iOS app (via _scan_)"
end
|
.details ⇒ Object
44
45
46
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 44
def self.details
"More information: https://docs.fastlane.tools/actions/scan/"
end
|
.example_code ⇒ Object
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 74
def self.example_code
[
'run_tests',
'scan # alias for "run_tests"',
'run_tests(
workspace: "App.xcworkspace",
scheme: "MyTests",
clean: false
)',
'# Build For Testing
run_tests(
derived_data_path: "my_folder",
build_for_testing: true
)',
'# run tests using derived data from prev. build
run_tests(
derived_data_path: "my_folder",
test_without_building: true
)',
'# or run it from an existing xctestrun package
run_tests(
xctestrun: "/path/to/mytests.xctestrun"
)'
]
end
|
.is_supported?(platform) ⇒ Boolean
64
65
66
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 64
def self.is_supported?(platform)
[:ios, :mac].include?(platform)
end
|
.run(values) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 10
def self.run(values)
require 'scan'
plist_files_before = []
begin
destination = values[:destination] Scan.config = values unless values[:derived_data_path].to_s.empty?
plist_files_before = test_summary_filenames(values[:derived_data_path])
end
values[:destination] = destination Scan::Manager.new.work(values)
return true
rescue => ex
if values[:fail_build]
raise ex
end
ensure
unless values[:derived_data_path].to_s.empty?
Actions.lane_context[SharedValues::SCAN_DERIVED_DATA_PATH] = values[:derived_data_path]
plist_files_after = test_summary_filenames(values[:derived_data_path])
all_test_summaries = (plist_files_after - plist_files_before)
Actions.lane_context[SharedValues::SCAN_GENERATED_PLIST_FILES] = all_test_summaries
Actions.lane_context[SharedValues::SCAN_GENERATED_PLIST_FILE] = all_test_summaries.last
end
end
end
|
.test_summary_filenames(derived_data_path) ⇒ Object
70
71
72
|
# File 'fastlane/lib/fastlane/actions/run_tests.rb', line 70
def self.test_summary_filenames(derived_data_path)
Dir["#{derived_data_path}/**/Logs/Test/*TestSummaries.plist"]
end
|