flaky 0.0.31 → 0.1.0

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: bde901014870073afd529d4a644b9d3007c32882
4
- data.tar.gz: fed526fb87a8ce4dc2ba7b131cc59d3bbe79735a
3
+ metadata.gz: 9421ff9ef34076e88d0b894f570fc5d1560322ff
4
+ data.tar.gz: 3c1edb28ce8cfffe5e5a2cfcde4129653fd0e3cf
5
5
  SHA512:
6
- metadata.gz: 71ad3c7f26de7483a7dae6fbe3aeb6163de69d35289b54e051e6dcab024cd312b61f8fc59cfa89eb8c07f49421f099c503428dc8ada3c0914a4eaf2f6a5b71e9
7
- data.tar.gz: 31db18425338460ec3516fcc91355c2841225c3ae6abbd37a467453f5ea6f576a597e6362e10560d34f0220f041d255ca1a968a0b7a0b6575be2ee7fc9935974
6
+ metadata.gz: 0c16687f1d4185b021f7d97c4cb7a3de2d8127a3e7dee2fa6c19c2798ba820c87792705019fa69f4ae6c538e93b0ad5c4c28fc38ad862b69c1ec9f1fa9092e77
7
+ data.tar.gz: 48e1860b24d2c53d2e2a1ea9ec9cde63665866e8b37225d967b8267771b5632828dafd8bb5846827b6eae0642985bc9a14574d0e2b8f90c3101cc4cfb8cb043d
data/bin/flake CHANGED
@@ -24,6 +24,8 @@ if disable_video != nil
24
24
  args.delete_at(disable_video) # remove flag from args
25
25
  end
26
26
 
27
+ Flaky.no_video = true if ENV['SAUCE_USERNAME'] && ENV['SAUCE_ACCESS_KEY']
28
+
27
29
  puts "Recording Video: #{!Flaky.no_video}"
28
30
 
29
31
  if args && args.length === 1 && args.first === 'auth'
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
 
27
27
  s.add_runtime_dependency 'chronic_duration', '~> 0.10.2'
28
28
  s.add_runtime_dependency 'posix-spawn', '~> 0.3.6'
29
+ s.add_runtime_dependency 'toml', '~> 0.1.1'
29
30
 
30
31
  s.add_development_dependency 'rake', '~> 10.1.0'
31
32
 
@@ -7,10 +7,11 @@ require 'rubygems' # gem requires
7
7
  require 'chronic_duration'
8
8
  require 'posix/spawn' # http://rubygems.org/gems/posix-spawn
9
9
  require 'digest/md5'
10
+ require 'toml'
10
11
 
11
12
  module Flaky
12
- VERSION = '0.0.31' unless defined? ::Flaky::VERSION
13
- DATE = '2014-01-29' unless defined? ::Flaky::DATE
13
+ VERSION = '0.1.0' unless defined? ::Flaky::VERSION
14
+ DATE = '2014-04-30' unless defined? ::Flaky::DATE
14
15
 
15
16
  class << self; attr_accessor :no_video; end
16
17
  self.no_video = false; # set default value
@@ -24,4 +25,7 @@ module Flaky
24
25
  require_relative 'flaky/run/from_file'
25
26
  require_relative 'flaky/run/one_test'
26
27
  require_relative 'flaky/run/two_pass'
27
- end
28
+ end
29
+
30
+ # sync all writes to stdout.
31
+ $stdout.sync = true
@@ -285,6 +285,15 @@ module Flaky
285
285
  Dir.glob(File.join(app_logs, '*')).each { |f| FileUtils.cp f, dest_dir }
286
286
  end
287
287
  FileUtils.rm_rf app_logs
288
+
289
+ # copy android coverage
290
+ coverage_folder = '/tmp/flaky/coverage'
291
+ FileUtils.mkdir_p coverage_folder
292
+ coverage_file = '/tmp/coverage.ec'
293
+ if File.exists? '/tmp/coverage.ec'
294
+ FileUtils.cp coverage_file, File.join(coverage_folder, "#{Time.now.to_i}.ec")
295
+ File.delete coverage_file
296
+ end
288
297
  end
289
298
 
290
299
  passed
@@ -346,8 +355,6 @@ module Flaky
346
355
  end
347
356
  end
348
357
 
349
- $stdout.flush # flush for Jenkins CI
350
-
351
358
  @last_test = test_name
352
359
  passed
353
360
  end
@@ -15,21 +15,31 @@ module Flaky
15
15
  appium = Appium.new(android: is_android) unless running_on_sauce
16
16
 
17
17
  current_dir = Dir.pwd
18
- raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile'))
18
+ rakefile = File.expand_path(File.join(current_dir, 'Rakefile'))
19
+ raise "Rakefile doesn't exist in #{current_dir}" unless File.exists? rakefile
20
+ flaky_txt = File.expand_path(File.join(current_dir, 'flaky.txt'))
19
21
 
20
- Dir.glob(File.join current_dir, 'appium', os, 'specs', '**/*.rb') do |test_file|
21
- file = test_file
22
- name = File.basename file, '.*'
22
+ parsed = TOML.load File.read flaky_txt
23
+ puts "flaky.txt: #{parsed}"
24
+ android_dir = parsed['android']
25
+ ios_dir = parsed['ios']
26
+ glob = parsed.fetch 'glob', '**/*.rb'
23
27
 
24
- raise "#{test_file} does not exist." if file.empty?
28
+ active_dir = is_android ? android_dir : ios_dir
29
+ final_path = File.expand_path File.join current_dir, active_dir, glob
30
+ puts "Globbing: #{final_path}"
25
31
 
26
- test_name = file.sub(current_dir + '/appium/', '')
32
+ Dir.glob(final_path) do |test_file|
33
+ raise "#{test_file} does not exist." unless File.exist?(test_file)
34
+ test_file = File.expand_path test_file
35
+
36
+ test_name = test_file.sub(File.expand_path(File.join(current_dir, active_dir), ''))
27
37
  test_name = File.join(File.dirname(test_name), File.basename(test_name, '.*'))
28
38
 
29
39
  count.times do
30
40
  File.open('/tmp/flaky/current.txt', 'a') { |f| f.puts "Running: #{test_name} on #{os}" }
31
41
  appium.start unless running_on_sauce
32
- run_cmd = "cd #{current_dir}; rake #{os.downcase}['#{name}',#{Flaky.no_video}]"
42
+ run_cmd = "cd #{current_dir}; rake #{os.downcase}['#{test_file}',#{Flaky.no_video}]"
33
43
  passed = flaky.execute run_cmd: run_cmd, test_name: test_name, appium: appium, sauce: running_on_sauce
34
44
  break if passed # move onto the next test after one successful run
35
45
  end
@@ -2,6 +2,8 @@
2
2
  require 'rubygems'
3
3
  require 'posix-spawn'
4
4
 
5
+ require_relative 'flaky.rb'
6
+
5
7
  module Flaky
6
8
  class << self
7
9
 
@@ -27,6 +29,8 @@ module Flaky
27
29
  end
28
30
 
29
31
  def screen_recording_start opts={}
32
+ return if Flaky.no_video
33
+
30
34
  os = opts[:os]
31
35
  path = opts[:path]
32
36
  raise ':os is required' unless os
data/readme.md CHANGED
@@ -16,9 +16,9 @@ Must set `ENV['APPIUM_HOME']` to point to the appium folder containing `server.j
16
16
 
17
17
  This only works with:
18
18
 
19
- - [Ruby / appium_lib iOS](https://github.com/appium/ruby_lib_ios)
20
- - iOS iPhone Simulator 6.1
21
- - Unique test names per platform
19
+ - [Ruby / appium_lib](https://github.com/appium/ruby_lib)
20
+ - iOS iPhone Simulator 6.1 +
21
+ - Unique test file names per platform
22
22
 
23
23
  #### Security dialogs
24
24
 
@@ -1,3 +1,9 @@
1
+ #### v0.0.31 2014-01-29
2
+
3
+ - [fc6bb10](https://github.com/appium/flaky/commit/fc6bb107661869ff93a34a7947488ac904c3c0c5) Release 0.0.31
4
+ - [bc82107](https://github.com/appium/flaky/commit/bc82107f0b51f5a74a5d44332f62a8e52468b32f) Flush stdout for CI
5
+
6
+
1
7
  #### v0.0.30 2014-01-29
2
8
 
3
9
  - [038a3d4](https://github.com/appium/flaky/commit/038a3d491839b221b4784ee68b822c565150aa5c) Release 0.0.30
metadata CHANGED
@@ -1,55 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flaky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.1.0
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-29 00:00:00.000000000 Z
11
+ date: 2014-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic_duration
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.10.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.10.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: posix-spawn
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.3.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.3.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: toml
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.1.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ~>
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
61
  version: 10.1.0
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ~>
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: 10.1.0
55
69
  description: Measure flaky Ruby Appium tests.
@@ -60,7 +74,7 @@ executables:
60
74
  extensions: []
61
75
  extra_rdoc_files: []
62
76
  files:
63
- - .gitignore
77
+ - ".gitignore"
64
78
  - LICENSE-2.0.txt
65
79
  - Rakefile
66
80
  - bin/flake
@@ -93,17 +107,17 @@ require_paths:
93
107
  - lib
94
108
  required_ruby_version: !ruby/object:Gem::Requirement
95
109
  requirements:
96
- - - '>='
110
+ - - ">="
97
111
  - !ruby/object:Gem::Version
98
112
  version: 1.9.3
99
113
  required_rubygems_version: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - '>='
115
+ - - ">="
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  requirements: []
105
119
  rubyforge_project:
106
- rubygems_version: 2.1.11
120
+ rubygems_version: 2.2.2
107
121
  signing_key:
108
122
  specification_version: 4
109
123
  summary: Measure flaky Ruby Appium tests