flaky 0.0.23 → 0.0.24

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: 3d47a6d81b834bcde7d9bf32225bb93a07961a0f
4
- data.tar.gz: e17bdee7458eb5cd3f8b3610ca2ef33a80a82a12
3
+ metadata.gz: 6164251eb88190e5da605eb81d846be8960f0fea
4
+ data.tar.gz: 58b4537320b25d5362d4dbfffc8e22b1c729a3df
5
5
  SHA512:
6
- metadata.gz: 9a11390a90e848bb18de2adfd0154af6546b61527f341cbeef135ec198251ec745b9ea1be5eef122a16e48c1610bed10c96b3bfbe00cf4bd75afd51c27684b13
7
- data.tar.gz: 82e6234ef0789952a1eab8438a9d836f23ec07a0956cae9083812b50533df4cf52a395dd3ff948ba0aeadb89a600391a114b781105bb6ad8bce8309bd75a1af1
6
+ metadata.gz: 8e8bbe7d253534769f80fe775e4c6ea1a1c2dda773538c008136c9ed4e464a44df4f516ff77cb53ad3f9691dbeb1c7532df54e3ec1ecccffe0514780f9baf828
7
+ data.tar.gz: 882d1d81b39a10c8b173ad54a3b1bf95d8bfa9de30edaf1ae34da1fe2b3b1e4a05f18e94d52adb6917feb5c4686664b98c6045b9716f71393fb6a46746e25339
data/lib/flaky.rb CHANGED
@@ -9,8 +9,8 @@ require 'posix/spawn' # http://rubygems.org/gems/posix-spawn
9
9
  require 'digest/md5'
10
10
 
11
11
  module Flaky
12
- VERSION = '0.0.23' unless defined? ::Flaky::VERSION
13
- DATE = '2014-01-08' unless defined? ::Flaky::DATE
12
+ VERSION = '0.0.24' unless defined? ::Flaky::VERSION
13
+ DATE = '2014-01-09' unless defined? ::Flaky::DATE
14
14
 
15
15
  class << self; attr_accessor :no_video; end
16
16
  self.no_video = false; # set default value
@@ -18,6 +18,7 @@ module Flaky
18
18
  # require internal files
19
19
  require_relative 'flaky/appium'
20
20
  require_relative 'flaky/applescript'
21
+ require_relative 'flaky/reset_android'
21
22
  require_relative 'flaky/run'
22
23
 
23
24
  require_relative 'flaky/run/all_tests'
data/lib/flaky/appium.rb CHANGED
@@ -61,9 +61,7 @@ module Flaky
61
61
  @log = ''
62
62
  @buffer = ''
63
63
  @android = opts.fetch(:android, false)
64
- if @android
65
- @droid = Flaky::Android.new
66
- end
64
+ @droid = Flaky::Android.new if @android
67
65
  @ios = ! @android
68
66
  end
69
67
 
@@ -71,6 +69,7 @@ module Flaky
71
69
  self.stop # stop existing process
72
70
  @log = "/tmp/flaky/appium_tmp_log.txt"
73
71
  File.delete(@log) if File.exists? @log
72
+ # must not rely on appium for reset.
74
73
  if @android
75
74
  @droid.reset
76
75
  else
data/lib/flaky/run.rb CHANGED
@@ -134,6 +134,13 @@ module Flaky
134
134
  log = ''
135
135
  tmp_ruby_log = '/tmp/flaky/ruby_log_tmp.txt'
136
136
  File.delete(tmp_ruby_log) if File.exists? tmp_ruby_log
137
+
138
+ flaky_logs_txt = '/tmp/flaky_logs.txt'
139
+ File.delete flaky_logs_txt if File.exist? flaky_logs_txt
140
+ tail_cmd = "tail -f -n1 /Users/#{ENV['USER']}/Library/Logs/iOS\\ Simulator/7.0.3/system.log > #{flaky_logs_txt}"
141
+ tail_cmd = "adb logcat > #{flaky_logs_txt}" if !appium.ios
142
+
143
+ tail_system_log = Flaky::Cmd.new tail_cmd
137
144
  begin
138
145
  ten_minutes = 10 * 60
139
146
  timeout ten_minutes do
@@ -170,6 +177,14 @@ module Flaky
170
177
  end
171
178
  end
172
179
 
180
+ # waitpid may throw if the pid doesn't exist by the time we're ready to wait.
181
+ begin
182
+ tail_system_log_pid = tail_system_log.pid
183
+ Process.kill :SIGKILL, tail_system_log_pid
184
+ Process::waitpid tail_system_log_pid
185
+ rescue
186
+ end
187
+
173
188
  unless timedout
174
189
  found_results = log.scan result
175
190
  # all result instances must match success
@@ -11,7 +11,8 @@ module Flaky
11
11
 
12
12
  running_on_sauce = ENV['SAUCE_USERNAME'] ? true : false
13
13
  flaky = Flaky::Run.new
14
- appium = Appium.new unless running_on_sauce
14
+ is_android = os.strip.downcase == 'android'
15
+ appium = Appium.new(android: is_android) unless running_on_sauce
15
16
 
16
17
  current_dir = Dir.pwd
17
18
  raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile'))
@@ -30,11 +30,12 @@ module Flaky
30
30
  raise "Missing tests #{missing_tests}"
31
31
  end
32
32
 
33
+ raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile'))
34
+
33
35
  running_on_sauce = ENV['SAUCE_USERNAME'] ? true : false
34
36
  flaky = Flaky::Run.new
35
- appium = Appium.new unless running_on_sauce
36
-
37
- raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile'))
37
+ is_android = os.strip.downcase == 'android'
38
+ appium = Appium.new(android: is_android) unless running_on_sauce
38
39
 
39
40
  resolved_paths.each do |test_file|
40
41
  file = test_file
@@ -16,7 +16,8 @@ module Flaky
16
16
 
17
17
  running_on_sauce = ENV['SAUCE_USERNAME'] ? true : false
18
18
  flaky = Flaky::Run.new
19
- appium = Appium.new unless running_on_sauce
19
+ is_android = os.strip.downcase == 'android'
20
+ appium = Appium.new(android: is_android) unless running_on_sauce
20
21
 
21
22
  current_dir = Dir.pwd
22
23
 
@@ -16,7 +16,8 @@ module Flaky
16
16
  FileUtils.rm_rf '/tmp/flaky'
17
17
  result_dir_postfix = '1' # /tmp/flaky/1
18
18
  flaky = Flaky::Run.new(result_dir_postfix)
19
- appium = Appium.new unless running_on_sauce
19
+ is_android = os.strip.downcase == 'android'
20
+ appium = Appium.new(android: is_android) unless running_on_sauce
20
21
 
21
22
  current_dir = Dir.pwd
22
23
  raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile'))
data/release_notes.md CHANGED
@@ -1,3 +1,11 @@
1
+ #### v0.0.23 2014-01-08
2
+
3
+ - [2b19619](https://github.com/appium/flaky/commit/2b19619a2f544c0e29592a2eb814276cb61f1266) Release 0.0.23
4
+ - [44b1375](https://github.com/appium/flaky/commit/44b137532aedddcaf3eacb7350e7ce73f7c55aac) Add 10 minute test timeout
5
+ - [cefcfe3](https://github.com/appium/flaky/commit/cefcfe35f439e1939f0f8b1b63ffea3daecb685d) Update readme.md
6
+ - [3335ff0](https://github.com/appium/flaky/commit/3335ff015e9f04183e2bc408025c42785801839d) Fix appium log extension
7
+
8
+
1
9
  #### v0.0.22 2014-01-03
2
10
 
3
11
  - [e60803e](https://github.com/appium/flaky/commit/e60803e2e240617f7d7500c0cfc46e919033235d) Release 0.0.22
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flaky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2014-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic_duration