run_loop 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7552a576fe17fc056f8bd701a86c3f9b48a494d
4
- data.tar.gz: 3cc4607e284f43dd237059386d2c4d1e97dc1934
3
+ metadata.gz: 5fa8d6acd657ee7230c4095b970215199e1e9d03
4
+ data.tar.gz: b06b85cde2448ca8f5a97f79a834c237f920d008
5
5
  SHA512:
6
- metadata.gz: 2adcaae646576ab37d3ab5e0a9afff7dfcb13f262e53f1ef545521b3ca325054f0cd00b22038511d8fdad11b2c5d9072b070a64f60d645302919327977ac25a0
7
- data.tar.gz: 21e54fdbf93061cb3a7ba279aede270c25e2118c22474f13a11c22a93d9c43916b4eaf52d92538878c2ef97e9311d57e69bc70bbe96bb84cf73f8799fef11ff9
6
+ metadata.gz: ccd75f46828607b5e5d40df9acfa688f15ff5b812f9366657b9638cb93cd316080b02652f97f8bdcc0299ffeb167461925a85b26c2177313b9f52960126f70c9
7
+ data.tar.gz: c87f40e81cad88dcd0f5d29b9d49a76920f3b06f263d2ad8fab45fd84eff07c509ea43f7a6af64ee1e7c8ac05172952b0878920edf18182a5ed139628993d0c0
@@ -75,10 +75,23 @@ but binary does not exist at that path.
75
75
  #
76
76
  # ~/.calabash/iOSDeviceManager/logs/current.log
77
77
  #
78
- # There is still occasional output to ~/.run-loop.
78
+ # Starting in run-loop 2.4.0, iOSDeviceManager start_test was replaced
79
+ # by xcodebuild test-without-building. This change causes a name
80
+ # conflict: there is already an xcodebuild launcher with a log file
81
+ # ~/.run-loop/DeviceAgent/xcodebuild.log.
82
+ #
83
+ # The original xcodebuild launcher requires access to the DeviceAgent
84
+ # Xcode project which is not yet available to the public.
85
+ #
86
+ # Using `current.log` seems to make sense because the file is recreated
87
+ # for every call to `#launch`.
79
88
  def self.log_file
80
- path = File.join(LauncherStrategy.dot_dir, "ios-device-manager.log")
89
+ path = File.join(LauncherStrategy.dot_dir, "current.log")
81
90
  FileUtils.touch(path) if !File.exist?(path)
91
+ legacy_path = File.join(LauncherStrategy.dot_dir, "ios-device-manager.log")
92
+ if File.exist?(legacy_path)
93
+ FileUtils.rm_rf(legacy_path)
94
+ end
82
95
  path
83
96
  end
84
97
 
@@ -140,9 +153,9 @@ Could not install #{runner.runner}. iOSDeviceManager says:
140
153
 
141
154
  cmd = "xcrun"
142
155
  args = ["xcodebuild", "test-without-building",
143
- "-xctestrun", path_to_xctestrun(device),
156
+ "-xctestrun", path_to_xctestrun,
144
157
  "-destination", "id=#{device.udid}",
145
- "-derivedDataPath", derived_data_directory]
158
+ "-derivedDataPath", Xcodebuild.derived_data_directory]
146
159
 
147
160
  log_file = IOSDeviceManager.log_file
148
161
  FileUtils.rm_rf(log_file)
@@ -200,12 +213,21 @@ iOSDeviceManager says:
200
213
  hash[:exit_status] == 0
201
214
  end
202
215
 
203
- def path_to_xctestrun(device)
216
+ def path_to_xctestrun
204
217
  if device.physical_device?
205
- File.join(runner.tester, "DeviceAgent-device.xctestrun")
218
+ path = File.join(runner.tester, "DeviceAgent-device.xctestrun")
219
+ if !File.exist?(path)
220
+ raise RuntimeError, %Q[
221
+ Could not find an xctestrun file at path:
222
+
223
+ #{path}
224
+
225
+ ]
226
+ end
227
+ path
206
228
  else
207
- template = File.join(runner.tester, "DeviceAgent-simulator-template.xctestrun")
208
- path = File.join(RunLoop::DotDir.directory, "xcuitest", "DeviceAgent-simulator.xctestrun")
229
+ template = path_to_xctestrun_template
230
+ path = File.join(IOSDeviceManager.dot_dir, "DeviceAgent-simulator.xctestrun")
209
231
  contents = File.read(template).force_encoding("UTF-8")
210
232
  substituted = contents.gsub("TEST_HOST_PATH", runner.runner)
211
233
  File.open(path, "w:UTF-8") do |file|
@@ -215,10 +237,21 @@ iOSDeviceManager says:
215
237
  end
216
238
  end
217
239
 
218
- def derived_data_directory
219
- path = File.join(RunLoop::DotDir.directory, "xcuitest", "DerivedData")
220
- FileUtils.mkdir_p(path) if !File.exist?(path)
221
- path
240
+ def path_to_xctestrun_template
241
+ if device.physical_device?
242
+ raise(ArgumentError, "Physical devices do not require an xctestrun template")
243
+ end
244
+
245
+ template = File.join(runner.tester, "DeviceAgent-simulator-template.xctestrun")
246
+ if !File.exist?(template)
247
+ raise RuntimeError, %Q[
248
+ Could not find an xctestrun template at path:
249
+
250
+ #{template}
251
+
252
+ ]
253
+ end
254
+ template
222
255
  end
223
256
  end
224
257
  end
@@ -46,12 +46,17 @@ DeviceAgent is only available for iOS >= 9.0
46
46
 
47
47
  # @!visibility private
48
48
  def self.dot_dir
49
- path = File.join(RunLoop::DotDir.directory, "xcuitest")
49
+ path = File.join(RunLoop::DotDir.directory, "DeviceAgent")
50
+ legacy_path = File.join(RunLoop::DotDir.directory, "xcuitest")
50
51
 
51
- if !File.exist?(path)
52
- FileUtils.mkdir_p(path)
52
+ if File.directory?(legacy_path)
53
+ FileUtils.cp_r(legacy_path, path)
54
+ FileUtils.rm_rf(legacy_path)
55
+ else
56
+ if !File.exist?(path)
57
+ FileUtils.mkdir_p(path)
58
+ end
53
59
  end
54
-
55
60
  path
56
61
  end
57
62
  end
@@ -14,6 +14,13 @@ module RunLoop
14
14
  path
15
15
  end
16
16
 
17
+ # @!visibility private
18
+ def self.derived_data_directory
19
+ path = File.join(Xcodebuild.dot_dir, "DerivedData")
20
+ FileUtils.mkdir_p(path) if !File.exist?(path)
21
+ path
22
+ end
23
+
17
24
  # @!visibility private
18
25
  def to_s
19
26
  "#<Xcodebuild #{workspace}>"
@@ -75,7 +82,7 @@ Use the CBXWS environment variable to override the default.
75
82
  args = [
76
83
  "xcrun",
77
84
  "xcodebuild",
78
- "-derivedDataPath", derived_data_directory,
85
+ "-derivedDataPath", Xcodebuild.derived_data_directory,
79
86
  "-scheme", "AppStub",
80
87
  "-workspace", workspace,
81
88
  "-config", "Debug",
@@ -109,12 +116,6 @@ Use the CBXWS environment variable to override the default.
109
116
  relative = File.expand_path(File.join(this_dir, "..", "..", "..", ".."))
110
117
  File.join(relative, "DeviceAgent.iOS/DeviceAgent.xcworkspace")
111
118
  end
112
-
113
- def derived_data_directory
114
- path = File.join(Xcodebuild.dot_dir, "DerivedData")
115
- FileUtils.mkdir_p(path) if !File.exist?(path)
116
- path
117
- end
118
119
  end
119
120
  end
120
121
  end
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
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.4.0
4
+ version: 2.4.1
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-04-07 00:00:00.000000000 Z
12
+ date: 2017-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json