flaky 0.1.1 → 0.1.2
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 +4 -4
- data/lib/flaky.rb +2 -2
- data/lib/flaky/appium.rb +1 -1
- data/lib/flaky/run/all_tests.rb +0 -3
- data/lib/flaky/run/one_test.rb +17 -8
- data/release_notes.md +8 -0
- data/test/adb.rb +14 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 731535ecad6aee9b747f751cd654a7ad183a13a1
|
4
|
+
data.tar.gz: 892cd6407dcfa844edc09a5b0b601bfaaaed6861
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
14
|
-
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`
|
data/lib/flaky/run/all_tests.rb
CHANGED
@@ -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
|
data/lib/flaky/run/one_test.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
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 "#{
|
38
|
+
raise "#{test_file} does not exist." unless File.exists?(test_file)
|
32
39
|
|
33
|
-
test_name =
|
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}['#{
|
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.
|
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:
|
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.
|
121
|
+
rubygems_version: 2.4.6
|
121
122
|
signing_key:
|
122
123
|
specification_version: 4
|
123
124
|
summary: Measure flaky Ruby Appium tests
|