run_loop 2.6.2 → 2.6.3

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: d157fb1a0866b6105c1dfef4bd804f772b5f53dc
4
- data.tar.gz: 073d5eebb4852b48cd5dc0f9b0d4cc9fa52b61ee
3
+ metadata.gz: ba7fb2a997b1945eab1c23eed06b9325be079588
4
+ data.tar.gz: ab1d0925001a3f3db097f913d1d77848394e1c22
5
5
  SHA512:
6
- metadata.gz: 95e5a217258365b50639ca76cbc1c4632b497477319df3b006019c40b80438fed4e8d168bdb75e75e7f8776eb275ae2437b8aa582b5c726de5ece39c6964cb54
7
- data.tar.gz: b21e59f88359d74e7873d74bc872432d0e95ca6045dbf02868e6771d22effa9856c2fb2ee0da371d48546c79b0dfa412cb01af10fd26868fe6e424e6d10c8ede
6
+ metadata.gz: ac48671513f197677f38a24dfceb115d5a2bb7eca0cc6fc53aed8de41c2430d154b2be619f44f53f9b40c537f5da8280ae497fd097186e506d3f1b8f93f5a728
7
+ data.tar.gz: d717c970286ad652ba9f2ab25671b8a77116783eaceb0cdb8a24444582df129abd16ba7de930529d1a2f93d8a3dcb51de12f5f25e7a89009d33b6e22d14efd9b
@@ -286,6 +286,10 @@ INSTANCE METHODS
286
286
  to_s
287
287
  end
288
288
 
289
+ def launcher_options!(new_options)
290
+ @launcher_options = new_options.dup
291
+ end
292
+
289
293
  # @!visibility private
290
294
  def launch
291
295
  start = Time.now
@@ -1237,11 +1241,24 @@ PRIVATE
1237
1241
  end
1238
1242
 
1239
1243
  # @!visibility private
1240
- def server_pid
1241
- options = http_options
1242
- request = request("pid")
1243
- client = http_client(options)
1244
- response = client.get(request)
1244
+ def process_pid(bundle_identifier)
1245
+ request = request("pid", { bundleID: bundle_identifier })
1246
+ client = http_client(http_options)
1247
+ response = client.post(request)
1248
+ expect_300_response(response)["pid"]
1249
+ end
1250
+
1251
+ # @!visibility private
1252
+ def app_running?(bundle_identifier)
1253
+ process_pid(bundle_identifier) != "0"
1254
+ end
1255
+
1256
+ # @!visibility private
1257
+ def terminate_app(bundle_identifier, strategy=nil)
1258
+ request = request("terminate", { bundleID: bundle_identifier,
1259
+ strategy: strategy})
1260
+ client = http_client(http_options)
1261
+ response = client.post(request)
1245
1262
  expect_300_response(response)
1246
1263
  end
1247
1264
 
@@ -1258,12 +1275,27 @@ PRIVATE
1258
1275
  def session_delete
1259
1276
  # https://xamarin.atlassian.net/browse/TCFW-255
1260
1277
  # httpclient is unable to send a valid DELETE
1261
- args = ["curl", "-X", "DELETE", %Q[#{url}#{versioned_route("session")}]]
1278
+ args = ["curl", "--insecure", "--silent", "--request", "DELETE",
1279
+ %Q[#{url}#{versioned_route("session")}]]
1262
1280
 
1263
1281
  begin
1264
- run_shell_command(args, {:log_cmd => true, :timeout => 10})
1282
+ hash = run_shell_command(args, {:log_cmd => true, :timeout => 10})
1283
+
1284
+ begin
1285
+ JSON.parse(hash[:out])
1286
+ rescue TypeError, JSON::ParserError => _
1287
+ raise RunLoop::DeviceAgent::Client::HTTPError, %Q[
1288
+ Could not parse response from server:
1289
+
1290
+ body => "#{hash[:out]}"
1291
+
1292
+ If the body empty, the DeviceAgent has probably crashed.
1293
+
1294
+ ]
1295
+ end
1265
1296
  rescue Shell::TimeoutError => _
1266
1297
  RunLoop.log_debug("Timed out calling DELETE session/ after 10 seconds")
1298
+ {}
1267
1299
  end
1268
1300
  end
1269
1301
 
@@ -139,7 +139,7 @@ Expected :device_agent_install_timeout key in options:
139
139
  end
140
140
 
141
141
  if provisioning_profile
142
- args = args + ["--provisioning-profile", provisioning_profile]
142
+ args = args + ["--profile-path", provisioning_profile]
143
143
  end
144
144
 
145
145
  start = Time.now
@@ -58,8 +58,10 @@ module RunLoop
58
58
  options = {timeout: 5 }
59
59
  begin
60
60
  hash = Shell.run_shell_command(args, options)
61
- hash[:exit_status] == 0 &&
62
- !hash[:out][/Failed to locate a valid instance of CoreSimulatorService/]
61
+ return false if hash[:exit_status] != 0
62
+ return false if hash[:out][/Failed to locate a valid instance of CoreSimulatorService/]
63
+ return false if hash[:out][/CoreSimulatorService connection became invalid/]
64
+ true
63
65
  rescue RunLoop::Shell::TimeoutError, RunLoop::Shell::Error => _
64
66
  false
65
67
  end
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = "2.6.2"
2
+ VERSION = "2.6.3"
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_loop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-09 00:00:00.000000000 Z
12
+ date: 2017-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json