illuminator 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/gem/README.md +37 -0
  3. data/gem/bin/illuminatorTestRunner.rb +22 -0
  4. data/gem/lib/illuminator.rb +171 -0
  5. data/gem/lib/illuminator/argument-parsing.rb +299 -0
  6. data/gem/lib/illuminator/automation-builder.rb +39 -0
  7. data/gem/lib/illuminator/automation-runner.rb +589 -0
  8. data/gem/lib/illuminator/build-artifacts.rb +118 -0
  9. data/gem/lib/illuminator/device-installer.rb +45 -0
  10. data/gem/lib/illuminator/host-utils.rb +42 -0
  11. data/gem/lib/illuminator/instruments-runner.rb +301 -0
  12. data/gem/lib/illuminator/javascript-runner.rb +98 -0
  13. data/gem/lib/illuminator/listeners/console-logger.rb +32 -0
  14. data/gem/lib/illuminator/listeners/full-output.rb +13 -0
  15. data/gem/lib/illuminator/listeners/instruments-listener.rb +22 -0
  16. data/gem/lib/illuminator/listeners/intermittent-failure-detector.rb +49 -0
  17. data/gem/lib/illuminator/listeners/pretty-output.rb +26 -0
  18. data/gem/lib/illuminator/listeners/saltinel-agent.rb +66 -0
  19. data/gem/lib/illuminator/listeners/saltinel-listener.rb +26 -0
  20. data/gem/lib/illuminator/listeners/start-detector.rb +52 -0
  21. data/gem/lib/illuminator/listeners/stop-detector.rb +46 -0
  22. data/gem/lib/illuminator/listeners/test-listener.rb +58 -0
  23. data/gem/lib/illuminator/listeners/trace-error-detector.rb +38 -0
  24. data/gem/lib/illuminator/options.rb +96 -0
  25. data/gem/lib/illuminator/resources/IlluminatorGeneratedEnvironment.erb +13 -0
  26. data/gem/lib/illuminator/resources/IlluminatorGeneratedRunnerForInstruments.erb +19 -0
  27. data/gem/lib/illuminator/test-definitions.rb +23 -0
  28. data/gem/lib/illuminator/test-suite.rb +155 -0
  29. data/gem/lib/illuminator/version.rb +3 -0
  30. data/gem/lib/illuminator/xcode-builder.rb +144 -0
  31. data/gem/lib/illuminator/xcode-utils.rb +219 -0
  32. data/gem/resources/BuildConfiguration.xcconfig +10 -0
  33. data/gem/resources/js/AppMap.js +767 -0
  34. data/gem/resources/js/Automator.js +1132 -0
  35. data/gem/resources/js/Base64.js +142 -0
  36. data/gem/resources/js/Bridge.js +102 -0
  37. data/gem/resources/js/Config.js +92 -0
  38. data/gem/resources/js/Extensions.js +2025 -0
  39. data/gem/resources/js/Illuminator.js +228 -0
  40. data/gem/resources/js/Preferences.js +24 -0
  41. data/gem/resources/scripts/UIAutomationBridge.rb +248 -0
  42. data/gem/resources/scripts/common.applescript +25 -0
  43. data/gem/resources/scripts/diff_png.sh +61 -0
  44. data/gem/resources/scripts/kill_all_sim_processes.sh +17 -0
  45. data/gem/resources/scripts/plist_to_json.sh +40 -0
  46. data/gem/resources/scripts/set_hardware_keyboard.applescript +0 -0
  47. metadata +225 -0
@@ -0,0 +1,25 @@
1
+
2
+
3
+ on launch_ios_simulator()
4
+ tell application "iOS Simulator" to launch
5
+
6
+ set inTime to current date
7
+ repeat
8
+ tell application "System Events"
9
+ if "iOS Simulator" is in (get name of processes) then exit repeat
10
+ end tell
11
+ if (current date) - inTime is greater than 10 then exit repeat
12
+ delay 0.2
13
+ end repeat
14
+
15
+ tell application "iOS Simulator" to activate
16
+
17
+ set inTime to current date
18
+ repeat
19
+ tell application "System Events"
20
+ if visible of process "iOS Simulator" is true then exit repeat
21
+ end tell
22
+ if (current date) - inTime is greater than 10 then exit repeat
23
+ delay 0.2
24
+ end repeat
25
+ end launch_ios_simulator
@@ -0,0 +1,61 @@
1
+ #!/bin/sh
2
+
3
+ mycmd=$(basename $0)
4
+ if [ $# -lt 4 ]
5
+ then
6
+ echo
7
+ echo "Usage: $mycmd <file1> <file2> <mask> <diff>"
8
+ echo
9
+ echo "Compare two images and print the number of pixels that differ."
10
+ echo " - mask is a transparent image with masked areas colored magenta"
11
+ echo " - diff image will be written to the given base path in PNG and GIF format"
12
+ echo
13
+ exit 2;
14
+ fi
15
+
16
+ echo "Create temp image files" >&2
17
+ # FIXME: need PNG extensions!!!
18
+ tmpdir=$(mktemp -dt "$mycmd.")
19
+ img1="$tmpdir/img1.png"
20
+ img2="$tmpdir/img2.png"
21
+ imgm="$tmpdir/imgm.png"
22
+
23
+ diffpng="$4.png"
24
+ diffgif="$4.gif"
25
+
26
+ echo "Normalize mask to black" >&2
27
+ convert "$3" -fill black -opaque magenta "$imgm"
28
+ echo "Apply mask to image 1" >&2
29
+ composite -gravity center "$3" "$1" "$img1"
30
+ echo "Apply mask to image 2" >&2
31
+ composite -gravity center "$3" "$2" "$img2"
32
+
33
+ echo "Compare 2 masked images, get differences" >&2
34
+ diffpixels=$(compare "$img1" "$img2" -highlight-color red -metric AE "$diffpng" 2>&1)
35
+ RESULT=$?
36
+ echo "Re-overlay the mask on the composite" >&2
37
+ composite -gravity center "$imgm" "$diffpng" "$diffpng"
38
+
39
+ # Convert any scientific notation to integer
40
+ printf -v diffpixels "%.f" "$diffpixels"
41
+
42
+ # IF DIFFERENT
43
+ if [ "$diffpixels" -ne "0" ]
44
+ then
45
+ echo "Create the animated gif comparison" >&2
46
+ convert -delay 50 "$img1" "$img2" -loop 0 "$diffgif"
47
+ else
48
+ rm -f "$diffpng"
49
+ fi
50
+
51
+ # count total pixels
52
+ convert "$diffpng" -print "pixels (total): %[fx:w*h]\n" null:
53
+
54
+ # count masked pixels
55
+ convert "$3" -format %c histogram:info: | grep FF00FF | tr -d ' ' | awk -F: '{print "pixels masked: " $1}'
56
+
57
+ # count changed pixels
58
+ echo "pixels changed: $diffpixels"
59
+
60
+ # remove temp images
61
+ rm -rf "$tmpdir"
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+
3
+ # kill simulator
4
+ echo "Killing all top-level Xcode 5 simulator processes..."
5
+ killall -9 "iPhone Simulator" 2>&1
6
+ echo "Killing all top-level Xcode 6 simulator processes..."
7
+ killall -9 "iOS Simulator" 2>&1
8
+
9
+ echo "Killing ScriptAgent..."
10
+ killall -9 "ScriptAgent" 2>&1
11
+
12
+ # kill xpcproxy_sim zombies by explicitly killing parent process
13
+ echo "Killing any xpcproxy_sim zombies..."
14
+ ps -edf | \
15
+ grep [x]pcproxy_sim | awk '{print $3}' | \
16
+ sort | uniq | \
17
+ xargs -I{} echo "kill -9 {} 2>&1" | sh
@@ -0,0 +1,40 @@
1
+ #!/bin/sh
2
+
3
+ # usage function to display help
4
+
5
+ usage ()
6
+ {
7
+ mycmd=`basename $0`
8
+ echo "$mycmd"
9
+ echo "usage: $mycmd plistfile"
10
+ echo
11
+ echo "Prints the contents of the plistfile to stdout in JSON format"
12
+ }
13
+
14
+
15
+ # test if we have an arguments on the command line
16
+ if [ $# -lt 1 ]
17
+ then
18
+ usage
19
+ exit
20
+ fi
21
+
22
+ # check existence of file, exit if it doesn't exist
23
+ ls "$1" 1>/dev/null
24
+ rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
25
+
26
+ # create temp file for the result
27
+ mycmd=$(basename $0)
28
+ tmpfile=$(mktemp -t "$mycmd.")
29
+ echo "Using the following tempfile for conversion: $tmpfile" >&2
30
+
31
+ plutil -convert json -o "$tmpfile" "$1" 2>/dev/null
32
+
33
+ # save result of that command for after we clean up
34
+ result=$?
35
+
36
+ cat "$tmpfile"
37
+ rm -f "$tmpfile"
38
+
39
+ # exit with return value from plutil
40
+ exit $result
metadata ADDED
@@ -0,0 +1,225 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: illuminator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ian Katz
8
+ - Boris Erceg
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2015-06-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ - - '>='
22
+ - !ruby/object:Gem::Version
23
+ version: 1.3.6
24
+ type: :development
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: '1.3'
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.6
34
+ - !ruby/object:Gem::Dependency
35
+ name: rake
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ type: :development
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ - !ruby/object:Gem::Dependency
49
+ name: rubocop
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.31'
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: 0.31.0
58
+ type: :development
59
+ prerelease: false
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ~>
63
+ - !ruby/object:Gem::Version
64
+ version: '0.31'
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: 0.31.0
68
+ - !ruby/object:Gem::Dependency
69
+ name: json
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ~>
73
+ - !ruby/object:Gem::Version
74
+ version: '1.7'
75
+ - - '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.7.7
78
+ type: :runtime
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ~>
83
+ - !ruby/object:Gem::Version
84
+ version: '1.7'
85
+ - - '>='
86
+ - !ruby/object:Gem::Version
87
+ version: 1.7.7
88
+ - !ruby/object:Gem::Dependency
89
+ name: colorize
90
+ requirement: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ version: '0.7'
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: 0.7.5
98
+ type: :runtime
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ~>
103
+ - !ruby/object:Gem::Version
104
+ version: '0.7'
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: 0.7.5
108
+ - !ruby/object:Gem::Dependency
109
+ name: xcpretty
110
+ requirement: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ~>
113
+ - !ruby/object:Gem::Version
114
+ version: '0.1'
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: 0.1.8
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '0.1'
125
+ - - '>='
126
+ - !ruby/object:Gem::Version
127
+ version: 0.1.8
128
+ - !ruby/object:Gem::Dependency
129
+ name: dnssd
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ~>
133
+ - !ruby/object:Gem::Version
134
+ version: '3.0'
135
+ - - '>='
136
+ - !ruby/object:Gem::Version
137
+ version: 3.0.1
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ~>
143
+ - !ruby/object:Gem::Version
144
+ version: '3.0'
145
+ - - '>='
146
+ - !ruby/object:Gem::Version
147
+ version: 3.0.1
148
+ description: Illuminator enables continuous integration for iOS apps by improving
149
+ the UIAutomation framework.
150
+ email:
151
+ - iakatz@paypal.com
152
+ executables: []
153
+ extensions: []
154
+ extra_rdoc_files: []
155
+ files:
156
+ - gem/README.md
157
+ - gem/bin/illuminatorTestRunner.rb
158
+ - gem/lib/illuminator.rb
159
+ - gem/lib/illuminator/argument-parsing.rb
160
+ - gem/lib/illuminator/automation-builder.rb
161
+ - gem/lib/illuminator/automation-runner.rb
162
+ - gem/lib/illuminator/build-artifacts.rb
163
+ - gem/lib/illuminator/device-installer.rb
164
+ - gem/lib/illuminator/host-utils.rb
165
+ - gem/lib/illuminator/instruments-runner.rb
166
+ - gem/lib/illuminator/javascript-runner.rb
167
+ - gem/lib/illuminator/listeners/console-logger.rb
168
+ - gem/lib/illuminator/listeners/full-output.rb
169
+ - gem/lib/illuminator/listeners/instruments-listener.rb
170
+ - gem/lib/illuminator/listeners/intermittent-failure-detector.rb
171
+ - gem/lib/illuminator/listeners/pretty-output.rb
172
+ - gem/lib/illuminator/listeners/saltinel-agent.rb
173
+ - gem/lib/illuminator/listeners/saltinel-listener.rb
174
+ - gem/lib/illuminator/listeners/start-detector.rb
175
+ - gem/lib/illuminator/listeners/stop-detector.rb
176
+ - gem/lib/illuminator/listeners/test-listener.rb
177
+ - gem/lib/illuminator/listeners/trace-error-detector.rb
178
+ - gem/lib/illuminator/options.rb
179
+ - gem/lib/illuminator/resources/IlluminatorGeneratedEnvironment.erb
180
+ - gem/lib/illuminator/resources/IlluminatorGeneratedRunnerForInstruments.erb
181
+ - gem/lib/illuminator/test-definitions.rb
182
+ - gem/lib/illuminator/test-suite.rb
183
+ - gem/lib/illuminator/version.rb
184
+ - gem/lib/illuminator/xcode-builder.rb
185
+ - gem/lib/illuminator/xcode-utils.rb
186
+ - gem/resources/BuildConfiguration.xcconfig
187
+ - gem/resources/js/AppMap.js
188
+ - gem/resources/js/Automator.js
189
+ - gem/resources/js/Base64.js
190
+ - gem/resources/js/Bridge.js
191
+ - gem/resources/js/Config.js
192
+ - gem/resources/js/Extensions.js
193
+ - gem/resources/js/Illuminator.js
194
+ - gem/resources/js/Preferences.js
195
+ - gem/resources/scripts/UIAutomationBridge.rb
196
+ - gem/resources/scripts/common.applescript
197
+ - gem/resources/scripts/diff_png.sh
198
+ - gem/resources/scripts/kill_all_sim_processes.sh
199
+ - gem/resources/scripts/plist_to_json.sh
200
+ - gem/resources/scripts/set_hardware_keyboard.applescript
201
+ homepage: http://github.com/paypal/illuminator
202
+ licenses:
203
+ - Apache 2.0
204
+ metadata: {}
205
+ post_install_message:
206
+ rdoc_options: []
207
+ require_paths:
208
+ - gem/lib
209
+ required_ruby_version: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ required_rubygems_version: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - '>='
217
+ - !ruby/object:Gem::Version
218
+ version: '0'
219
+ requirements: []
220
+ rubyforge_project:
221
+ rubygems_version: 2.4.6
222
+ signing_key:
223
+ specification_version: 4
224
+ summary: iOS CI test runner for Illuminator
225
+ test_files: []