fastlane-plugin-bluepillar 0.1.0 → 0.2.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: 7b1519073a4b478de1f0eb834dab40391d96248a
4
- data.tar.gz: f2a7530874ff2684f558db781f960480392e4003
3
+ metadata.gz: 071bf5223799436bceb3ce41983416fa2467c206
4
+ data.tar.gz: 04eb1ebfde9987004a3ec4e977557294e5d9ef9c
5
5
  SHA512:
6
- metadata.gz: c98901758c5c2b2030d2ee22bd3ef9a202f17c4e78a9d53d0fa4ae847f51441e4c4304fc4ef0d76004cbb3ef2c456f5ed6a7c1523a8323eef205a35572b66196
7
- data.tar.gz: a950c9c77204e1a28e596e21a64a5fef02bf5546927525ce809f66af3a2c31bc525bd44426b1eca5fb292958490400739f2dfc1cf48e01fca68d18a792d2b773
6
+ metadata.gz: d3719169805df892843ff46d9cfaf83f8dac3d5ff515de2ada5a0cf36707de59f7db74ecc9c582fd5614370f78956894c48aeea3b93afcfea380537331f80cb1
7
+ data.tar.gz: 3c7b263e8db987af9ceb48009149923e20170083548082972f4bad4588b6a192e7d42dd01f3e6e8e2b448e3369ded1ba0ea803e8b3b6e71f304d9eb9ca5e3525
data/README.md CHANGED
@@ -2,25 +2,100 @@
2
2
 
3
3
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-bluepillar)
4
4
 
5
+ <a href="https://travis-ci.org/Shashikant86/fastlane-plugin-bluepillar/"><img src="https://img.shields.io/travis/Shashikant86/fastlane-plugin-bluepillar.svg" /></a>
6
+
5
7
  ## Getting Started
6
8
 
7
- This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-bluepillar`, add it to your project by running:
9
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin to run XCUI Tests in parallel using Linkedin's Bluepill tool. To get started with `fastlane-plugin-bluepillar`, add it to your project by running:
10
+
11
+
8
12
 
9
13
  ```bash
10
14
  fastlane add_plugin bluepillar
11
15
  ```
12
16
 
17
+
18
+ ### Pre-requisite
19
+
20
+ [Bluepill](https://github.com/linkedin/bluepill) homebrew package doesn't work well as it's lacking `bp` binary.
21
+ We have to manually download `bluepill` and `bp` binaries from the Bluepill releases page on [Github](https://github.com/linkedin/bluepill/releases) and put in PATH. This plugin expect it inside `/usr/local/bin/` where all the other binaries live, so that we have `/usr/local/bin/bluepill` and `/usr/local/bin/bp` binaries in place.
22
+
23
+ ### Fastlane Setup
24
+
25
+ We can setup Fastlane using some BluePill optins and Derived data.
26
+
27
+ ##### BluePill Options
28
+
29
+ There are so many options available for the Bluepill but we just need few of them to get going and keep other options as default. This plugin provides basic 7 options as follows
30
+
31
+ * `app` : PATH to your application. This is usually in the derived data `/Products/Debug-iphonesimulator/YOUR_APP.app`
32
+
33
+ * `runner_app_path` : PATH to UI Test runner app. This is usually in derived data `/Products/Debug-iphonesimulator\YOUR_UITEST_SCHEME-Runner.app` If you have a space in the Scheme name then you have to amend it with backslash in your path.
34
+
35
+ * `scheme_path` : This is path to your scheme. This is usually in the `YOUR_PROJECT.xcodeproj/xcshareddata/xcschemes/YOUR_SCHEME.xcscheme`
36
+
37
+ * `output_dir` : This is a directory where Bluepill will generate reports.
38
+
39
+ * `num_sims` : Number of simulators to be launched.
40
+
41
+ * `runtime` : The iOS version we want to run test against. Note we have to pass it as nested string like this `'"iOS 10.3"'`
42
+
43
+ * `device`: The simulator to be used. We have to pass it as `'iPad Air'` or `'iPhone 6'`
44
+
45
+ ##### Generate Derived Data for Bluepill
46
+
47
+ It's good idea to generate derived data in the project itself using `build for testing` option.
48
+ You can do that using Fastlane `scan` like this
49
+
50
+ ```
51
+ scan(
52
+ scheme: YOUR_SCHEME,
53
+ build_for_testing: true,
54
+ derived_data_path: "./bluepill",
55
+ buildlog_path: "./bluepill/logs/"
56
+ )
57
+ ```
58
+ This will generate derived data inside `bluepill` directory.
59
+
60
+ ##### Configure Fastfile
61
+ Now that, all the Bluepill options are in place and we have generated derived data, we can configure lane in our `Fastfile` like this:
62
+
63
+ ```
64
+
65
+ lane :test do
66
+ app: 'bluepill/Build/Products/Debug-iphonesimulator/Bluepillar.app',
67
+ runner_app_path: 'bluepill/Build/Products/Debug-iphonesimulator/BluepillarUITests-Runner.app',
68
+ scheme_path: 'Bluepillar.xcodeproj/xcshareddata/xcschemes/Bluepillar.xcscheme',
69
+ output_dir: 'bluepill_output/',
70
+ num_sims: '3',
71
+ runtime: '"iOS 10.3"',
72
+ device: 'iPad Air'
73
+ end
74
+
75
+ ```
76
+ Now that we can run test using fastlane like this :
77
+
78
+ $ fastlane test
79
+
80
+
81
+
13
82
  ## About bluepillar
14
83
 
15
- Run XCUITests in Parallel using Bluepill
84
+ Run XCUITests in Parallel using Bluepill. [Bluepill](https://github.com/linkedin/bluepill) is a tool from LinkedIn to run XCUI tests in the parallel.
16
85
 
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
86
 
19
87
  ## Example
20
88
 
21
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
89
+ There is sample example project available on Github [Bluepillar-Demo](https://github.com/Shashikant86/Bluepillar-Demo). Just clone it, replace the path to derived data and run
90
+
91
+
92
+ $ git clone git@github.com:Shashikant86/Bluepillar-Demo.git
93
+ $ bundle install
94
+ $ bundle exec fastlane test
95
+
96
+ You can see sample report in the `sample_bluepill_output` directory.
97
+
22
98
 
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
24
99
 
25
100
  ## Run tests for this plugin
26
101
 
@@ -46,7 +121,3 @@ If you have trouble using plugins, check out the [Plugins Troubleshooting](https
46
121
  ## Using _fastlane_ Plugins
47
122
 
48
123
  For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
49
-
50
- ## About _fastlane_
51
-
52
- _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -1,33 +1,44 @@
1
1
  module Fastlane
2
2
  module Actions
3
3
  class BluepillarAction < Action
4
+ BLUEPILL_PATH = '/usr/local/bin/bluepill'
5
+ BP_PATH = '/usr/local/bin/bp'
4
6
  def self.run(params)
5
7
  UI.message("Starting XCTests using the bluepillar fastlane plugin!")
6
- binary_path = params[:bluepill_binary_path]
7
- ios_app_path = params[:app_path]
8
- test_runner_app_path = params[:runner_app_path]
9
- scheme_path = params[:xctest_scheme_path]
10
- number_of_simulator = params[:simulators]
11
- report_path = params[:bluepill_report_path]
12
- ios_version = params[:bluepill_ios_version]
8
+ unless File.exist?(BLUEPILL_PATH)
9
+ UI.user_error!("You must download bluepill binary from Github and put it in /usr/local/bin/bluepill to carry on execution")
10
+ end
11
+
12
+ unless File.exist?(BP_PATH)
13
+ UI.user_error!("You must download bp binary from Github and put it in /usr/local/bin/bp to carry on execution")
14
+ end
15
+
16
+ bluepill_app_path = params[:app]
17
+ bluepill_runner_app_path = params[:runner_app_path]
18
+ bluepill_scheme_path = params[:scheme_path]
19
+ bluepill_num_sims = params[:num_sims]
20
+ bluepill_output_dir = params[:output_dir]
21
+ bluepill_runtime = params[:runtime]
22
+ bluepill_device = params[:device]
23
+ processed_device = bluepill_device.gsub(/ /, '\ ')
24
+
25
+
13
26
  command = [
14
- binary_path,
27
+ 'bluepill',
15
28
  '-a',
16
- ios_app_path,
29
+ bluepill_app_path,
17
30
  '-u',
18
- test_runner_app_path,
31
+ bluepill_runner_app_path,
19
32
  '-s',
20
- scheme_path,
33
+ bluepill_scheme_path,
21
34
  '-o',
22
- report_path,
35
+ bluepill_output_dir,
23
36
  '-r',
24
- ios_version,
37
+ bluepill_runtime,
25
38
  '-n',
26
- number_of_simulator,
27
- # '-t',
28
- # xctest_path,
29
- # '-d',
30
- # ios_device,
39
+ bluepill_num_sims,
40
+ '-d',
41
+ processed_device,
31
42
  ]
32
43
  Actions.sh(command.join(' '))
33
44
  end
@@ -50,13 +61,7 @@ module Fastlane
50
61
 
51
62
  def self.available_options
52
63
  [
53
- FastlaneCore::ConfigItem.new(key: :bluepill_binary_path,
54
- env_name: "BLUEPILLAR_BINARY_PATH",
55
- description: "Path to bluepill and bp binary which can be downloaded from Github. Hack till homebrew install WIP ",
56
- is_string: true,
57
- optional: false),
58
-
59
- FastlaneCore::ConfigItem.new(key: :app_path,
64
+ FastlaneCore::ConfigItem.new(key: :app,
60
65
  env_name: "BLUEPILLAR_APP_PATH",
61
66
  description: "Path to the main app to be build for the bluepill in the Derived Data",
62
67
  is_string: true,
@@ -68,42 +73,50 @@ module Fastlane
68
73
  is_string: true,
69
74
  optional: false),
70
75
 
71
- FastlaneCore::ConfigItem.new(key: :xctest_scheme_path,
76
+ FastlaneCore::ConfigItem.new(key: :scheme_path,
72
77
  env_name: "BLUEPILLAR_XCTEST_SCHEME_PATH",
73
78
  description: "Path to the scheme to be build for the bluepill in the .xcodeproj",
74
79
  is_string: true,
75
80
  optional: false),
76
81
 
77
- FastlaneCore::ConfigItem.new(key: :bluepill_report_path,
82
+ FastlaneCore::ConfigItem.new(key: :output_dir,
78
83
  env_name: "BLUEPILLAR_REPORT_PATH",
79
84
  description: "Path to store simulator logs and test reports",
80
85
  is_string: true,
81
86
  optional: false),
82
87
 
83
- FastlaneCore::ConfigItem.new(key: :simulators,
88
+ FastlaneCore::ConfigItem.new(key: :num_sims,
84
89
  env_name: "BLUEPILLAR_SUMULATORS",
85
90
  description: "Number of sumulators to be launched",
91
+ default_value: "3",
86
92
  is_string: true,
87
93
  optional: true),
88
94
 
89
- FastlaneCore::ConfigItem.new(key: :bluepill_ios_version,
95
+ FastlaneCore::ConfigItem.new(key: :runtime,
90
96
  env_name: "BLUEPILLAR_IOS_VERSION",
91
97
  description: "The iOS version to be used for testing",
98
+ default_value: '"iOS 10.3"',
99
+ is_string: true,
100
+ optional: true),
101
+
102
+ FastlaneCore::ConfigItem.new(key: :device,
103
+ env_name: "BLUEPILLAR_IOS_DEVICE",
104
+ description: "The iOS device to be used for testing",
105
+ default_value: "'iPhone 6'",
92
106
  is_string: true,
93
107
  optional: true),
94
108
  ]
95
109
  end
96
110
 
97
111
  def self.example_code
98
- ['bluepillar(
99
- app_path: "/Users/shashi/Library/Developer/Xcode/DerivedData/Bluepillar-ekhnxpeagzjvbabmoghlgxagbgna/Build/Products/Debug-iphonesimulator/Bluepillar.app",
100
- runner_app_path: "/Users/shashi/Library/Developer/Xcode/DerivedData/Bluepillar-ekhnxpeagzjvbabmoghlgxagbgna/Build/Products/Debug-iphonesimulator/BluepillarUITests-Runner.app",
101
- xctest_scheme_path: "Bluepillar.xcodeproj/xcshareddata/xcschemes/Bluepillar.xcscheme",
102
- bluepill_binary_path: "bin/bluepill",
103
- bluepill_report_path: "bluepill_output/",
104
- simulators: "3",
105
- bluepill_ios_version: '"iOS 10.3"'
106
- )
112
+ [' bluepillar(
113
+ app: "bluepill/Build/Products/Debug-iphonesimulator/Bluepillar.app",
114
+ runner_app_path: "bluepill/Build/Products/Debug-iphonesimulator/BluepillarUITests-Runner.app",
115
+ scheme_path: "Bluepillar.xcodeproj/xcshareddata/xcschemes/Bluepillar.xcscheme",
116
+ output_dir: "bluepill_output/",
117
+ num_sims: "3",
118
+ runtime: '"iOS 10.3"',
119
+ )
107
120
  ']
108
121
  end
109
122
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Bluepillar
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-bluepillar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shashikant86
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-13 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -103,8 +103,6 @@ files:
103
103
  - LICENSE
104
104
  - README.md
105
105
  - lib/fastlane/plugin/bluepillar.rb
106
- - lib/fastlane/plugin/bluepillar/actions/bin/bluepill
107
- - lib/fastlane/plugin/bluepillar/actions/bin/bp
108
106
  - lib/fastlane/plugin/bluepillar/actions/bluepillar_action.rb
109
107
  - lib/fastlane/plugin/bluepillar/helper/bluepillar_helper.rb
110
108
  - lib/fastlane/plugin/bluepillar/version.rb
@@ -131,5 +129,5 @@ rubyforge_project:
131
129
  rubygems_version: 2.6.8
132
130
  signing_key:
133
131
  specification_version: 4
134
- summary: Run XCUITests in Parallel using Bluepill
132
+ summary: Fastlane Plugin to Run XCUITests in Parallel using Bluepill.
135
133
  test_files: []