fastlane-plugin-automated_test_emulator_run 0.5.7 → 0.5.8

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: 3c944af9cc08ec10f293601d8b2be3171d53d4e1
4
- data.tar.gz: 5d3de76a679147d85c5425cc447c392ef769e105
3
+ metadata.gz: 2428aab12d4cfa4728942bb1e0ff3aab433fd8e4
4
+ data.tar.gz: d0ddf6f030afecfa5b57f81da91f8c91594da23b
5
5
  SHA512:
6
- metadata.gz: e3c4119ff6a00fba586ed4df4c38feff0c5f13cdb744f9e3cf889750880f47e36158485fa4b1aa37e5bab865b9da478dc131015e9c32e6375a2332eb9e62b9e4
7
- data.tar.gz: 7c72d3c2e932d14049da36ef55865cb2ba7b416325e4b670f8dfa0156c1a7a8943675b53cd657f779b0f04b8d3f6815f52d4d90a37ae885ec398d31606615815
6
+ metadata.gz: 626eecc8a94bf21059951c7822310a0ae67a25c92d426e9a82aa6f3fabfc0949a49bdbb3d74ec3b97e486fd6d041ff0bd45df3864bcb0705d23d76f1a91f7edf
7
+ data.tar.gz: dfdc4840f7d64de6aaa7805e504519c6c35662d7bdbadc113218774a4ffb11d89f7a2925ab3387413e389d3ad6a1208d627b4bf33caee51100617b6001b2d2e5
@@ -66,10 +66,8 @@ module Fastlane
66
66
 
67
67
  # Starting AVD
68
68
  UI.message("Starting AVD....".yellow)
69
-
70
- Action.sh(start_avd_command)
71
- waitFor_emulatorBoot(sdkRoot, port, params)
72
-
69
+ launchEmulator(start_avd_command, sdkRoot, port, params)
70
+
73
71
  UI.message("Starting tests".green)
74
72
  begin
75
73
  unless shell_command.nil?
@@ -100,7 +98,13 @@ module Fastlane
100
98
  return port
101
99
  end
102
100
 
103
- def self.waitFor_emulatorBoot(sdkRoot, port, params)
101
+ def self.launchEmulator(start_avd_command, sdkRoot, port, params)
102
+ restart_adb(sdkRoot)
103
+ Action.sh(start_avd_command)
104
+ waitFor_emulatorBoot(start_avd_command, sdkRoot, port, params)
105
+ end
106
+
107
+ def self.waitFor_emulatorBoot(start_avd_command, sdkRoot, port, params)
104
108
  UI.message("Waiting for emulator to finish booting.....".yellow)
105
109
  startParams = "#{params[:avd_start_options]}"
106
110
 
@@ -118,7 +122,12 @@ module Fastlane
118
122
  currentTime = Time.now
119
123
 
120
124
  if (currentTime - startTime) >= timeoutInSeconds
121
- UI.message("Emulator loading took more than 3 minutes.".yellow)
125
+ UI.message("Emulator loading took more than 3 minutes. Restarting emulator launch until.".yellow)
126
+ adb_devices_result = Action.sh("adb devices")
127
+ if adb_devices_result.include? "device offline"
128
+ launchEmulator(start_avd_command, sdkRoot, port, params)
129
+ break
130
+ end
122
131
  return false
123
132
  end
124
133
 
@@ -130,6 +139,12 @@ module Fastlane
130
139
  end
131
140
  end
132
141
 
142
+ def self.restart_adb(sdkRoot)
143
+ UI.message("Restarting adb..".green)
144
+ Action.sh(sdkRoot + "/platform-tools/adb kill-server")
145
+ Action.sh(sdkRoot + "/platform-tools/adb start-server")
146
+ end
147
+
133
148
  def self.waitFor_emulatorStop(sdkRoot, port, params)
134
149
  UI.message("Shutting down emulator...".green)
135
150
  Action.sh(sdkRoot + "/platform-tools/adb -s " + ["emulator-", port].join("") + " emu kill &>/dev/null")
@@ -137,10 +152,6 @@ module Fastlane
137
152
  delayInSeconds = 45.0
138
153
  sleep(delayInSeconds)
139
154
 
140
- UI.message("Restarting adb..".green)
141
- Action.sh(sdkRoot + "/platform-tools/adb kill-server")
142
- Action.sh(sdkRoot + "/platform-tools/adb start-server")
143
-
144
155
  UI.message("Deleting emulator....".green)
145
156
  Action.sh(sdkRoot + "/tools/android delete avd -n #{params[:avd_name]}")
146
157
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AutomatedTestEmulatorRun
3
- VERSION = "0.5.7"
3
+ VERSION = "0.5.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-automated_test_emulator_run
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Krzyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-04 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry