fastlane-plugin-instrumented_tests 0.1.6 → 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
- SHA1:
3
- metadata.gz: 6ecedd9a18d028ea20ca8a86557728a891a32382
4
- data.tar.gz: 9a51ae7e24f32c89b0d82013dc094caf2d438796
2
+ SHA256:
3
+ metadata.gz: 369973de96a8d6a794cae6612485e20b9e8ed212c3540407769ef48faed56e78
4
+ data.tar.gz: 72242ea32dd679d21ff801ccfa2eb8ff7f01c33682a67874aa9b68a27070490e
5
5
  SHA512:
6
- metadata.gz: 4c23f0b2cd18053f55d1df7c8450820b42338e39ba85f0a7a3235c72f0ff877e6d5ec7f9b8622c1aedeb20a015484636620b4959121f0ccba5c65f4d46c6529f
7
- data.tar.gz: 05c23a1fe2d32f3377d5f614eebc440de292c83c386c71d7d19b9d536e4a17c43f296c4dd7b91c4b7206aec8999d25049c0e47016a970ae193ff9596069cc2a9
6
+ metadata.gz: 0a7578f52f7dbf0e171984088ed61f24dec49611e6f5bc174d49c47d3606cefd388fc450e2cb3fb045d232884e5e6f7a18dc99f330fb4cbff2f2d5f1ead1e5bf
7
+ data.tar.gz: c6118bf0fb55736958ecd3441b7639ca5a103fe7bbf52060fcb3eba530f41437cdb51f99834f822b056e5f61e3a0040e87628678a973355a45504411aa01f42c
data/README.md CHANGED
@@ -24,9 +24,9 @@ Creates and boots avd device before running gradle command.
24
24
 
25
25
  ```ruby
26
26
  instrumented_tests(
27
- avd_name: "Nexus_10",
28
- target_id: "2",
29
- task: "cleanTest createMockDebugCoverageReport --continue",
27
+ avd_name: "Nexus_5_API_25_Test",
28
+ avd_package: "'system-images;android-19;google_apis;x86'",
29
+ avd_abi: "google_apis/x86",
30
30
  )
31
31
  ```
32
32
 
@@ -34,12 +34,12 @@ instrumented_tests(
34
34
 
35
35
  To run both the tests, and code style validation, run
36
36
 
37
- ````
37
+ ```bash
38
38
  rake
39
39
  ```
40
40
 
41
41
  To automatically fix many of the styling issues, use
42
- ```
42
+ ```bash
43
43
  rubocop -a
44
44
  ```
45
45
 
@@ -36,8 +36,6 @@ module Fastlane
36
36
  raise ":avd_port must be lower than 5584" if params[:avd_port]>5584
37
37
  raise ":avd_port must be an even number" if params[:avd_port]%2 != 0
38
38
 
39
- params[:avd_hide]=Helper.is_ci? if params[:avd_hide].nil?
40
-
41
39
  @android_serial="emulator-#{params[:avd_port]}"
42
40
  end
43
41
 
@@ -50,21 +48,19 @@ module Fastlane
50
48
  end
51
49
 
52
50
  def self.create_emulator(params)
53
- avd_name = "--name \"#{params[:avd_name]}\""
54
- target_id = "--target #{params[:target_id]}"
55
- avd_options = params[:avd_options] unless params[:avd_options].nil?
56
- avd_abi = "--abi #{params[:avd_abi]}" unless params[:avd_abi].nil?
57
- avd_tag = "--tag #{params[:avd_tag]}" unless params[:avd_tag].nil?
58
- create_avd = ["#{params[:sdk_path]}/tools/android", "create avd", avd_name, target_id, avd_abi, avd_tag, avd_options].join(" ")
51
+ avd_name = "--name '#{params[:avd_name]}'"
52
+ avd_package = "--package #{params[:avd_package]}"
53
+ avd_abi = "--abi #{params[:avd_abi]}"
54
+ create_avd = ["echo no | #{params[:sdk_path]}/tools/bin/avdmanager", "create avd", avd_package, avd_name, avd_abi]
59
55
  UI.important("Creating AVD...")
60
56
  Action.sh(create_avd)
61
57
  end
62
58
 
63
59
  def self.start_emulator(params)
64
60
  UI.important("Starting AVD...")
65
- ui_args="-gpu on"
66
- ui_args="-no-window" if params[:avd_hide]
67
- ui_args=params[:avd_emulator_options] if params[:avd_emulator_options] != nil
61
+ ui_args = "-gpu on"
62
+ ui_args << " -no-window" if params[:avd_hide]
63
+ ui_args << " #{params[:emulator_options]}" if params[:emulator_options] != nil
68
64
  start_avd = ["#{params[:sdk_path]}/tools/emulator", "-avd #{params[:avd_name]}", "#{ui_args}", "-port #{params[:avd_port]}" ].join(" ")
69
65
 
70
66
  UI.command(start_avd)
@@ -155,26 +151,16 @@ module Fastlane
155
151
  description: "Name of the avd to be created",
156
152
  is_string: true,
157
153
  optional: false),
158
- FastlaneCore::ConfigItem.new(key: :target_id,
159
- env_name: "TARGET_ID",
160
- description: "Target id of the avd to be created, get list of installed target by running command 'android list targets'",
161
- is_string: true,
162
- optional: false),
163
- FastlaneCore::ConfigItem.new(key: :avd_options,
164
- env_name: "AVD_OPTIONS",
165
- description: "Other avd command line options passed to 'android create avd ...'. i.e. \"--scale 96dpi --dpi-device 160\"",
166
- is_string: true,
167
- optional: true),
168
154
  FastlaneCore::ConfigItem.new(key: :avd_abi,
169
155
  env_name: "AVD_ABI",
170
- description: "The ABI to use for the AVD. The default is to auto-select the ABI if the platform has only one ABI for its system images",
156
+ description: "The ABI to use for the AVD (e.g. google_apis/x86)",
171
157
  is_string: true,
172
- optional: true),
173
- FastlaneCore::ConfigItem.new(key: :avd_tag,
174
- env_name: "AVD_TAG",
175
- description: "The sys-img tag to use for the AVD. The default is to auto-select if the platform has only one tag for its system images",
158
+ optional: false),
159
+ FastlaneCore::ConfigItem.new(key: :avd_package,
160
+ env_name: "AVD_PACKAGE",
161
+ description: "Package path of the system image for this AVD (e.g. 'system-images;android-19;google_apis;x86')",
176
162
  is_string: true,
177
- optional: true),
163
+ optional: false),
178
164
  FastlaneCore::ConfigItem.new(key: :avd_port,
179
165
  env_name: "AVD_PORT",
180
166
  description: "The port used for communication with the emulator. If not set it is randomly selected",
@@ -186,13 +172,8 @@ module Fastlane
186
172
  is_string: false,
187
173
  optional: true,
188
174
  default_value: 500),
189
- FastlaneCore::ConfigItem.new(key: :avd_hide,
190
- env_name: "AVD_HIDE",
191
- description: "Hide the avd interface, required for CI. Default true if on CI, false if not on CI",
192
- is_string: false,
193
- optional: true),
194
- FastlaneCore::ConfigItem.new(key: :avd_emulator_options,
195
- env_name: "AVD_EMULATOR_OPTIONS",
175
+ FastlaneCore::ConfigItem.new(key: :emulator_options,
176
+ env_name: "EMULATOR_OPTIONS",
196
177
  description: "Other options passed to the emulator command ('emulator -avd AVD_NAME ...')." +
197
178
  "Defaults are '-gpu on' when AVD_HIDE is false and '-no-window' otherwise. " +
198
179
  "For macs running the CI you might want to use '-no-audio -no-window'",
@@ -219,7 +200,13 @@ module Fastlane
219
200
  env_name: 'FL_GRADLE_PROJECT_DIR',
220
201
  description: 'The root directory of the gradle project. Defaults to `.`',
221
202
  default_value: '.',
222
- is_string: true)
203
+ is_string: true),
204
+ FastlaneCore::ConfigItem.new(key: :avd_hide,
205
+ env_name: "AVD_HIDE",
206
+ description: "Specifies whether the emulator should be hidden or not (defaults to true)",
207
+ default_value: true,
208
+ is_string: false,
209
+ optional: true)
223
210
  ]
224
211
  end
225
212
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module InstrumentedTests
3
- VERSION = "0.1.6"
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-instrumented_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Silviu Paragina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-26 00:00:00.000000000 Z
11
+ date: 2018-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.5.1
129
+ rubygems_version: 2.7.4
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: New action to run instrumented tests for android. This plugin creates and