flaky 0.1.1 → 0.1.2

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: d5f94aa17cb93d97950dec074ca80ad912b61c9b
4
- data.tar.gz: 405486923ed99be2c3a0165e5ba8b3300b0169ac
3
+ metadata.gz: 731535ecad6aee9b747f751cd654a7ad183a13a1
4
+ data.tar.gz: 892cd6407dcfa844edc09a5b0b601bfaaaed6861
5
5
  SHA512:
6
- metadata.gz: 176333a8a05f759a6017ed360cbcef1ed74f41c23476c514640e76ef935dc5a853d68ae41e7a4aec96c0b7c6cccacd178685b82afd9123fd0b6716f7cf415683
7
- data.tar.gz: 1b66ac9b571df99316574fc7438e950a670230354a85eef8a52412fd7b779f1f45ce15e0fa41d7cfcfaa3f1122123ce7a41712a779fe6e03b4cc4574288ad739
6
+ metadata.gz: 3f2ebac794607daaf52a4281f7b01a6f09273e13853712938698cd7dd630912a6b4334f02ece2d3d2c777b9b24aae7a71aae91c8939dd278afee379527a299ca
7
+ data.tar.gz: 8ec671c657925c5f6781dc0ef887dc7230e73bfb7efb40588e0ac0b5a21ad9161358625619db09a8870303c377519c4e61003e230f2ae3e817d381619018185c
data/lib/flaky.rb CHANGED
@@ -10,8 +10,8 @@ require 'digest/md5'
10
10
  require 'toml'
11
11
 
12
12
  module Flaky
13
- VERSION = '0.1.1' unless defined? ::Flaky::VERSION
14
- DATE = '2014-05-19' unless defined? ::Flaky::DATE
13
+ VERSION = '0.1.2' unless defined? ::Flaky::VERSION
14
+ DATE = '2015-04-28' unless defined? ::Flaky::DATE
15
15
 
16
16
  class << self; attr_accessor :no_video; end
17
17
  self.no_video = false; # set default value
data/lib/flaky/appium.rb CHANGED
@@ -163,7 +163,7 @@ module Flaky
163
163
  raise "ENV['APPIUM_HOME'] must be set!" if appium_home.nil? || appium_home.empty?
164
164
  contains_appium = File.exists?(File.join(ENV['APPIUM_HOME'], 'bin', 'appium.js'))
165
165
  raise "Appium home `#{appium_home}` doesn't contain bin/appium.js!" unless contains_appium
166
- cmd = %Q(cd "#{appium_home}"; node .)
166
+ cmd = %Q(cd "#{appium_home}"; node . --log-level debug)
167
167
  @pid, @in, @out, @err = popen4 cmd
168
168
  @in.close
169
169
  self # used to chain `launch.wait`
@@ -18,7 +18,6 @@ module Flaky
18
18
  rakefile = File.expand_path(File.join(current_dir, 'Rakefile'))
19
19
  raise "Rakefile doesn't exist in #{current_dir}" unless File.exists? rakefile
20
20
  flaky_txt = File.expand_path(File.join(current_dir, 'flaky.txt'))
21
-
22
21
  parsed = TOML.load File.read flaky_txt
23
22
  puts "flaky.txt: #{parsed}"
24
23
  android_dir = parsed['android']
@@ -34,10 +33,8 @@ module Flaky
34
33
  test_file = File.expand_path test_file
35
34
 
36
35
  test_name = test_file.sub(File.expand_path(File.join(current_dir, active_dir)), '')
37
-
38
36
  # remove leading /
39
37
  test_name.sub!(test_name.match(/^\//).to_s, '')
40
-
41
38
  test_name = File.join(File.dirname(test_name), File.basename(test_name, '.*'))
42
39
 
43
40
  count.times do
@@ -12,7 +12,8 @@ module Flaky
12
12
  raise ':name must be a string' unless name.kind_of?(String)
13
13
 
14
14
  # ensure file name does not contain an extension
15
- name = File.basename name, '.*'
15
+ # don't expand the path because it's joined and expanded in final_path.
16
+ name = File.join(File.dirname(name), File.basename(name, '.*'))
16
17
 
17
18
  running_on_sauce = ENV['SAUCE_USERNAME'] ? true : false
18
19
  flaky = Flaky::Run.new
@@ -22,20 +23,28 @@ module Flaky
22
23
  current_dir = Dir.pwd
23
24
 
24
25
  raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile'))
25
-
26
- file = ''
27
- Dir.glob(File.join current_dir, 'appium', os, 'specs', "**/#{name}.rb") do |test_file|
28
- file = test_file
26
+ flaky_txt = File.expand_path(File.join(current_dir, 'flaky.txt'))
27
+ parsed = TOML.load File.read flaky_txt
28
+ puts "flaky.txt: #{parsed}"
29
+ android_dir = parsed['android']
30
+ ios_dir = parsed['ios']
31
+ active_dir = is_android ? android_dir : ios_dir
32
+ final_path = File.expand_path File.join current_dir, active_dir, name + '.rb'
33
+ test_file = ''
34
+ Dir.glob(final_path) do |file|
35
+ test_file = file
29
36
  end
30
37
 
31
- raise "#{name} does not exist." if file.empty?
38
+ raise "#{test_file} does not exist." unless File.exists?(test_file)
32
39
 
33
- test_name = file.sub(current_dir + '/appium/', '')
40
+ test_name = test_file.sub(File.expand_path(File.join(current_dir, active_dir)), '')
41
+ # remove leading /
42
+ test_name.sub!(test_name.match(/^\//).to_s, '')
34
43
  test_name = File.join(File.dirname(test_name), File.basename(test_name, '.*'))
35
44
 
36
45
  count.times do
37
46
  appium.start unless running_on_sauce
38
- run_cmd = "cd #{current_dir}; rake #{os.downcase}['#{name}',#{Flaky.no_video}]"
47
+ run_cmd = "cd #{current_dir}; rake #{os.downcase}['#{test_file}',#{Flaky.no_video}]"
39
48
  flaky.execute run_cmd: run_cmd, test_name: test_name, appium: appium, sauce: running_on_sauce
40
49
  end
41
50
 
data/release_notes.md CHANGED
@@ -1,3 +1,11 @@
1
+ #### v0.1.1 2014-05-19
2
+
3
+ - [98f3c87](https://github.com/appium/flaky/commit/98f3c87c1caa7c64b1d1da26f43642f4bdef04d1) Release 0.1.1
4
+ - [62d4278](https://github.com/appium/flaky/commit/62d427893f19fea1729a5c3c6f79ce72e1a11919) Fix test name
5
+ - [963978f](https://github.com/appium/flaky/commit/963978f041f2198dda07779505a058e971e13273) Default to no video
6
+ - [dd0ea3a](https://github.com/appium/flaky/commit/dd0ea3a99180e3c687ce67aae6cbf6abe2dac163) Fix paren
7
+
8
+
1
9
  #### v0.1.0 2014-04-30
2
10
 
3
11
  - [f8a79a4](https://github.com/appium/flaky/commit/f8a79a47fe01bd0e1f9e668b0a97d7d9ba6d41b7) Release 0.1.0
data/test/adb.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'posix-spawn'
3
+
4
+ Process::waitpid(POSIX::Spawn::spawn('killall', '-9', 'adb', :in => '/dev/null', :out => '/dev/null', :err => '/dev/null'))
5
+
6
+ puts 'Locating device...'
7
+
8
+ while `adb shell echo "ping"`.strip != 'ping'
9
+ `adb kill-server`
10
+ `adb devices` # std err is printed
11
+ sleep 5
12
+ end
13
+
14
+ puts 'Device found!'
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.1.1
4
+ version: 0.1.2
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-05-19 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic_duration
@@ -93,6 +93,7 @@ files:
93
93
  - lib/screen_recording.rb
94
94
  - readme.md
95
95
  - release_notes.md
96
+ - test/adb.rb
96
97
  - test/all_tests.rb
97
98
  - test/mock_execute.rb
98
99
  - test/test_run.rb
@@ -117,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  version: '0'
118
119
  requirements: []
119
120
  rubyforge_project:
120
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.6
121
122
  signing_key:
122
123
  specification_version: 4
123
124
  summary: Measure flaky Ruby Appium tests