-
Notifications
You must be signed in to change notification settings - Fork 2
/
bluepill_action.rb
101 lines (93 loc) · 4.26 KB
/
bluepill_action.rb
1
2
3
4
5
6
7
8
9
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
99
100
101
module Fastlane
module Actions
class BluepillAction < Action
def self.run(params)
UI.message("Start test by using Bluepill: https://github.com/linkedin/bluepill")
cmd = bin_bluepill.to_s
cmd << " #{params[:xctestrun]}"
cmd << " -a #{params[:app]}"
cmd << " -s #{params[:scheme]}"
cmd << " -o #{params[:output_dir]}"
cmd << " -d \"#{params[:device]}\""
cmd << " -n #{params[:number_of_simulators]}"
cmd << " -H" if params[:headless]
cmd << " --reuse-simulator" if params[:reuse_simulator]
sh cmd
end
def self.bin_bluepill
File.expand_path('../../../../../../bin/bluepill', __FILE__)
end
def self.description
"Plugin to use bluepill in fastlane"
end
def self.authors
["tbrand"]
end
# Nothing to return
def self.return_value; end
def self.details
"Bluepill is powered by LinkedIn: https://github.com/linkedin/bluepill"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :xctestrun,
env_name: "BLUEPILL_XCTESTRUN",
description: "The path to the .xctestrun file that xcode leaves",
optional: false,
is_string: true),
FastlaneCore::ConfigItem.new(key: :output_dir,
env_name: "BLUEPILL_OUTPUT_DIR",
description: "output directory for bluepill logs and reports",
optional: false,
is_string: true),
FastlaneCore::ConfigItem.new(key: :scheme,
env_name: "BLUEPILL_SCHEME_PATH",
description: "scheme path (.xcscheme)",
optional: false,
is_string: true),
FastlaneCore::ConfigItem.new(key: :app,
env_name: "BLUEPILL_APP_PATH",
description: "app path (.app)",
optional: false,
is_string: true),
FastlaneCore::ConfigItem.new(key: :device,
env_name: "BLUEPILL_DEVICE",
description: "device for using in the test",
is_string: true,
optional: false,
default_value: "iPhone 6"),
FastlaneCore::ConfigItem.new(key: :headless,
env_name: "BLUEPILL_HEADLESS",
description: "run in headless mode (no GUI)",
is_string: false,
optional: false,
default_value: false),
FastlaneCore::ConfigItem.new(key: :number_of_simulators,
env_name: "BLUEPILL_NUMBER_OF_SIMLATORS",
description: "number of simulators to run in parallel. (bluepill only)",
is_string: false,
optional: false,
default_value: 4),
FastlaneCore::ConfigItem.new(key: :reuse_simulator,
env_name: "BLUEPILL_REUSE_SIMULATOR",
description: "reuse simulator or not",
is_string: false,
optional: true,
default_value: false)
]
end
def self.is_supported?(platform)
platform == :ios
end
def self.example_code
[
'bluepill(
scheme: "path/to/SomeApp.xcscheme",
output_dir: "path/to/output_dir", # Bluepill\'s output dir such as log file
app: "path/to/SomeApp.app",
)'
]
end
end
end
end