quokkadb 1.1.2 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b5a09fcef06ad828827b17f34aa3675f3420709
4
- data.tar.gz: 932e3a7dcff9d3d60b8446dde29856125dbd83da
3
+ metadata.gz: 449e92d5118c28d28c4f67ee0db6b326eb10b870
4
+ data.tar.gz: 56f3fcabdf4b1982a262045b675ce9245cc4a045
5
5
  SHA512:
6
- metadata.gz: 697906eb177601dccbced3c50f372d845f658780b35c29afe05786d2b7ef1719404fe299f7c5f3bae21b776c162a739b8562eac4ec4387705591dfe24c0d8a0d
7
- data.tar.gz: 307642b5e60d6fa7d9bf00caacfae37d0b1c77758b513031f00f10038c3127b5eea4ba98ef8280af024dbadf03fb27bf122031820b2e4f6b54ab1866ccac35f1
6
+ metadata.gz: 20f009983088a8e0767ecd74aaf2b41304d5ce5a836b8b7f4120f693697e41ae89fb64fda428c0e6f4aaa175ebf5fd9a92080a4086d4f5cb6568813754f5837b
7
+ data.tar.gz: d72e0a8322fdf1b803fbd3c4a883166304af9dda990a34934a6e6cd6f6cd824cca49f2987ab19d5142d0b12acb0d8fff3e725b82b589a59896c4fc0c95b5dbee
data/lib/quokkadb.rb CHANGED
@@ -9,7 +9,7 @@ class QuokkADB
9
9
  attr_accessor :ADBRunner
10
10
  attr_accessor :parser
11
11
 
12
- def initialize(runner:, package:, annotation: nil, shards: nil, index: nil, serial: nil, background_black: false)
12
+ def initialize(runner:, package:, annotation: nil, shards: nil, index: nil, serial: nil, background_black: false, debug_mode: false)
13
13
  @runner = runner
14
14
  @package = package
15
15
  @annotation = annotation
@@ -17,6 +17,7 @@ class QuokkADB
17
17
  @index = index
18
18
  @serial = serial
19
19
  @background_black = background_black
20
+ @debug_mode = debug_mode
20
21
 
21
22
  @ADBRunner = ADBRunner.new()
22
23
  @parser = ADBTestParser.new()
@@ -42,6 +43,10 @@ class QuokkADB
42
43
 
43
44
  def parse_results(full_log)
44
45
  full_log.each_line do |log|
46
+ if @debug_mode
47
+ puts(log)
48
+ end
49
+
45
50
  if (log.include?("FAILURES!!!") or log.include?("Process crashed while executing") or log.include?('Process crashed.') or log.include?("INSTRUMENTATION_FAILED"))
46
51
  puts("exit 1")
47
52
  exit(1)
@@ -49,6 +54,10 @@ class QuokkADB
49
54
  end
50
55
 
51
56
  @parser.test_results.each do |result|
57
+ if @debug_mode
58
+ puts result
59
+ end
60
+
52
61
  if (!result.passed)
53
62
  puts("exit 1")
54
63
  exit(1)
@@ -20,6 +20,8 @@ class ADBTestParser
20
20
 
21
21
  def parse_line(line:, background_black: false)
22
22
  @lock.synchronize do
23
+ early_abort(background_black) if line.include?('Process crashed')
24
+
23
25
  # If starts with prefix, we are not parsing an error any more (if we were)
24
26
  @parsing_error = false if line.include?('INSTRUMENTATION_STATUS')
25
27
 
@@ -69,6 +71,18 @@ class ADBTestParser
69
71
  @current_result = TestResult.new()
70
72
  end
71
73
 
74
+ def early_abort(background_black)
75
+ @current_result.original_test = @current_test
76
+ @current_result.passed = false
77
+ @test_results.push(@current_result)
78
+
79
+ print_result(@current_result, background_black: background_black)
80
+ clear
81
+
82
+ puts("Testing ended abruptly.".red)
83
+ puts("This is likely due to a background thread encountering an exception. Check logcat for details.".yellow)
84
+ end
85
+
72
86
  def strip(str, substring)
73
87
  str.sub(substring, '').gsub("\n", '').gsub("\r", '')
74
88
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quokkadb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Beveridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-10 00:00:00.000000000 Z
11
+ date: 2017-04-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ADB test parsing libraryr
14
14
  email: joe.beveridge@shopify.com